Module: check_mk
Branch: master
Commit: a3fc9df54921f1501cc0444219bd5d2dfaa7c76d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a3fc9df54921f1…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Fri Mar 21 12:51:59 2014 +0100
make check handle situation when networkDeviceConnectionStatus is not available
---
checks/dell_poweredge_netdev | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/checks/dell_poweredge_netdev b/checks/dell_poweredge_netdev
index 687a901..81e9b96 100644
--- a/checks/dell_poweredge_netdev
+++ b/checks/dell_poweredge_netdev
@@ -65,22 +65,22 @@ def check_dell_poweredge_netdev(item, _no_params, info):
"6" : ( "NonRecoverable,", 2 ),
}
connection_table = {
- "1" : ( "connected", 0 ),
- "2" : ( "disconnected", 2 ),
- "3" : ( "driverBad", 2 ),
- "4" : ( "driverDisabled", 2 ),
- "10" : ( "hardwareInitializing", 2 ),
- "11" : ( "hardwareResetting", 2 ),
- "12" : ( "hardwareClosing", 2 ),
- "13" : ( "hardwareNotReady", 2 ),
+ "1" : ( "connected, ", 0 ),
+ "2" : ( "disconnected, ", 2 ),
+ "3" : ( "driverBad, ", 2 ),
+ "4" : ( "driverDisabled, ", 2 ),
+ "10" : ( "hardwareInitializing, ", 2 ),
+ "11" : ( "hardwareResetting, ", 2 ),
+ "12" : ( "hardwareClosing, ", 2 ),
+ "13" : ( "hardwareNotReady, ", 2 ),
}
dev_state_txt, dev_state = state_table.get(status, ( "unknown device
status,", 2 ))
- conn_state_txt, conn_state = connection_table.get(connection_status, (
"unknown connection status", 1 ))
+ conn_state_txt, conn_state = connection_table.get(connection_status, (
"", 0 ))
state = max(dev_state, conn_state)
infotext = "%s %s" % (dev_state_txt, conn_state_txt)
for parameter, value in di.items():
- infotext += ", %s: %s" % ( parameter, value )
- infotext = re.sub("^, ","", infotext)
+ infotext += "%s: %s, " % ( parameter, value )
+ infotext = re.sub(", $","", infotext)
return state, infotext