Module: check_mk
Branch: master
Commit: 73ef53566be335fe6df5d1de789596f84920e3d9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=73ef53566be335…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Aug 1 15:14:23 2016 +0200
3731 FIX sap.value-groups: Replaced this check with sap.value_groups
The old check name was not allowed because it contained a dash. The
check has now been renamed. You will get a warning message when the
old check is executed and only need to rediscover the services of
the affected hosts. You don't need to migrate anything here.
---
.werks/3731 | 12 ++++++++++++
ChangeLog | 1 +
checks/sap | 40 +++++++++++++++++++++++++++++-----------
3 files changed, 42 insertions(+), 11 deletions(-)
diff --git a/.werks/3731 b/.werks/3731
new file mode 100644
index 0000000..bc0f2c1
--- /dev/null
+++ b/.werks/3731
@@ -0,0 +1,12 @@
+Title: sap.value-groups: Replaced this check with sap.value_groups
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i1
+Date: 1470057200
+Class: fix
+
+The old check name was not allowed because it contained a dash. The
+check has now been renamed. You will get a warning message when the
+old check is executed and only need to rediscover the services of
+the affected hosts. You don't need to migrate anything here.
diff --git a/ChangeLog b/ChangeLog
index e7b428f..ee7cfd3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -319,6 +319,7 @@
* 3709 FIX: cisco_wlc, cisco_wlc_clients: fixed scan function and incomplete listing
of interfaces
* 3672 FIX: Agent sections cached by the agent could cause stale services...
* 3727 FIX: fc_port: Fixed broken interpretation of counter values leading to wrong
measurements
+ * 3731 FIX: sap.value-groups: Replaced this check with sap.value_groups...
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/sap b/checks/sap
index 3f85f66..8f879aa 100644
--- a/checks/sap
+++ b/checks/sap
@@ -226,11 +226,9 @@ def inventory_sap_value_groups( info ):
found_groups.append(group)
return inventory
-def check_sap_value_groups( item, params, info ):
- frontend = []
- backend = []
- count_ok = 0
- count_crit = 0
+def check_sap_value_groups(item, params, info, deprecated=False):
+ crit_texts, all_texts = [], []
+ count_ok, count_crit = 0, 0
state = None
for line in info:
path = line[3]
@@ -239,23 +237,43 @@ def check_sap_value_groups( item, params, info ):
output = ''
if line[4] == '-':
output = ' '.join(line[6:])
- backend.append( path + output + " " + core_state_names[status] )
+
+ all_texts.append(path + output + " " + core_state_names[status])
state = max(state, status)
if status > 0:
count_crit += 1
- frontend.append( path + output + " " + core_state_names[status]
)
+ crit_texts.append( path + output + " " +
core_state_names[status] )
else:
count_ok += 1
if state is None:
raise MKCounterWrapped("no output about sap value groups in agent
output")
- return state, "%s OK, %s Crit %s\n%s" % ( count_ok, count_crit, ",
".join(frontend), "\n".join(backend) )
+ yield state, "%s OK, %s Critical" % (count_ok, count_crit)
+
+ if crit_texts:
+ yield 0, ", ".join(crit_texts)
+
+ if deprecated:
+ yield 1, "This service uses a deprecated check. Please rediscover the
services "\
+ "of this host to get this fixed automatically"
+
+ if all_texts:
+ yield 0, "\n%s" + "\n".join(all_texts)
+# Deprecated with 1.4.0i1. Remove some versions after!
check_info['sap.value-groups'] = {
- 'check_function': check_sap_value_groups,
- 'inventory_function': inventory_sap_value_groups,
- 'service_description': "%s",
+ 'check_function' : lambda *args: check_sap_value_groups(*args,
deprecated=True),
+ 'inventory_function' : lambda *args: [],
+ 'service_description' : "%s",
}
precompile_params['sap.value-groups'] = sap_value_groups_precompile
+
+
+check_info['sap.value_groups'] = {
+ 'check_function' : check_sap_value_groups,
+ 'inventory_function' : inventory_sap_value_groups,
+ 'service_description' : "%s",
+}
+precompile_params['sap.value_groups'] = sap_value_groups_precompile