Module: check_mk
Branch: master
Commit: 28477a5ef228b5a529901d331afa072e0112e9ae
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=28477a5ef228b5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jun 27 13:16:54 2013 +0200
Better formating of snmp_info output when some infos are missing
---
checks/snmp_info | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/checks/snmp_info b/checks/snmp_info
index d653856..8272904 100644
--- a/checks/snmp_info
+++ b/checks/snmp_info
@@ -30,7 +30,7 @@ def inventory_snmp_info(info):
def check_snmp_info(checktype, params, info):
if len(info[0]) >= 4:
- return (0, "%s, %s, %s, %s" % (info[0][0], info[0][2], info[0][3],
info[0][1]))
+ return (0, ', '.join([ info[0][i] for i in [0, 2, 3, 1] if info[0][i]
]))
else:
return (3, "No data retrieved")