Module: check_mk
Branch: master
Commit: bab2b54ddaa1b69b6ac325f497b9afc4c8a070c8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bab2b54ddaa1b6…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Nov 17 10:29:13 2016 +0100
adapted netgear checks
---
checks/netgear_fans | 12 ++++++------
checks/netgear_powersupplies | 3 +--
checks/netgear_temp | 3 +--
3 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/checks/netgear_fans b/checks/netgear_fans
index d266f0f..902822c 100644
--- a/checks/netgear_fans
+++ b/checks/netgear_fans
@@ -60,10 +60,9 @@ factory_settings["netgear_fans_default_levels"] = {
def parse_netgear_fans(info):
parsed = {}
for oid_end, sstate, reading_str in info:
- group, idx = oid_end.split(".")
- parsed.setdefault("%s/%s" % (group, idx), {
- "state" : sstate,
- "reading" : int(reading_str),
+ parsed.setdefault("%s" % oid_end.replace(".", "/"),
{
+ "state" : sstate,
+ "reading_str" : reading_str,
})
return parsed
@@ -71,7 +70,8 @@ def parse_netgear_fans(info):
def inventory_netgear_fans(parsed):
for sensorname, sensorinfo in parsed.items():
state = sensorinfo["state"]
- if state != "1" and not ( state == "2" and
sensorinfo["reading"] == 0 ):
+ if state != "1" and not ( state == "2" and \
+ sensorinfo["reading_str"] in [ "0", "Not
Supported" ] ):
yield sensorname, {}
@@ -83,7 +83,7 @@ def check_netgear_fans(item, params, parsed):
}
if item in parsed:
data = parsed[item]
- yield check_fan(data["reading"], params)
+ yield check_fan(int(data["reading_str"]), params)
yield map_states[data["state"]]
diff --git a/checks/netgear_powersupplies b/checks/netgear_powersupplies
index dd51a87a..d0cad61 100644
--- a/checks/netgear_powersupplies
+++ b/checks/netgear_powersupplies
@@ -34,8 +34,7 @@
def parse_netgear_powersupplies(info):
parsed = {}
for oid_end, sstate in info:
- group, idx = oid_end.split(".")
- parsed.setdefault("%s/%s" % (group, idx), sstate )
+ parsed.setdefault("%s" % oid_end.replace(".", "/"),
sstate )
return parsed
diff --git a/checks/netgear_temp b/checks/netgear_temp
index 891a8fb..17137fe 100644
--- a/checks/netgear_temp
+++ b/checks/netgear_temp
@@ -53,8 +53,7 @@ def parse_netgear_temp(info):
parsed = {}
for oid_end, sensor_ty, sstate, reading_str in info:
- group, idx = oid_end.split(".")
- parsed.setdefault("Sensor %s/%s" % (group, idx), {
+ parsed.setdefault("Sensor %s" % oid_end.replace(".",
"/"), {
"type" : map_types.get(sensor_ty),
"state" : sstate,
"reading" : float(reading_str),