Module: check_mk
Branch: master
Commit: 67568b45a7643b874aa8eee82b60e5821dc876cd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=67568b45a7643b…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Mar 10 09:20:26 2016 +0100
3261 FIX cisco_temperature: fixed wrong datatype handling
---
.werks/3261 | 10 ++++++++++
ChangeLog | 1 +
checks/cisco_temperature | 6 +++---
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/.werks/3261 b/.werks/3261
new file mode 100644
index 0000000..f64ff8f
--- /dev/null
+++ b/.werks/3261
@@ -0,0 +1,10 @@
+Title: cisco_temperature: fixed wrong datatype handling
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1457597947
+
+
diff --git a/ChangeLog b/ChangeLog
index 99ccb73..3011201 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -73,6 +73,7 @@
* 3259 FIX: ad_replication: fixed wrong timestamp handling
* 3094 FIX: cisco_temperature: fixed duplicated sensors on some devices...
* 3006 FIX: agent_vsphere: fixed exception when providing the wrong login
credentials
+ * 3261 FIX: cisco_temperature: fixed wrong datatype handling
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/cisco_temperature b/checks/cisco_temperature
index 68f51ff..b17cbbd 100644
--- a/checks/cisco_temperature
+++ b/checks/cisco_temperature
@@ -176,16 +176,16 @@ def parse_cisco_temperature(info):
def inventory_cisco_temperature(parsed):
for item, value in parsed.iteritems():
- if not value.get("obsolete", False):
+ if type(parsed[item]) == tuple or not value.get("obsolete", False):
yield item, {}
def check_cisco_temperature(item, params, parsed):
if item in parsed:
- if parsed[item].get("obsolete", False):
- return 3, "This sensor is obsolete, please rediscover"
if type(parsed[item]) == tuple:
return parsed[item]
+ elif parsed[item].get("obsolete", False):
+ return 3, "This sensor is obsolete, please rediscover"
else:
return check_temperature(parsed[item]['temp'], params,
"cisco_temperature_%s" % item,
dev_levels = parsed[item]['dev_levels'],