Module: check_mk
Branch: master
Commit: 6548bee220aecb88aa46d8e35700035ef2e2a2b8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6548bee220aecb…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Tue Apr 15 15:03:44 2014 +0200
wagner_titanus_topsense: new info check and overall status check for Wagner Titanus Top
Sens devices
---
.werks/892 | 8 ++
ChangeLog | 1 +
checkman/wagner_titanus_topsense.info | 16 +++
checkman/wagner_titanus_topsense.overall_status | 14 +++
checks/wagner_titanus_topsense | 119 +++++++++++++++++++++++
modules/catalog.py | 1 +
6 files changed, 159 insertions(+)
diff --git a/.werks/892 b/.werks/892
new file mode 100644
index 0000000..c4ccc7c
--- /dev/null
+++ b/.werks/892
@@ -0,0 +1,8 @@
+Title: wagner_titanus_topsense: new info check and overall status check for Wagner
Titanus Top Sens devices
+Level: 1
+Component: checks
+Version: 1.2.5i3
+Date: 1397566982
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 79dd18f..6d7932d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,7 @@
* 0806 ibm_svc_enclosurestats.temp: New Check for temperature in enclosures of IBM
SVC / Storwize V3700 / V7000 devices
* 0807 ibm_svc_enclosurestats.power: New check for power consumption of enclosures of
IBM SVC / Storwize V3700 / V7000 devices
* 0808 brocade_mlx*: Checks now also work correctly with Brocade ADX / FGS / ICX
devices
+ * 0892 wagner_titanus_topsense: new info check and overall status check for Wagner
Titanus Top Sens devices
* 0777 FIX: special agent emcvnx: did not work with security file authentication...
* 0786 FIX: zfsget: fixed compatibility with older Solaris agents...
* 0809 FIX: brocade_fcport: Fixed recently introduced problem with port speed
detection
diff --git a/checkman/wagner_titanus_topsense.info
b/checkman/wagner_titanus_topsense.info
new file mode 100644
index 0000000..db77d92
--- /dev/null
+++ b/checkman/wagner_titanus_topsense.info
@@ -0,0 +1,16 @@
+title: Wagner Titanus Top Sens: System Infos
+agents: snmp
+catalog: hw/environment/wagner
+license: GPL
+distribution: check_mk
+description:
+ Gathers some system information from Wagner Titanus Top Sens devices
+ and displays them. In detail these are:
+ Uptime, System Name, System Contact, System Location, Company, Model,
+ Revision and LSNi bus status.
+
+ This check is for information only and returns always {OK}.
+
+inventory:
+ Creates exactly one check for each Top Sense device called
+ Topsense Info.
diff --git a/checkman/wagner_titanus_topsense.overall_status
b/checkman/wagner_titanus_topsense.overall_status
new file mode 100644
index 0000000..75a49c2
--- /dev/null
+++ b/checkman/wagner_titanus_topsense.overall_status
@@ -0,0 +1,14 @@
+title: Wagner Titanus Top Sens: Overall Status
+agents: snmp
+catalog: hw/environment/wagner
+license: GPL
+distribution: check_mk
+description:
+ Checks the Overall Status of Wagner Titanus Top Sens devices.
+
+ If pswFailureDisplay reports to be switched off, the check returns {OK} and
+ {CRIT} otherwise.
+
+inventory:
+ Creates exactly one check for each Top Sense device called
+ Overall Status.
diff --git a/checks/wagner_titanus_topsense b/checks/wagner_titanus_topsense
new file mode 100644
index 0000000..1b89bf7
--- /dev/null
+++ b/checks/wagner_titanus_topsense
@@ -0,0 +1,119 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at
http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+wagner_titanus_topsense_info = [(".1.3.6.1.2.1.1", [1, #
sysDescr
+ 3, #
sysUpTimeInstance
+ 4, #
sysContact
+ 5, # sysName
+ 6]), #
sysLocation
+ (".1.3.6.1.4.1.34187.21501.1.1", [1, #
company
+ 2, # model
+ 3, # revision
+ 1006]), #
pswFailureDisplayOn
+ # off(0),
on(1)
+ (".1.3.6.1.4.1.34187.21501.2.1", [24584008]), #
tsLSNbusOnline
+ #
offline(0),online(1)
+ ]
+
+def wagner_titanus_topsense_scan(oid):
+ return
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.34187.21501")
+
+# .--titanus info--------------------------------------------------------.
+# | _ _ _ _ __ |
+# | | |_(_) |_ __ _ _ __ _ _ ___ (_)_ __ / _| ___ |
+# | | __| | __/ _` | '_ \| | | / __| | | '_ \| |_ / _ \ |
+# | | |_| | || (_| | | | | |_| \__ \ | | | | | _| (_) | |
+# | \__|_|\__\__,_|_| |_|\__,_|___/ |_|_| |_|_| \___/ |
+# | |
+# '----------------------------------------------------------------------'
+
+def inventory_wagner_titanus_topsense_info(info):
+ return [ (None, None) ]
+
+def check_wagner_titanus_topsense_info(item, _no_params, info):
+ ts_lsn_bus = info[2][0][0]
+ if ts_lsn_bus == "0":
+ ts_lsn_bus = "offline"
+ elif ts_lsn_bus == "1":
+ ts_lsn_bus = "online"
+ else:
+ ts_lsn_bus = "unknown"
+
+ message = "System: " + info[0][0][0]
+ message += ", Uptime: " + get_age_human_readable(int(info[0][0][1]) / 100)
+ message += ", System Name: " + info[0][0][3]
+ message += ", System Contact: " + info[0][0][2]
+ message += ", System Location: " + info[0][0][4]
+ message += ", Company: " + info[1][0][0]
+ message += ", Model: " + info[1][0][1]
+ message += ", Revision: " + info[1][0][2]
+ message += ", LSNi bus: " + ts_lsn_bus
+ return 0, message
+
+check_info["wagner_titanus_topsense.info"] = {
+ "check_function" : check_wagner_titanus_topsense_info,
+ "inventory_function" : inventory_wagner_titanus_topsense_info,
+ "service_description" : "Topsense Info",
+ "has_perfdata" : False,
+ "snmp_info" : wagner_titanus_topsense_info,
+ "snmp_scan_function" : wagner_titanus_topsense_scan
+}
+
+#.
+# .--overall status------------------------------------------------------.
+# | _ _ _ _ |
+# | _____ _____ _ __ __ _| | | ___| |_ __ _| |_ _ _ ___ |
+# | / _ \ \ / / _ \ '__/ _` | | | / __| __/ _` | __| | | / __| |
+# | | (_) \ V / __/ | | (_| | | | \__ \ || (_| | |_| |_| \__ \ |
+# | \___/ \_/ \___|_| \__,_|_|_| |___/\__\__,_|\__|\__,_|___/ |
+# | |
+# '----------------------------------------------------------------------'
+
+
+def inventory_wagner_titanus_topsense_overall_status(info):
+ return [ (None, None) ]
+
+def check_wagner_titanus_topsense_overall_status(item, _no_params, info):
+ psw_failure = info[1][0][3]
+ status = 3
+ if psw_failure == "0":
+ message = "Overall Status reports OK"
+ status = 0
+ else:
+ message = "Overall Status reports a problem"
+ status = 2
+ return status, message
+
+check_info["wagner_titanus_topsense.overall_status"] = {
+ "check_function" : check_wagner_titanus_topsense_overall_status,
+ "inventory_function" :
inventory_wagner_titanus_topsense_overall_status,
+ "service_description" : "Overall Status",
+ "has_perfdata" : False,
+ "snmp_info" : wagner_titanus_topsense_info,
+ "snmp_scan_function" : wagner_titanus_topsense_scan
+}
+
+#.
diff --git a/modules/catalog.py b/modules/catalog.py
index e69266d..d6b23e7 100644
--- a/modules/catalog.py
+++ b/modules/catalog.py
@@ -11,6 +11,7 @@ manpage_catalog_titles = {
"sensatronics" : "Sensatronics",
"stulz" : "STULZ",
"wut" : "Wiesemann & Theis",
+ "wagner" : "WAGNER Group",
"other" : "Other devices",
"network" : "Networking (Switches, Routers, etc.)",
"alcatel" : "Alcatel",