Module: check_mk
Branch: master
Commit: 7e7405d55827a0f85c18b20e6e1f346784ebbe4b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7e7405d55827a0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Nov 6 13:21:10 2015 +0100
Conflicts:
checks/ibm_imm_health
---
.werks/2727 | 10 ++++++++++
ChangeLog | 1 +
checks/ibm_imm_health | 8 ++++----
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/.werks/2727 b/.werks/2727
new file mode 100644
index 0000000..c1c61e3
--- /dev/null
+++ b/.werks/2727
@@ -0,0 +1,10 @@
+Title: ibm_imm_health: Fixed unhandled exception when SNMP info is missing
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1446812404
+
+
diff --git a/ChangeLog b/ChangeLog
index 81c1705..c5d365d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -51,6 +51,7 @@
* 2738 FIX: Check_MK Caching agent on Linux: introduce timeout for lock...
* 2725 FIX: Dynamic levels: Enforce config of levels for filesystems larger than 0
bytes...
* 2726 FIX: veeam_backup_status: Fixed missing agent section error in case of aborted
tasks
+ * 2727 FIX: ibm_imm_health: Fixed unhandled exception when SNMP info is missing
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/ibm_imm_health b/checks/ibm_imm_health
index 35e5c93..df7a9c0 100644
--- a/checks/ibm_imm_health
+++ b/checks/ibm_imm_health
@@ -29,7 +29,7 @@ def inventory_ibm_imm_health(info):
return [(None, None)]
def check_ibm_imm_health(_no_item, _no_params, info):
- if not info:
+ if not info or not info[0]:
return 3, 'Health info not found in SNMP data'
num_alerts = (len(info) - 1) / 3
@@ -44,11 +44,11 @@ def check_ibm_imm_health(_no_item, _no_params, info):
state = info[0][0]
if state == '255':
return (0, "no problem found")
- elif state in ['0']:
+ elif state == '0':
return (2, infotext + " - manual log clearing needed to recover state"
)
- elif state in ['2']:
+ elif state == '2':
return (2, infotext)
- elif state == ['4']:
+ elif state == '4':
return (1, infotext)
else:
return (3, infotext)