Module: check_mk
Branch: master
Commit: 7b7a5bfa499fa7beef068a957a201ae096a2835c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7b7a5bfa499fa7…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Apr 29 12:00:21 2016 +0200
3430 FIX apc_inrow_temp: fixed wrong data handling if data is not available or incomplete
---
.werks/3430 | 10 ++++++++++
ChangeLog | 1 +
checks/apc_inrow_temp | 13 +++++++------
3 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/.werks/3430 b/.werks/3430
new file mode 100644
index 0000000..d403339
--- /dev/null
+++ b/.werks/3430
@@ -0,0 +1,10 @@
+Title: apc_inrow_temp: fixed wrong data handling if data is not available or incomplete
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1461923920
+
+
diff --git a/ChangeLog b/ChangeLog
index 7e42481..087f07a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -199,6 +199,7 @@
* 3444 FIX: mssql: Reworked agent plugin to use less WMI calls
* 3525 FIX: Nagios Core: fixed bug, incomplete cleanup of process tree on service
check timeout...
* 3241 FIX: Fixed broken apt plugin
+ * 3430 FIX: apc_inrow_temp: fixed wrong data handling if data is not available or
incomplete
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/apc_inrow_temp b/checks/apc_inrow_temp
index 4ed7bb7..45bd65e 100644
--- a/checks/apc_inrow_temp
+++ b/checks/apc_inrow_temp
@@ -39,12 +39,13 @@ factory_settings["apc_inrow_temp_default_levels"] = {
def parse_apc_inrow_temp(info):
parsed = {}
- for what, what_item in zip(info[0],
- ["Rack Inlet", "Supply Air", "Return Air",
- "Entering Fluid", "Leaving Fluid"
- ]):
- if what != "" or what != "-1":
- parsed[what_item] = float(what) / 10
+ if info:
+ for what, what_item in zip(info[0],
+ ["Rack Inlet", "Supply Air", "Return Air",
+ "Entering Fluid", "Leaving Fluid"
+ ]):
+ if what not in [ "", "-1" ]:
+ parsed.setdefault(what_item, float(what) / 10)
return parsed