Module: check_mk
Branch: master
Commit: 971cd2c67e75e67c6361b7526bb344312b6772a0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=971cd2c67e75e6…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Apr 25 10:07:16 2014 +0200
akcp_daisy_temp: New Check for akcp daisyTemp sensor chains
Further information about the sensor type can be found here:
http://www.akcp.com/wp-content/uploads/2010/03/daisyTemp-sensor.pdf
---
.werks/156 | 8 +++++
ChangeLog | 1 +
checkman/akcp_daisy_temp | 30 ++++++++++++++++++
checks/akcp_daisy_temp | 74 +++++++++++++++++++++++++++++++++++++++++++
checks/akcp_sensor_humidity | 21 ++++++------
5 files changed, 122 insertions(+), 12 deletions(-)
diff --git a/.werks/156 b/.werks/156
new file mode 100644
index 0000000..8053af7
--- /dev/null
+++ b/.werks/156
@@ -0,0 +1,8 @@
+Title: akcp_daisy_temp: New Check for akcp daisyTemp sensor chains
+Level: 1
+Component: checks
+Version: 1.2.5i3
+Date: 1398413136
+Class: feature
+
+Further information about the sensor type can be found here:
http://www.akcp.com/wp-content/uploads/2010/03/daisyTemp-sensor.pdf
diff --git a/ChangeLog b/ChangeLog
index 406284d..497efe2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -37,6 +37,7 @@
* 0896 wagner_titanus_topsense.airflow_deviation: New Check for Airflow Deviation in
Wagner Titanus Top Sens devices
* 0897 wagner_titanus_topsense.temp: New Check for Temperature measured by Wagner
Titanus Top Sens devices
* 0898 ibm_svc_nodestats.disk_latency, ibm_svc_systemstats.disk_latency: New Checks
for Disk Latency in IBM SVC / Storwize V3700 / V7000 devices
+ * 0156 akcp_daisy_temp: New Check for akcp daisyTemp sensor chains...
* 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/akcp_daisy_temp b/checkman/akcp_daisy_temp
new file mode 100644
index 0000000..8e5d782
--- /dev/null
+++ b/checkman/akcp_daisy_temp
@@ -0,0 +1,30 @@
+title: AKCP daisyTemp Sensor
+agents: snmp
+catalog: hw/environment/akcp
+license: GPL
+distribution:
+description:
+ This check monitors the temperature of sensors attached
+ to AKCP daisyTemp sensor chain. The first attached sensor will be irgnored,
+ because this sensor is already represented by the the check akc_sensor_temp.
+
+item:
+ The item is the sensor description of the sensor as string.
+
+perfdata:
+ the current temperature in degree celsius
+
+inventory:
+ All available (without the first, see description) temperature sensors are automatically
inventorized.
+
+examples:
+ # set default levels for all akcp temperature sensors
+ akcp_daisy_temp_defaultlevels = (28, 34)
+
+[parameters]
+warning (int): temperature in degrees at which the check goes warning
+critical (int): level for critical temperature
+
+[configuration]
+akcp_daisy_temp_defaultlevels (int, int): Default levels. This is
+ preset to {(28, 32)}.
diff --git a/checks/akcp_daisy_temp b/checks/akcp_daisy_temp
new file mode 100644
index 0000000..9f5c54b
--- /dev/null
+++ b/checks/akcp_daisy_temp
@@ -0,0 +1,74 @@
+#!/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.
+akcp_daisy_temp_defaultlevels = (28, 32)
+
+def inventory_akcp_daisy_temp(info):
+ inventory = []
+ pass_first = True
+ for port, subport, name, temp in info:
+ if subport != '-1':
+ # We have to ignore the first item, because it will be also reported
+ # by akcp_sensor_temp on the port were this sensor chain are connected
+ if pass_first:
+ pass_first = False
+ continue
+ inventory.append((name, 'akcp_daisy_temp_defaultlevels' ))
+ return inventory
+
+def check_akcp_daisy_temp(item, params, info):
+ for port, subport, name, temp in info:
+ if name == item:
+ warn, crit = params
+ temp = savefloat(temp) / 10
+ infotext = "%.1f °C " % temp
+ levels = " (warn/crit at %.1f/%.1f °C)" % (warn, crit)
+ perfdata = [ ( "temperature", temp, warn, crit ) ]
+ if temp > crit:
+ return 2, infotext + levels, perfdata
+ if temp > warn:
+ return 1, infotext + levels, perfdata
+ return 0, infotext
+ return 3, "Sensor not found"
+
+check_info["akcp_daisy_temp"] = {
+ 'check_function': check_akcp_daisy_temp,
+ 'inventory_function': inventory_akcp_daisy_temp,
+ 'service_description': 'Temperature %s',
+ 'has_perfdata': True,
+ 'snmp_info': (
+ ".1.3.6.1.4.1.3854.1.2.2.1.19.33",
+ [ 1, 2, 3, 4, 5, 6, 7 ],
+ [
+ OID_END, # Port/Subport
+ "2.1.1", # subport
+ "2.1.2", # Sensor Name
+ "2.1.14", # Degree Celsius
+ ]
+ ),
+ 'snmp_scan_function': lambda oid: oid(".1.3.6.1.2.1.1.2.0") in\
+ [ ".1.3.6.1.4.1.3854.1.2.2.1.1",
".1.3.6.1.4.1.3854.1" ],
+ 'group' : 'room_temperature',
+}
diff --git a/checks/akcp_sensor_humidity b/checks/akcp_sensor_humidity
index 085805e..dd817b9 100644
--- a/checks/akcp_sensor_humidity
+++ b/checks/akcp_sensor_humidity
@@ -25,7 +25,7 @@
# Boston, MA 02110-1301 USA.
# +------------------------------------------------------------------+
-# | This file has been contributed by: |
+# | The initial version of this file has been contributed by: |
# | |
# | Michael Nieporte <Michael.Nieporte(a)uk-essen.de> |
# +------------------------------------------------------------------+
@@ -36,7 +36,7 @@ def inventory_akcp_sensor_humidity(info):
inventory = []
for desc, humidity, status, online in info:
if online == "1":
- inventory.append( (desc, "",
"akcp_sensor_humidity_defaultlevels") )
+ inventory.append( (desc, "akcp_sensor_humidity_defaultlevels") )
return inventory
def check_akcp_sensor_humidity(item, params, info):
@@ -52,14 +52,14 @@ def check_akcp_sensor_humidity(item, params, info):
( humidity, warnlow, critlow, warnhigh, crithigh)
perfdata = [ ( "humidity", humidity, critlow, warnlow,
warnhigh, crithigh ) ]
if inthumidity <= critlow or inthumidity >= crithigh:
- return (2, "Humidity is: " + infotext, perfdata )
+ return 2, "Humidity is: " + infotext, perfdata
elif inthumidity <= warnlow or inthumidity >= warnhigh:
- return (1, "Humidity is: " + infotext, perfdata )
+ return 1, "Humidity is: " + infotext, perfdata
else:
- return (0, "Humidity is: " + infotext, perfdata )
+ return 0, "Humidity is: " + infotext, perfdata
else:
- return (3, "Sensor is offline")
- return (3, "Sensor not found")
+ return 3, "Sensor is offline"
+ return 3, "Sensor not found"
@@ -68,9 +68,6 @@ def check_akcp_sensor_humidity(item, params, info):
# noStatus(1), normal(2), highWarning(3), highCritical(4),
# lowWarning(5), lowCritical(6), sensorError(7)
-
-
-
check_info["akcp_sensor_humidity"] = {
'check_function': check_akcp_sensor_humidity,
'inventory_function': inventory_akcp_sensor_humidity,
@@ -84,7 +81,7 @@ check_info["akcp_sensor_humidity"] = {
5, #sensorProbeHumidityOnline - online(1), offline(2)
],
),
- 'snmp_scan_function': \
- lambda oid: "AKCP" in oid(".1.3.6.1.4.1.3854.1.1.6.0") and
"sensorProbe" in oid(".1.3.6.1.4.1.3854.1.1.8.0"),
+ 'snmp_scan_function': lambda oid: oid(".1.3.6.1.2.1.1.2.0") in\
+ [ ".1.3.6.1.4.1.3854.1.2.2.1.1",
".1.3.6.1.4.1.3854.1" ],
'group': 'humidity',
}