Module: check_mk
Branch: master
Commit: b1618a7641cb3fb9cb8e7ee04c97b9218c3f76f5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b1618a7641cb3f…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Nov 17 13:13:18 2016 +0100
fixed netgear_fans check
---
checks/netgear_fans | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/checks/netgear_fans b/checks/netgear_fans
index 170204e..52ba6ab 100644
--- a/checks/netgear_fans
+++ b/checks/netgear_fans
@@ -99,9 +99,10 @@ def netgear_map_state_txt_to_int(state_nr, version):
def parse_netgear_fans(info):
versioninfo, sensorinfo = info
- parsed = { "__version__" : versioninfo[0][0] }
+ parsed = { "__version__" : versioninfo[0][0],
+ "__fans__" : {}, }
for oid_end, sstate, reading_str in sensorinfo:
- parsed.setdefault("%s" % oid_end.replace(".", "/"),
{
+ parsed["__fans__"].setdefault("%s" %
oid_end.replace(".", "/"), {
"state" : sstate,
"reading_str" : reading_str,
})
@@ -109,7 +110,7 @@ def parse_netgear_fans(info):
def inventory_netgear_fans(parsed):
- for sensorname, sensorinfo in parsed.items():
+ for sensorname, sensorinfo in parsed["__fans__"].items():
state = sensorinfo["state"]
if state != "1" and not ( state == "2" and \
sensorinfo["reading_str"] in [ "0" ] ):
@@ -117,8 +118,8 @@ def inventory_netgear_fans(parsed):
def check_netgear_fans(item, params, parsed):
- if item in parsed:
- data = parsed[item]
+ if item in parsed["__fans__"]:
+ data = parsed["__fans__"][item]
reading_str = data["reading_str"]
if reading_str != "Not Supported":
yield check_fan(int(data["reading_str"]), params)