Module: check_mk
Branch: master
Commit: 69f38f0d12ebe50875f77847eda1dd02bb83d80b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=69f38f0d12ebe5…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Wed Jul 1 12:54:19 2015 +0200
wut_webtherm.humidity: New check to support humidity sensors on WuT devices
---
checks/wut_webtherm | 77 +++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 72 insertions(+), 5 deletions(-)
diff --git a/checks/wut_webtherm b/checks/wut_webtherm
index 262087c..a88fa29 100644
--- a/checks/wut_webtherm
+++ b/checks/wut_webtherm
@@ -36,12 +36,79 @@ def detect_webtherm(oid):
".1.3.6.1.4.1.5040.1.2.16",
".1.3.6.1.4.1.5040.1.2.18" ]
+#.
+# .--Air Pressure--------------------------------------------------------.
+# | _ _ ____ |
+# | / \ (_)_ __ | _ \ _ __ ___ ___ ___ _ _ _ __ ___ |
+# | / _ \ | | '__| | |_) | '__/ _ \/ __/ __| | | | '__/ _ \ |
+# | / ___ \| | | | __/| | | __/\__ \__ \ |_| | | | __/ |
+# | /_/ \_\_|_| |_| |_| \___||___/___/\__,_|_| \___| |
+# | |
+# '----------------------------------------------------------------------'
+
+#def inventory_wut_webtherm_pressure(info):
+# for index, reading in info:
+# if index.split(".")[1] == "3":
+# yield "3", None
+#
+#
+#def check_wut_webtherm_pressure(item, params, info):
+# return 3, "Not implemented yet"
+#
+#
+#check_info["wut_webtherm.pressure"] = {
+# "inventory_function" : inventory_wut_webtherm_pressure,
+# "check_function" : check_wut_webtherm_pressure,
+# "service_description" : "Pressure %s",
+#}
+
+#.
+# .--Humidity------------------------------------------------------------.
+# | _ _ _ _ _ _ |
+# | | | | |_ _ _ __ ___ (_) __| (_) |_ _ _ |
+# | | |_| | | | | '_ ` _ \| |/ _` | | __| | | | |
+# | | _ | |_| | | | | | | | (_| | | |_| |_| | |
+# | |_| |_|\__,_|_| |_| |_|_|\__,_|_|\__|\__, | |
+# | |___/ |
+# '----------------------------------------------------------------------'
+
+wut_webtherm_humidity_defaultlevels = (35, 40, 60, 65)
+
+def inventory_wut_webtherm_humidity(info):
+ print info
+ for index, reading in info:
+ if index.split(".")[1] == "2":
+ yield "2", None
+
+
+def check_wut_webtherm_humidity(item, params, info):
+ humidity = float(line[1].replace(",","."))
+ return check_humidity(humidity, params)
+
+
+check_info["wut_webtherm.humidity"] = {
+ "inventory_function" : inventory_wut_webtherm_humidity,
+ "check_function" : check_wut_webtherm_humidity,
+ "service_description" : "Humidity %s",
+ "includes" : [ "humidity.include" ],
+ "group" : "humidity",
+}
+
+#.
+# .--Temperature---------------------------------------------------------.
+# | _____ _ |
+# | |_ _|__ _ __ ___ _ __ ___ _ __ __ _| |_ _ _ _ __ ___ |
+# | | |/ _ \ '_ ` _ \| '_ \ / _ \ '__/ _` | __| | | | '__/ _ \
|
+# | | | __/ | | | | | |_) | __/ | | (_| | |_| |_| | | | __/ |
+# | |_|\___|_| |_| |_| .__/ \___|_| \__,_|\__|\__,_|_| \___| |
+# | |_| |
+# '----------------------------------------------------------------------'
+
factory_settings["wut_webtherm_defaultlevels"] = {
"levels" : (30, 35),
}
-def inventory_webtherm(info):
- print info
+def inventory_wut_webtherm(info):
# line[0] is 1.1, 2.1, 3.1, 6.1, 8.1, 16.1 or 18.1 depending on MIB variant. We chop
# of the first part in order to get independent of that.
for line in info:
@@ -53,7 +120,7 @@ def inventory_webtherm(info):
continue
yield line[0].split(".")[1], {}
-def check_webtherm(item, params, info):
+def check_wut_webtherm(item, params, info):
for line in info:
if line[0].split(".")[1] == item:
temp = float(line[1].replace(",", "."))
@@ -62,8 +129,8 @@ def check_webtherm(item, params, info):
check_info["wut_webtherm"] = {
'default_levels_variable' : "wut_webtherm_defaultlevels",
- 'inventory_function' : inventory_webtherm,
- 'check_function' : check_webtherm,
+ 'inventory_function' : inventory_wut_webtherm,
+ 'check_function' : check_wut_webtherm,
'service_description' : 'Temperature %s',
'has_perfdata' : True,
'snmp_info' : ('.1.3.6.1.4.1.5040.1.2',