Module: check_mk
Branch: master
Commit: d812c685831f0f89c250d5a00b2c6e10566f9784
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d812c685831f0f…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Fri Jun 12 13:55:43 2015 +0200
Some Cisco devices report the device internal temperature levels in the wrong
order. The check now handles this behaviour.
Conflicts:
.werks/2221
---
.werks/2221 | 10 ++++++++++
ChangeLog | 3 +++
checks/cisco_temperature | 9 ++++++++-
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/.werks/2221 b/.werks/2221
new file mode 100644
index 0000000..b25e723
--- /dev/null
+++ b/.werks/2221
@@ -0,0 +1,10 @@
+Title: cisco_temperature: Fixed order of device levels for some devices
+Level: 1
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i2
+Date: 1434108600
+
+Some Cisco devices report the device internal temperature levels in the wrong
+order. The check now handles this behaviour.
diff --git a/ChangeLog b/ChangeLog
index a22d01f..687d448 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -48,6 +48,9 @@
* 2334 Logging details about loaded SNMP MIB modules during startup
* 2326 Allow relating Event Console hosts to monitoring hosts now also by alias...
+ general:
+ * 2221 FIX: cisco_temperature: Fixed order of device levels for some devices...
+
1.2.7i1:
Core & Setup:
diff --git a/checks/cisco_temperature b/checks/cisco_temperature
index 144e196..699c1fb 100644
--- a/checks/cisco_temperature
+++ b/checks/cisco_temperature
@@ -24,6 +24,11 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+
+# NOTE: Devices of type 3850 with firmware versions 3.2.0SE, 3.2.1, 3.2.2
+# have been observed to display a tenth of the actual temperature value.
+# A firmware update on the device fixes this.
+
def parse_cisco_temperature(info):
description_info, state_info, levels_info, perfstuff = info
@@ -63,7 +68,9 @@ def parse_cisco_temperature(info):
if len(thresholds[sensor_id]) in [ 2, 4 ]:
warnraw, critraw = thresholds[sensor_id][0:2]
- dev_levels = (float(warnraw)/scale, float(critraw)/scale)
+ # Some devices deliver these values in the wrong order
+ dev_levels = ( min(float(warnraw)/scale, float(critraw)/scale),
+ max(float(warnraw)/scale, float(critraw)/scale) )
else:
dev_levels = None
entity_parsed[descr]['dev_levels'] = dev_levels