Module: check_mk
Branch: master
Commit: 508a2da68aafc58902b95d8ff62cd52d10c60cba
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=508a2da68aafc5…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Oct 18 15:08:12 2013 +0200
sensatronics_temp: New Check for Sensatronic E4 Temperatur Sensor
---
ChangeLog | 3 +-
checkman/sensatronics_temp | 23 ++++++++++++++
checks/sensatronics_temp | 60 ++++++++++++++++++++++++++++++++++++
web/plugins/perfometer/check_mk.py | 1 +
4 files changed, 86 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 274725a..02e920f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -47,6 +47,8 @@
* Apache ActiveMQ: New Special Agent and Check to query ActiveMQ Queues
* FIX: hp_proliant: Correct handling of missing snmp data
* FIX: logwatch.ec: No longer forwards "I" lines to event console
+ * windows_tasks: New Check to monitor the Windows Task Scheduler
+ * sensatronics_temp: New Check for Sensatronic E4 Temperatur Sensor
WATO:
* You can now have site-specific global settings when using
@@ -2297,7 +2299,6 @@
mount points). No external plugin is needed.
* Windows agent: new section <<<fileinfo>>> for monitoring file
sizes
(and later possible ages)
- * windows_tasks: New Check to monitor the Windows Task Scheduler
* logwatch: allow to classify messages based on their count (see
man page of logwatch for details)
* fileinfo: new check for monitoring age and size of files
diff --git a/checkman/sensatronics_temp b/checkman/sensatronics_temp
new file mode 100644
index 0000000..73a3760
--- /dev/null
+++ b/checkman/sensatronics_temp
@@ -0,0 +1,23 @@
+title: Sensatronic E4 Temperature sensors
+agents: snmp
+catalog: hw/environment
+license: GPL
+distribution: check_mk
+description:
+ This check polls the state of temperature sensors
+ attached to a Sensatronic E4 Device
+
+item:
+ Combination of IO unit number (3-6) and sensors Name
+
+perfdata:
+ One variable: the current temperature in degrees celsius.
+
+inventory:
+ All available temperature sensors are automatically inventorized.
+
+[parameters]
+warn(int): Optional warning level for the temperature. If you use no
+ parameters, then the builtin state will be used (this is the default).
+crit(int): Critical level for the temperature.
+
diff --git a/checks/sensatronics_temp b/checks/sensatronics_temp
new file mode 100644
index 0000000..0fbd9c0
--- /dev/null
+++ b/checks/sensatronics_temp
@@ -0,0 +1,60 @@
+#!/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.
+
+sensatronics_temp_default_levels = ( 23.0, 25.0 )
+def inventory_sensatronics_temp(info):
+ return [ (x[0], sensatronics_temp_default_levels) for x in info if savefloat(x[1])
> 0 ]
+
+def check_sensatronics_temp(item, params, info):
+ for line in info:
+ if line[0] == item:
+ warn, crit = params
+ temperatur = savefloat(line[1])
+ message = "Temperatur: %.2f°C" % temperatur
+ perf = [ ('temp', temperatur, warn, crit ) ]
+ if temperatur > crit:
+ return 2, message, perf
+ elif temperatur > warn:
+ return 1, message, perf
+ return 0, message, perf
+
+ return 3, "Sensor not found"
+
+check_info["sensatronics_temp"] = {
+ "check_function" : check_sensatronics_temp,
+ "inventory_function" : inventory_sensatronics_temp,
+ "service_description" : "Sensor %s",
+ "has_perfdata" : True,
+ "group" : "room_temperature",
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0")
in [".1.3.6.1.4.1.16174.1.1.1"] ,
+ "snmp_info" : (".1.3.6.1.4.1.16174.1.1.1.3",
+ [ x for x in range(16) ],
+ [
+ "1.0", #Sensor Name
+ "2.0", #Sensor Value
+ ]),
+}
+
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index f1d0254..0e1c80a 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -274,6 +274,7 @@ perfometers["check_mk-akcp_sensor_temp"] =
perfometer_temperature
perfometers["check_mk-fsc_temp"] = perfometer_temperature
perfometers["check_mk-viprinet_temp"] = perfometer_temperature
perfometers["check_mk-hwg_temp"] = perfometer_temperature
+perfometers["check_mk-sensatronics_temp"] = perfometer_temperature
def perfometer_blower(row, check_command, perf_data):
rpm = saveint(perf_data[0][1])