Module: check_mk
Branch: master
Commit: 9db226d9c942531489a65792e4ee2c2fc93fd8fa
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9db226d9c94253…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Wed May 24 15:26:34 2017 +0200
4632 FIX fsc_subsystems: No longer crash when statuscode is missing
Change-Id: Iba797dcb17b191095f4290e8c208d09400d1bc2a
---
.werks/4632 | 11 +++++++++++
checks/fsc_subsystems | 2 ++
2 files changed, 13 insertions(+)
diff --git a/.werks/4632 b/.werks/4632
new file mode 100644
index 0000000..0d6eb5c
--- /dev/null
+++ b/.werks/4632
@@ -0,0 +1,11 @@
+Title: fsc_subsystems: No longer crash when statuscode is missing
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1495632274
+
+
diff --git a/checks/fsc_subsystems b/checks/fsc_subsystems
index f5ed71a..a3e3e37 100644
--- a/checks/fsc_subsystems
+++ b/checks/fsc_subsystems
@@ -33,6 +33,8 @@ def check_fsc_subsystems(item, params, info):
for line in info: # , value1, value2 in info:
name = line[0]
if name != item: continue
+ if line[1] == u"":
+ return 3, "Status not found in SNMP data"
status = int(line[1])
statusname = { 1:'ok', 2:'degraded', 3:'error',
4:'failed', 5:'unknown-init'}.get(status, 'invalid')
if status == 1 or status == 5: