Module: check_mk
Branch: master
Commit: d355b31b40cdcef25bf34690b09d293edac56b61
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d355b31b40cdce…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Aug 26 17:07:11 2015 +0200
#1287 FIX akcp_temperature: Fixed interpretation of device levels
This fix handle devices who seamed to have to low levels like 3.5 or 2.5
---
.werks/1287 | 11 +++++++++++
ChangeLog | 1 +
checks/akcp_sensor.include | 11 ++++++++---
3 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/.werks/1287 b/.werks/1287
new file mode 100644
index 0000000..b019a9f
--- /dev/null
+++ b/.werks/1287
@@ -0,0 +1,11 @@
+Title: akcp_temperature: Fixed interpretation of device levels
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1440601502
+
+This fix handle devices who seamed to have to low levels like 3.5 or 2.5
+
diff --git a/ChangeLog b/ChangeLog
index 17c9711..9d1832c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -139,6 +139,7 @@
* 1282 FIX: win_printers: Not longer discover offline printers
* 1284 FIX: symantec_av_progstate: Now Supports the current version of Symantec AV
* 1285 FIX: blade_bx_powerfan: Fixed exception in case of fan failure
+ * 1287 FIX: akcp_temperature: Fixed interpretation of device levels...
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce
unhandled exceptions...
diff --git a/checks/akcp_sensor.include b/checks/akcp_sensor.include
index 344075b..a3b0690 100644
--- a/checks/akcp_sensor.include
+++ b/checks/akcp_sensor.include
@@ -153,9 +153,14 @@ def check_akcp_sensor_temp(item, params, info):
map(float, (low_crit, low_warn, high_warn, high_crit))
else:
unit_normalised = unit.lower()
- # Devices with "F" or "C" have the levels in degrees
* 10
- low_crit, low_warn, high_warn, high_crit = \
- map(lambda t: (float(t) / 10), (low_crit, low_warn, high_warn,
high_crit))
+ if int(high_crit) > 100:
+ # Devices with "F" or "C" have the levels in
degrees * 10
+ low_crit, low_warn, high_warn, high_crit = \
+ map(lambda t: (float(t) / 10), (low_crit, low_warn, high_warn,
high_crit))
+ else:
+ low_crit, low_warn, high_warn, high_crit = \
+ map(float, (low_crit, low_warn, high_warn, high_crit))
+
if degreeraw and degreeraw != "0":
temperature = float(degreeraw) / 10.0