Module: check_mk
Branch: master
Commit: 873e77487ff4c80ca6aa6e0d1c5e720487eb489b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=873e77487ff4c8…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Oct 18 14:26:13 2013 +0200
hp_blade_blades fixed crash on inventory
---
ChangeLog | 2 ++
checks/hp_blade_blades | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index fc5b15a..61621b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -51,6 +51,8 @@
* FIX: local: tolerate invalid output lines
* FIX: hp_proliant: Correct handling of missing snmp data
* FIX: logwatch.ec: No longer forwards "I" lines to event console
+ * FIX: hp_blade_blades: Fixed crash on inventory when receiving
+ unexpected snmp data
WATO:
* You can now have site-specific global settings when using
diff --git a/checks/hp_blade_blades b/checks/hp_blade_blades
index a1422fc..ddb5e1a 100644
--- a/checks/hp_blade_blades
+++ b/checks/hp_blade_blades
@@ -50,7 +50,7 @@ hp_blade_status_map = { 1: 'Other', 2: 'Ok',
3: 'Degraded', 4: 'Fa
hp_blade_status2nagios_map = { 'Other': 2, 'Ok': 0,
'Degraded': 1, 'Failed': 2, }
def inventory_hp_blade_blades(info):
- return [ (line[0], None) for line in info if hp_blade_present_map[int(line[1])] ==
'present' ]
+ return [ (line[0], None) for line in info if hp_blade_present_map.get(int(line[1]),
"") == 'present' ]
def check_hp_blade_blades(item, params, info):
for line in info: