Module: check_mk
Branch: master
Commit: c7bd33e4b8bec6f44cf96f25ac2c1d54e66a163a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c7bd33e4b8bec6…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Apr 2 11:10:31 2019 +0200
7359 FIX aix_hacmp_resources: Skip header line; This led to a 'IndexError' crash
Change-Id: I7f1553ca4e4ec0db78adc419b619e70b495da998
---
.werks/7359 | 10 ++++++++++
checks/aix_hacmp_resources | 9 +++------
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/.werks/7359 b/.werks/7359
new file mode 100644
index 0000000..bf9e3b6
--- /dev/null
+++ b/.werks/7359
@@ -0,0 +1,10 @@
+Title: aix_hacmp_resources: Skip header line; This led to a 'IndexError' crash
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1554196167
+Class: fix
+
+
diff --git a/checks/aix_hacmp_resources b/checks/aix_hacmp_resources
index cfdd38d..f588159 100644
--- a/checks/aix_hacmp_resources
+++ b/checks/aix_hacmp_resources
@@ -42,13 +42,10 @@ factory_settings["aix_hacmp_resources"] = {
def parse_aix_hacmp_resources(info):
parsed = {}
for line in info:
- if 'There is no cluster definition.' in " ".join(line):
+ joined_line = " ".join(line)
+ if 'There is no cluster definition' in joined_line or 'Status of the
RSCT subsystems' in joined_line:
continue
- if line[0] not in parsed:
- parsed[line[0]] = [(line[2], line[1].lower())]
- else:
- parsed[line[0]].append((line[2], line[1].lower()))
-
+ parsed.setdefault(line[0], []).append((line[2], line[1].lower()))
return parsed