Module: check_mk
Branch: master
Commit: 2a392e2f63e6f5a05f42c59864951f6815fe73f9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2a392e2f63e6f5…
Author: Marcel Schulte <ms(a)mathias-kettner.de>
Date: Mon Nov 14 15:45:22 2016 +0100
3940 FIX aix_hacmp_services: fixed broken check in case of agent section showing extra
information before the "Status(...)" line
In case of the agent section showing extra information before the "Status(...)"
line like the following, the check crashed. This has been fixed now.
Example agent section showing extra information in the first line:
###
<<<aix_hacmp_services>>>
clshowsrv is a tracked alias for /usr/es/sbin/cluster/utilities/clshowsrv
Status of the RSCT subsystems used by PowerHA SystemMirror:
(...)
###
---
.werks/3940 | 20 ++++++++++++++++++++
ChangeLog | 1 +
checks/aix_hacmp_services | 18 +++++++++---------
3 files changed, 30 insertions(+), 9 deletions(-)
diff --git a/.werks/3940 b/.werks/3940
new file mode 100644
index 0000000..609905b
--- /dev/null
+++ b/.werks/3940
@@ -0,0 +1,20 @@
+Title: aix_hacmp_services: fixed broken check in case of agent section showing extra
information before the "Status(...)" line
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i3
+Date: 1479134445
+
+In case of the agent section showing extra information before the "Status(...)"
line like the following, the check crashed. This has been fixed now.
+
+Example agent section showing extra information in the first line:
+
+###
+<<<aix_hacmp_services>>>
+clshowsrv is a tracked alias for /usr/es/sbin/cluster/utilities/clshowsrv
+Status of the RSCT subsystems used by PowerHA SystemMirror:
+(...)
+###
+
diff --git a/ChangeLog b/ChangeLog
index 9cad745..2e585ef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@
* 3750 FIX: cmc_temp: Check now also works when using Nagios core
* 3983 FIX: mssql_instance: Be more robust agains missing instance info in case of
connection issues
* 3963 FIX: check_mk_agent.linux: fixed strayed output of postfix status command
+ * 3940 FIX: aix_hacmp_services: fixed broken check in case of agent section showing
extra information before the "Status(...)" line...
Multisite:
* 3974 FIX: Sorting comments in hover menu of comments icon by time now
diff --git a/checks/aix_hacmp_services b/checks/aix_hacmp_services
index 0d19810..8379ca3 100644
--- a/checks/aix_hacmp_services
+++ b/checks/aix_hacmp_services
@@ -89,21 +89,21 @@
def parse_aix_hacmp_services(info):
parsed = {}
- subsystem_ty_name = True
+ check_block = False # are we in the check relevant info block?
for line in info:
if line[0] == 'Details':
- subsystem_ty_name = False
+ check_block = False
- if subsystem_ty_name:
- if line[0] == 'Status':
- subsystem_ty_name = line[3]
- if subsystem_ty_name == 'PowerHA':
- subsystem_ty_name += " %s" % line[4]
+ elif line[0] == 'Status':
+ check_block = True
+ subsystem_ty_name = line[3]
+ if subsystem_ty_name == 'PowerHA':
+ subsystem_ty_name += " %s" % line[4]
- elif line[0] == 'Subsystem':
+ elif check_block:
+ if line[0] == 'Subsystem':
parsed.setdefault(subsystem_ty_name, [])
-
else:
parsed[subsystem_ty_name].append(
(line[0], line[3])