Module: check_mk
Branch: master
Commit: ec4d9b1aaae1abdd58bf07b2160e986bacd7465b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ec4d9b1aaae1ab…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Dec 16 16:00:54 2015 +0100
#2817 cmc_temp: New temperature check for Rittal devices using the CMC MIB
---
.werks/2817 | 9 +++++++++
ChangeLog | 1 +
checkman/cmc_temp | 19 ++++++++++++++++++
checks/cmc_temp | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 86 insertions(+)
diff --git a/.werks/2817 b/.werks/2817
new file mode 100644
index 0000000..bc8f20f
--- /dev/null
+++ b/.werks/2817
@@ -0,0 +1,9 @@
+Title: cmc_temp: New temperature check for Rittal devices using the CMC MIB
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1450278026
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index cf852c5..57fc82e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -66,6 +66,7 @@
* 2812 Avaya Series 88xx / 45xx: New temperature, fan and CPU utilization checks...
* 2870 dotnet_clrmemory, wmi_cpuload, wmi_webservices, msexch_activesync,
msexch_autodiscovery, msexch_availability, msexch_isstore, msexch_owa,
msexch_rpcclientaccess: a whole slew of new checks relating to monitoring MS Exchange...
* 2816 check_mail_loop: now supports STARTTLS for IMAP authentification
+ * 2817 cmc_temp: New temperature check for Rittal devices using the CMC MIB
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/checkman/cmc_temp b/checkman/cmc_temp
new file mode 100644
index 0000000..2d171bc
--- /dev/null
+++ b/checkman/cmc_temp
@@ -0,0 +1,19 @@
+title: Rittal CMC: Temperature
+agents: snmp
+catalog: hw/environment/rittal
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the temperature levels of Rittal devices
+ supporting the CMC MIB. The temperature levels can be configured (default to 45, 50).
+ The configured levels on the device can also get taken into account.
+
+item:
+ The sensor number: "1" or "2".
+
+perfdata:
+ One variable: the current temperature in degrees celsius.
+
+inventory:
+ There are always two temperature sensors detected. Creates one service for each sensor.
+
diff --git a/checks/cmc_temp b/checks/cmc_temp
new file mode 100644
index 0000000..cf02e5f
--- /dev/null
+++ b/checks/cmc_temp
@@ -0,0 +1,57 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 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.
+
+
+# [[[u'26', u'26']], [[u'45', u'15', u'45',
u'15']]]
+
+factory_settings["cmc_temp_default_levels"] = {
+ "levels" : (45, 50),
+}
+
+def inventory_cmc_temp(info):
+ # There are always two sensors
+ return [("1", {}), ("2", {})]
+
+def check_cmc_temp(item, params, info):
+ offset = int(item) - 1
+ current_temp = int(info[0][0][offset])
+ dev_high, dev_low = map(int, info[1][0][offset * 2:][:2])
+ return check_temperature(current_temp, params, dev_levels = (dev_high,
dev_high),
+ dev_levels_lower = (dev_low,
dev_low))
+
+check_info['cmc_temp'] = {
+ "inventory_function" : inventory_cmc_temp,
+ "check_function" : check_cmc_temp,
+ "has_perfdata" : True,
+ "group" : "temperature",
+ "default_levels_variable": "cmc_temp_default_levels",
+ "service_description" : "Temperature Sensor %s",
+ "snmp_scan_function" : lambda oid: ".1.3.6.1.4.1.2606.1" in
oid(".1.3.6.1.2.1.1.2.0"),
+ # valueTemperature1, valueTemperature2
+ "snmp_info" : [(".1.3.6.1.4.1.2606.1.1", [ 1, 2 ]),
+ # setpointHighTemperature1, setpointLowTemperature1,
setpointHighTemperature2, setpointLowTemperature2
+ (".1.3.6.1.4.1.2606.1.4", [4, 5, 6, 7])]
+}