Module: check_mk
Branch: master
Commit: 1004b50236c3a64142b2764b9a81ecbce0f57a51
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1004b50236c3a6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jul 16 14:27:51 2018 +0200
6343 FIX Analyze parameters: Shows parameters of clustered services now
When the diagnose page to analyze the parameters of a service was opened for
a service that is assigned to a cluster host, it was not showing the
"Check origin and parameters" section. The effective parameters were not
shown.
Change-Id: Ia6fcc4a8956aac4f766394d39b3eb9b1fc5dc6ec
---
.werks/6343 | 14 ++++++++++++++
cmk_base/automations/check_mk.py | 13 ++++++++++++-
2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/.werks/6343 b/.werks/6343
new file mode 100644
index 0000000..da279a0
--- /dev/null
+++ b/.werks/6343
@@ -0,0 +1,14 @@
+Title: Analyze parameters: Shows parameters of clustered services now
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1531469273
+
+When the diagnose page to analyze the parameters of a service was opened for
+a service that is assigned to a cluster host, it was not showing the
+"Check origin and parameters" section. The effective parameters were not
+shown.
diff --git a/cmk_base/automations/check_mk.py b/cmk_base/automations/check_mk.py
index 96b061f..daa8b73 100644
--- a/cmk_base/automations/check_mk.py
+++ b/cmk_base/automations/check_mk.py
@@ -570,10 +570,21 @@ class AutomationAnalyseServices(Automation):
"parameters" : params,
}
+ # TODO: There is a lot of duplicated logic with discovery.py/check_table.py.
Clean this
+ # whole function up.
+ if config.is_cluster(hostname):
+ autochecks = []
+ for node in config.nodes_of(hostname):
+ for check_plugin_name, item, paramstring in
cmk_base.autochecks.read_autochecks_of(node):
+ descr = config.service_description(node, check_plugin_name, item)
+ if hostname == config.host_of_clustered_service(node, descr):
+ autochecks.append((check_plugin_name, item, paramstring))
+ else:
+ autochecks = cmk_base.autochecks.read_autochecks_of(hostname)
# 2. Load all autochecks of the host in question and try to find
# our service there
- for entry in cmk_base.autochecks.read_autochecks_of(hostname):
+ for entry in autochecks:
ct, item, params = entry # new format without host name
if (ct, item) not in table: