Module: check_mk
Branch: master
Commit: b03aa5b9c7ee60e5a0b4e5c62d184a102d9c8e93
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b03aa5b9c7ee60…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Wed Apr 6 15:35:30 2016 +0200
ewon: ensured only valid inventory/check-functions are called
---
checks/ewon | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/checks/ewon b/checks/ewon
index 9d4aab9..e63396d 100644
--- a/checks/ewon
+++ b/checks/ewon
@@ -213,7 +213,7 @@ def inventory_ewon(parsed):
yield "eWON Status", {"device": deviceName}
- if deviceName:
+ if deviceName in set(["oxyreduct"]):
for res in globals()["inventory_%s" % deviceName](parsed):
item, params = res
params["device"] = deviceName
@@ -226,9 +226,11 @@ def check_ewon(item, params, parsed):
return 1, "This device requires configuration. Plese pick the device
type."
else:
return 0, "Configured for %s" % params["device"]
- if params["device"]:
- return globals()["check_%s" % params["device"]](item,
params.get(params["device"], {}),
- parsed)
+
+ deviceName = params["device"]
+ if deviceName in set(["oxyreduct"]):
+ return globals()["check_%s" % deviceName](item, params.get(deviceName,
{}),
+ parsed)
check_info["ewon"] = {