Module: check_mk
Branch: master
Commit: 076739b849b802b16705f9fd3657f95ce0ba0954
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=076739b849b802…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Tue Mar 10 13:42:01 2015 +0100
#2101 FIX cisco_temperature: check can now handle cases when no description of the sensor
is available
---
.werks/2101 | 9 +++++++++
ChangeLog | 1 +
checkman/cisco_temperature | 3 ++-
checks/cisco_temperature | 5 ++++-
4 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/2101 b/.werks/2101
new file mode 100644
index 0000000..46a879c
--- /dev/null
+++ b/.werks/2101
@@ -0,0 +1,9 @@
+Title: cisco_temperature: check can now handle cases when no description of the sensor is
available
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1425991259
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 14b1041..eb9a67b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -245,6 +245,7 @@
* 2098 FIX: ibm_svc_mdiskgrp: fix rounding bug, decimal digits of size (GB, TB) were
always lost
* 2094 FIX: Fixed missing agent section when ntpq times out after 5 seconds
* 2095 FIX: oracle_crs_voting: Also handling voting disks with id 0 (seen on old CRS
10.2.0.5.0)...
+ * 2101 FIX: cisco_temperature: check can now handle cases when no description of the
sensor is available
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/checkman/cisco_temperature b/checkman/cisco_temperature
index cd46c61..32a5579 100644
--- a/checkman/cisco_temperature
+++ b/checkman/cisco_temperature
@@ -15,7 +15,8 @@ perfdata:
The current temperature in degrees celsius
item:
- The description of the sensor as provided by the device.
+ The description of the sensor as provided by the device, or the ID of the sensor,
+ if no description is available.
inventory:
One check for each available sensor is created.
diff --git a/checks/cisco_temperature b/checks/cisco_temperature
index 1d5ab38..5f31bfe 100644
--- a/checks/cisco_temperature
+++ b/checks/cisco_temperature
@@ -44,7 +44,10 @@ def parse_cisco_temperature(info):
thresholds.setdefault(sensor_id, []).append(level)
for sensor_id, sensortype, scalecode, magnitude, value, sensorstate in state_info:
- descr = descriptions[sensor_id]
+ if sensor_id in descriptions:
+ descr = descriptions[sensor_id]
+ else:
+ descr = sensor_id
if descr and sensortype == '8':
entity_parsed[descr] = {}
scale = 10**int(magnitude)