Module: check_mk
Branch: master
Commit: d290b788f23250174091c348c6d5d9926c3a6d77
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d290b788f23250…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Jul 24 11:17:29 2014 +0200
raritan_pdu_plugs: Code cleanup
---
checks/raritan_pdu_plugs | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/checks/raritan_pdu_plugs b/checks/raritan_pdu_plugs
index 8b7145b..cff7c3a 100644
--- a/checks/raritan_pdu_plugs
+++ b/checks/raritan_pdu_plugs
@@ -24,13 +24,13 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-raritan_pdu_plugs_default = '"on"'
+raritan_pdu_plugs_default = '"on"' # only to be downwards compatible
and can be removed later.
def inventory_raritan_pdu_plugs(info):
inventory = []
for line in info:
if saveint(line[0]) != 0:
- inventory.append((line[0], raritan_pdu_plugs_default) )
+ inventory.append((line[0], int(line[2])) )
return inventory
def check_raritan_pdu_plugs(item, params, info):
@@ -58,10 +58,11 @@ def check_raritan_pdu_plugs(item, params, info):
outletLabel = line[0] # Outlet-Label (Index) (PDU identifier of the outlet)
outletName = line[1] # OutletName (vergebene Bezeichnung für den Ausgang)
outletState = int(line[2]) # The Outlet state at present (sh.
outlet_state_info)
-
- if states[outletState] == required_state:
- state = 0
- else:
+ state = 0
+ if type(required_state) == int:
+ if outletState != required_state:
+ state = 2
+ elif states[outletState] != required_state:
state = 2
message = outletName + ": " + states[outletState]