Module: check_mk
Branch: master
Commit: f0a2f579543a5d216edc679f798c354daf2602db
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f0a2f579543a5d…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Feb 7 13:45:54 2017 +0100
Reverted 4338
Change-Id: I4520165e3c8ffabee65409c91e7c3b2d68919826
---
.werks/4338 | 10 ----------
ChangeLog | 1 -
checkman/aix_hacmp_resources | 4 ++--
checks/aix_hacmp_resources | 17 ++++++++---------
4 files changed, 10 insertions(+), 22 deletions(-)
diff --git a/.werks/4338 b/.werks/4338
deleted file mode 100644
index 810e50d..0000000
--- a/.werks/4338
+++ /dev/null
@@ -1,10 +0,0 @@
-Title: aix_hacmp_resources: fixed state handling
-Level: 1
-Component: checks
-Class: fix
-Compatible: compat
-State: unknown
-Version: 1.4.0i4
-Date: 1486379960
-
-
diff --git a/ChangeLog b/ChangeLog
index 6615622..e0f6eb8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -93,7 +93,6 @@
* 4335 FIX: perle check and inventory plugins: some updates and improvements...
NOTE: Please refer to the migration notes!
* 4123 FIX: active check check_sql: changed handling of query results and fixed hostname parameter...
- * 4338 FIX: aix_hacmp_resources: fixed state handling
* 4325 FIX: check_cpu_peaks: Make the check working with current Check_MK APi
* 4339 FIX: fixed AtrributeError in oracle sessions ruleset
diff --git a/checkman/aix_hacmp_resources b/checkman/aix_hacmp_resources
index bb9baab..8f97aba 100644
--- a/checkman/aix_hacmp_resources
+++ b/checkman/aix_hacmp_resources
@@ -6,8 +6,8 @@ distribution: check_mk
description:
This check monitors the resource group states on different nodes
of AIX HACMP cluster manager.
- The status will be OK, if at least one status is 'online'. The status changes to CRIT if
- one status reports 'error'. Otherwise it will be WARN.
+ The status will be OK, if the first node reports 'online'. Otherwise
+ the status changes to CRIT.
This check needs the check_mk_agent.aix agent.
diff --git a/checks/aix_hacmp_resources b/checks/aix_hacmp_resources
index 34fc1d4..f91495a 100644
--- a/checks/aix_hacmp_resources
+++ b/checks/aix_hacmp_resources
@@ -56,19 +56,18 @@ def inventory_aix_hacmp_resources(parsed):
def check_aix_hacmp_resources(item, params, parsed):
if item in parsed:
resource_stats = []
- infotexts = []
+ infotext = ""
for node_name, resource_status in parsed[item]:
resource_stats.append(resource_status)
- infotexts.append("%s on node %s" % \
- (resource_status, node_name))
- if "online" in resource_stats:
- state = 0
- elif "error" in resource_stats:
+ infotext += "%s on node %s, " % (resource_status, node_name)
+
+ # The first node is always online in an OK scenario
+ # Something is wrong if an other node is online
+ state = 0
+ if resource_stats[0] != "online":
state = 2
- else:
- state = 1
- return state, "Status: %s" % ", ".join(infotexts)
+ return state, infotext[:-2]
check_info['aix_hacmp_resources'] = {