Module: check_mk
Branch: master
Commit: c629e01d0bfdd17e2df722b8e51f07347377692f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c629e01d0bfdd1…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Jan 2 12:53:47 2017 +0100
4175 didactum_sensors_analog.humid: new check which monitors the humidity of Didactum
devices supporting the DIDACTUM-SYSTEM-MIB
Change-Id: I37ce8da53b07f6098aae5946cf1ca20a75a9a3dc
---
.werks/4175 | 9 +++++++++
ChangeLog | 1 +
checks/didactum.include | 6 +++---
checks/didactum_sensors_analog | 26 ++++++++++++++++++++++++++
checks/humidity.include | 2 +-
5 files changed, 40 insertions(+), 4 deletions(-)
diff --git a/.werks/4175 b/.werks/4175
new file mode 100644
index 0000000..3864820
--- /dev/null
+++ b/.werks/4175
@@ -0,0 +1,9 @@
+Title: didactum_sensors_analog.humid: new check which monitors the humidity of Didactum
devices supporting the DIDACTUM-SYSTEM-MIB
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i4
+Date: 1483357949
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index cefd524..eb2268f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
* 4201 mkeventd_status: avoid duplicate averaging, make graphs more precise in time
resolution...
* 4007 Windows Agent: Reduced number of needless WMI Queries when Skype performance
counters are missing...
* 4210 jolokia_generic, jolokia_generic.rate, jolokia_generic.string: New checks to
monitor custom MBeans
+ * 4175 didactum_sensors_analog.humid: new check which monitors the humidity of
Didactum devices supporting the DIDACTUM-SYSTEM-MIB
* 4171 FIX: perle_psmu: fixed value error...
* 4172 FIX: smart.temp: fixed discovery and check function...
* 4173 FIX: if.include: ignore some more keys in 'Network interfaces and switch
ports' rule which are only used for interface grouping
diff --git a/checks/didactum.include b/checks/didactum.include
index ed164e9..7732215 100644
--- a/checks/didactum.include
+++ b/checks/didactum.include
@@ -61,7 +61,7 @@ def parse_didactum_sensors(info):
"value" : value,
})
- if ty in [ "temperature", "voltage" ] and len(line) == 8:
+ if len(line) == 8:
crit_lower, warn_lower, warn, crit = line[4:]
parsed[ty][name].update({
"levels" : (float(warn), float(crit)),
@@ -72,5 +72,5 @@ def parse_didactum_sensors(info):
def inventory_didactum_sensors(parsed, what):
- return [ (sensorname, {}) for sensorname, vals in parsed[what].items()
- if vals["state_readable"] not in [ "off", "not
connected" ] ]
+ return [ (sensorname, {}) for sensorname, attrs in parsed.get(what, {}).items()
+ if attrs["state_readable"] not in [ "off", "not
connected" ] ]
diff --git a/checks/didactum_sensors_analog b/checks/didactum_sensors_analog
index ac4c5aa..25e2f74 100644
--- a/checks/didactum_sensors_analog
+++ b/checks/didactum_sensors_analog
@@ -98,6 +98,32 @@ check_info['didactum_sensors_analog'] = {
#.
+# .--humidity------------------------------------------------------------.
+# | _ _ _ _ _ |
+# | | |__ _ _ _ __ ___ (_) __| (_) |_ _ _ |
+# | | '_ \| | | | '_ ` _ \| |/ _` | | __| | | | |
+# | | | | | |_| | | | | | | | (_| | | |_| |_| | |
+# | |_| |_|\__,_|_| |_| |_|_|\__,_|_|\__|\__, | |
+# | |___/ |
+# '----------------------------------------------------------------------'
+
+
+def check_didactum_sensors_analog_humid(item, params, parsed):
+ if item in parsed["humidity"]:
+ return check_humidity(parsed["humidity"][item]["value"],
params)
+
+
+check_info['didactum_sensors_analog.humidity'] = {
+ 'inventory_function' : lambda parsed: inventory_didactum_sensors(parsed,
"humidity"),
+ 'check_function' : check_didactum_sensors_analog_humid,
+ 'service_description' : 'Humidity %s',
+ 'has_perfdata' : True,
+ 'group' : 'humidity',
+ 'includes' : [ 'humidity.include',
'didactum.include' ],
+}
+
+
+#.
# .--voltage-------------------------------------------------------------.
# | _ _ |
# | __ _____ | | |_ __ _ __ _ ___ |
diff --git a/checks/humidity.include b/checks/humidity.include
index 2c38ebf..f0416e9 100644
--- a/checks/humidity.include
+++ b/checks/humidity.include
@@ -27,7 +27,7 @@
# old params = (crit_low , warn_low, warn, crit)
def check_humidity(humidity, params):
- if params is None:
+ if params is None or params == {}:
params = {
"levels_lower" : (-1, -1),
"levels" : (101, 101),