Module: check_mk
Branch: master
Commit: b56efea572260985bfe2d7926d83ba220765286c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b56efea5722609…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Aug 11 17:55:54 2014 +0200
#1174 rms200_temp: New Temperature check for RMS200 Devices
---
.werks/1174 | 9 +++++
ChangeLog | 1 +
checkman/rms200_temp | 17 +++++++++
checks/rms200_temp | 61 ++++++++++++++++++++++++++++++++
pnp-templates/check_mk-rms200_temp.php | 1 +
web/plugins/perfometer/check_mk.py | 1 +
6 files changed, 90 insertions(+)
diff --git a/.werks/1174 b/.werks/1174
new file mode 100644
index 0000000..1acb76f
--- /dev/null
+++ b/.werks/1174
@@ -0,0 +1,9 @@
+Title: rms200_temp: New Temperature check for RMS200 Devices
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1407772519
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 62aabde..5f04028 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,7 @@
* 1172 New check sap.value_groups...
* 1173 cisco_secure: Check creates now a summary instead one service by port...
NOTE: Please refer to the migration notes!
+ * 1174 rms200_temp: New Temperature check for RMS200 Devices
* 1051 FIX: tcp_conn_stats: fix missing performance data...
* 1142 FIX: winperf_ts_sessions: fix computation, check has never really worked
* 1090 FIX: zfsget: fixed exception which happened on incomplete zfs entries
diff --git a/checkman/rms200_temp b/checkman/rms200_temp
new file mode 100644
index 0000000..9f5a82f
--- /dev/null
+++ b/checkman/rms200_temp
@@ -0,0 +1,17 @@
+title: RMS200 Unit: Temperatures
+agents: snmp
+catalog: hw/environment/infratec-plus
+license: GPL
+distribution: check_mk
+description:
+ This plugin polls the temperature of all connected sensors.
+ It is possible to define levels for warning and critical temperature. The plugin return
+ {CRIT} or {WARN} if the current temperatue is higher then one of the levels.
+
+
+inventory:
+ The inventory will create one service per device.
+
+[parameters]
+warn(int): Warning level for the temperature.
+crit(int): Critical level for the temperature.
diff --git a/checks/rms200_temp b/checks/rms200_temp
new file mode 100644
index 0000000..a0749c0
--- /dev/null
+++ b/checks/rms200_temp
@@ -0,0 +1,61 @@
+#!/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.
+
+rms200_temp_default_levels = ( 25, 28 )
+
+def inventory_rms200_temp(info):
+ return [ (x[0], "rms200_temp_default_levels" ) for x in info if x[2] !=
'0']
+
+def check_rms200_temp(item, params, info):
+ for line in info:
+ if line[0] == item:
+ warn, crit = params
+ temp = saveint(line[2])/100
+ name = line[1]
+ state = 0
+ if temp >= crit:
+ state = 2
+ elif temp >= warn:
+ state = 1
+ message = "Current Temperature: %d °C (%s)" % (temp, name)
+ perf = [ ('temp', temp, warn, crit ) ]
+ return state, message, perf
+ return 3, "No information found about the device"
+
+check_info["rms200_temp"] = {
+ "check_function" : check_rms200_temp,
+ "inventory_function" : inventory_rms200_temp,
+ "service_description" : "Temperature %s ",
+ "has_perfdata" : True,
+ "group" : "room_temperature",
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0")
== ".1.3.6.1.4.1.1909.13",
+ "snmp_info" : ( ".1.3.6.1.4.1.1909.13.1.1.1", [
+ 1, # ID,
+ 2, # Name,
+ 3, # Temp
+ ] ),
+}
+
diff --git a/pnp-templates/check_mk-rms200_temp.php
b/pnp-templates/check_mk-rms200_temp.php
new file mode 120000
index 0000000..b9c8459
--- /dev/null
+++ b/pnp-templates/check_mk-rms200_temp.php
@@ -0,0 +1 @@
+check_mk-stulz_temp.php
\ No newline at end of file
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 2f108c0..72b1981 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -342,6 +342,7 @@ perfometers["check_mk-qlogic_sanbox.temp"] =
perfometer_temperature
perfometers["check_mk-bintec_sensors.temp"] = perfometer_temperature
perfometers["check_mk-knuerr_rms_temp"] = perfometer_temperature
perfometers["check_mk-arris_cmts_temp"] = perfometer_temperature
+perfometers["check_mk-rms200_temp"] = perfometer_temperature
def perfometer_temperature_multi(row, check_command, perf_data):
display_value = -1