Module: check_mk
Branch: master
Commit: b5def96c0abb167b0d0173761d045d324e206f73
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b5def96c0abb16…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri May 20 11:19:50 2016 +0200
3607 FIX wut_webtherm: fixed missing sensor data if only decimal comma marked values are
available
---
.werks/3607 | 10 ++++++++++
ChangeLog | 1 +
checks/wut_webtherm | 18 ++++++++++++------
3 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/.werks/3607 b/.werks/3607
new file mode 100644
index 0000000..1102894
--- /dev/null
+++ b/.werks/3607
@@ -0,0 +1,10 @@
+Title: wut_webtherm: fixed missing sensor data if only decimal comma marked values are
available
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1463735636
+
+
diff --git a/ChangeLog b/ChangeLog
index ea55290..2615aad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -226,6 +226,7 @@
* 3536 FIX: alcatel_timetra_chassis: fixed exception when check is not OK
* 3604 FIX: ups_capacity.include: fixed displaying wrong levels and cleanup
* 3605 FIX: kemp_loadmaster_ha, kemp_loadmaster_realserver, kemp_loadmaster_services:
fixed discovery if data is wrong or incomplete
+ * 3607 FIX: wut_webtherm: fixed missing sensor data if only decimal comma marked
values are available
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/wut_webtherm b/checks/wut_webtherm
index fcdc7f4..42dc58e 100644
--- a/checks/wut_webtherm
+++ b/checks/wut_webtherm
@@ -36,24 +36,29 @@ def parse_wut_webtherm(info):
"3" : "air_pressure",
}
parsed = {}
- for index, reading in info:
+ for index, reading_de, reading_en in info:
+ if reading_en:
+ reading_str = reading_en
+ elif reading_de:
+ reading_str = reading_de.replace(",", ".")
+
webtherm_type, sensor_id = index.split(".")
# Dependent on webtherm_type we have to determine
# which sensors are available. Feel free to
# declare more sensor types here.
- if "---" not in reading and reading:
+ if "---" not in reading_str and reading_str:
# We have only temperature sensors
if int(webtherm_type) <= 9: # TODO: this is just a guess
parsed[sensor_id] = {
"type" : "temp",
- "reading" : float(reading),
+ "reading" : float(reading_str),
}
# Here we have three different types of sensors:
# 1 = temp, 2 = humid, 3 = air pressure
else:
parsed[sensor_id] = {
"type" : map_sensor_type[sensor_id],
- "reading" : float(reading),
+ "reading" : float(reading_str),
}
return parsed
@@ -94,8 +99,9 @@ check_info["wut_webtherm"] = {
'service_description' : 'Temperature %s',
'has_perfdata' : True,
'snmp_info' : ('.1.3.6.1.4.1.5040.1.2', ['1',
'2', '3', '6', '7', '8', '9',
'16', '18', '36'], [
- '1.2.1.1', # sensorNo
- '1.8.1.1' # valuePkt
+ '1.2.1.1', #
WebGraph-Thermo-Hygro-Barometer-MIB::wtWebGraphThermoBaroSensorNo
+ '1.3.1.1', #
WebGraph-Thermo-Hygro-Barometer-MIB::wtWebGraphThermoBaroTempValue
+ '1.8.1.1', #
WebGraph-Thermo-Hygro-Barometer-MIB::wtWebGraphThermoBaroTempValuePkt
]),
'snmp_scan_function' : detect_webtherm,
'group' : 'temperature',