Module: check_mk
Branch: master
Commit: c7147547e8e5729b2c0732aca43656536398dc1f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c7147547e8e572…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu May 24 17:13:41 2018 +0200
6155 FIX Service discovery page: Active checks were not correctly shown in specific cases
It could happen that some active checks were not correctly shown in the tables
"active checks" or "disabled active checks". This was caused by
specific
disabled services rules. For example when using this two rules:
1. Enable all services starting with "HTTP"
2. Disable all services
In this situation the HTTP service was not displayed on the discovery page.
Change-Id: I91f03922529d93a1ba9c702ecfb2bf31a6f9f6ea
---
.werks/6155 | 18 ++++++++++++++++++
cmk_base/discovery.py | 7 +++++++
2 files changed, 25 insertions(+)
diff --git a/.werks/6155 b/.werks/6155
new file mode 100644
index 0000000..451a14f
--- /dev/null
+++ b/.werks/6155
@@ -0,0 +1,18 @@
+Title: Service discovery page: Active checks were not correctly shown in specific cases
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1527174418
+
+It could happen that some active checks were not correctly shown in the tables
+"active checks" or "disabled active checks". This was caused by
specific
+disabled services rules. For example when using this two rules:
+
+1. Enable all services starting with "HTTP"
+2. Disable all services
+
+In this situation the HTTP service was not displayed on the discovery page.
diff --git a/cmk_base/discovery.py b/cmk_base/discovery.py
index ebc0e5a..aa62ca1 100644
--- a/cmk_base/discovery.py
+++ b/cmk_base/discovery.py
@@ -1021,6 +1021,13 @@ def _merge_manual_services(services, hostname, on_error):
# Handle disabled services -> "ignored"
for (check_plugin_name, item), (check_source, paramstring) in services.items():
+ if check_source in [ "legacy", "active", "custom"
]:
+ # These are ignored later in get_check_preview
+ # TODO: This needs to be cleaned up. The problem here is that
service_description() can not
+ # calculate the description of active checks and the active checks need to be
put into
+ # "[source]_ignored" instead of ignored.
+ continue
+
try:
descr = config.service_description(hostname, check_plugin_name, item)
except Exception, e: