Module: check_mk
Branch: master
Commit: 4fed2d570ee5a1689665fc9617cde36d4e32e279
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4fed2d570ee5a1…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Jun 28 09:12:06 2016 +0200
3686 FIX hp_proliant_temp: fixed wrong device thresholds handling. If no thresholds
available the device reports -99
---
.werks/3686 | 10 ++++++++++
ChangeLog | 1 +
checks/hp_proliant_temp | 11 +++++++++--
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/.werks/3686 b/.werks/3686
new file mode 100644
index 0000000..7380c1c
--- /dev/null
+++ b/.werks/3686
@@ -0,0 +1,10 @@
+Title: hp_proliant_temp: fixed wrong device thresholds handling. If no thresholds
available the device reports -99
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1467097884
+
+
diff --git a/ChangeLog b/ChangeLog
index a965c56..a757976 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -285,6 +285,7 @@
* 3654 FIX: apc_symmetra: Improved output in case of unknown battery state /
calibration result
* 3655 FIX: if64adm: Can now be used with OID range limits
* 3685 FIX: brocade_fcport: fixed unknown state texts
+ * 3686 FIX: hp_proliant_temp: fixed wrong device thresholds handling. If no
thresholds available the device reports -99
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/hp_proliant_temp b/checks/hp_proliant_temp
index 9f99e51..8a70f84 100644
--- a/checks/hp_proliant_temp
+++ b/checks/hp_proliant_temp
@@ -38,11 +38,18 @@ def check_hp_proliant_temp(item, params, info):
if format_hp_proliant_name(line) == item:
chassis, index, name, value, threshold, status = line
- threshold = float(threshold)
+ # This case means no threshold available and
+ # the devices' web interface displays "N/A"
+ if threshold == "-99":
+ devlevels = (None, None)
+ else:
+ threshold = float(threshold)
+ devlevels = (threshold, threshold)
+
snmp_status = hp_proliant_status_map[int(status)]
return check_temperature(float(value), params,
"hp_proliant_temp_%s" % item,
- dev_levels=(threshold, threshold),
+ dev_levels=devlevels,
dev_status=hp_proliant_status2nagios_map[snmp_status],
dev_status_name="Unit: %s" % snmp_status)
return 3, "item not found in snmp data"