Sensors on a =?iso-8859-1?Q?Kn=FCrr?= RMS Device
Message-ID: <53d129bf.9uw/3wFJ1amG4fON%bk(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Module: check_mk
Branch: master
Commit: bbdb021b6c50a5f6dc769202c1f4bc61c7be7885
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bbdb021b6c50a5…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Jul 24 17:43:24 2014 +0200
knuerr_sensors: New Check to monitor Sensors on a Knürr RMS Device
---
.werks/184 | 8 ++++++++
ChangeLog | 3 ++-
checkman/knuerr_sensors | 15 +++++++++++++++
checks/knuerr_sensors | 46 ++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 71 insertions(+), 1 deletion(-)
diff --git a/.werks/184 b/.werks/184
new file mode 100644
index 0000000..50bff22
--- /dev/null
+++ b/.werks/184
@@ -0,0 +1,8 @@
+Title: knuerr_sensors: New Check to monitor Sensors on a Knürr RMS Device
+Level: 1
+Component: checks
+Version: 1.2.5i5
+Date: 1406216559
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index d255d2e..9231198 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -40,9 +40,10 @@
* 1135 bintec_sensors.voltage, bintec_sensors.temp: New Checks for Voltage and
Temperature Sensors of Bintec Routers
* 1048 mem.win: support predictive levels...
* 1136 bintec_brrp_status: New Check for BRRP States on Bintec Routers
- * 0183 sentry_pdu: New check to monitor plugs of sentry PDUs
* 0640 jolokia_metrics.gc, jolokia_metrics.tp: now come with its own pnp templates
* 1088 included check_mk_agent windows msi installer...
+ * 0183 sentry_pdu: New check to monitor plugs of sentry PDUs
+ * 0184 knuerr_sensors: New Check to monitor Sensors on a Knürr RMS Device
* 0994 FIX: agent plugin smart: fixed syntax error
* 0989 FIX: logwatch.ec: Fix forwarding multiple messages via syslog/TCP...
* 0943 FIX: if.include: fixed incorrect traffic percentage values in the check output
of if checks...
diff --git a/checkman/knuerr_sensors b/checkman/knuerr_sensors
new file mode 100644
index 0000000..fdd99a7
--- /dev/null
+++ b/checkman/knuerr_sensors
@@ -0,0 +1,15 @@
+title: Knürr RMS Sensors
+agents: snmp
+catalog: hw/environment/knuerr
+license: GPL
+distribution:
+description:
+ This check monitors the sensor contacts on a Knürr RMS Monitoring System. For each
Sensor who is not in a ok state, a {CRITICAL} will be
+ triggered.
+
+item:
+ The Sesorname as configured in the device
+
+inventory:
+ All available sensors are automatically inventorized.
+
diff --git a/checks/knuerr_sensors b/checks/knuerr_sensors
new file mode 100644
index 0000000..6b43b7c
--- /dev/null
+++ b/checks/knuerr_sensors
@@ -0,0 +1,46 @@
+#!/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.
+
+def inventory_knuerr_sensors(info):
+ for sensor, state in info:
+ yield sensor, None
+
+def check_knuerr_sensors(item, _no_params, info):
+ for sensor, state in info:
+ if sensor == item:
+ if state != '0':
+ return 2, "Sensor triggered"
+ return 0, "Sensor not triggered"
+ return 3, "Sensor not longer found"
+
+check_info["knuerr_sensors"] = {
+ "check_function" : check_knuerr_sensors,
+ "inventory_function" : inventory_knuerr_sensors,
+ "service_description" : "Sensor %s",
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0")
== ".1.3.6.1.4.1.3711.15.1",
+ "snmp_info" : ( ".1.3.6.1.4.1.3711.15.1.1.2", [ 1, 5
])
+}
+