Module: check_mk
Branch: master
Commit: 27ff879dad863abd7ee736105c72e04c9c1904d2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=27ff879dad863a…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Mon May 12 14:12:40 2014 +0200
FIX brocade_mlx_temp: special treatment for devices sometimes not delivering temperature
by SNMP
---
.werks/953 | 8 ++++++++
ChangeLog | 1 +
checks/brocade_mlx_temp | 11 ++++++++---
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/.werks/953 b/.werks/953
new file mode 100644
index 0000000..f78dcaf
--- /dev/null
+++ b/.werks/953
@@ -0,0 +1,8 @@
+Title: brocade_mlx_temp: special treatment for devices sometimes not delivering
temperature by SNMP
+Level: 1
+Component: checks
+Version: 1.2.5i3
+Date: 1399896720
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index c1fb9a9..ef24dc3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -69,6 +69,7 @@
* 0161 FIX: cisco_fru_power: Exluded not existing devices from the inventory
* 0969 FIX: blade_health: correctly output error message in non-OK state
* 0611 FIX: nfsexports.solaris: fix in determination of path prefix
+ * 0953 FIX: brocade_mlx_temp: special treatment for devices sometimes not delivering
temperature by SNMP
Multisite:
* 0779 Hostgroups (Summary): Empty hostgroups are no longer shown (can be re-enabled
by filter)
diff --git a/checks/brocade_mlx_temp b/checks/brocade_mlx_temp
index 406f6c4..f346f6c 100644
--- a/checks/brocade_mlx_temp
+++ b/checks/brocade_mlx_temp
@@ -54,14 +54,19 @@ def check_brocade_mlx_temp(item, params, info):
for temp_descr, temp_id, temp_value in info:
current_item = compose_item(temp_id, temp_descr)
if current_item == item:
- # Info from the MIB: "Each unit is 0.5 degrees Celcius."
- temp_value = int(temp_value) / 2
-
# OID_END needs to be used for sensor id because especially
# Active management modules may have more temperature sensors
# with the same description
temp_id = re.sub("[0-9]+\.", "", temp_id)
+ # some devices do not deliver values on one single check in
+ # between - setting to unknown in this case
+ if temp_value == "":
+ return 3, "No temperature value delivered by SNMP for sensor " +
temp_id
+
+ # Info from the MIB: "Each unit is 0.5 degrees Celcius."
+ temp_value = int(temp_value) / 2
+
txt = "Sensor %s: %s°C" % (temp_id, temp_value)
if temp_value > crit:
status = max(status, 2)