Module: check_mk
Branch: master
Commit: 3461771d98aa877ffb7b9872db17c666ea1d0076
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3461771d98aa87…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 14 09:10:54 2019 +0100
Revert "added WK6708: WATO service discovery: Fixed incorrect creation of disable
rule for duplicate service description"
This reverts commit df2d50713ab27c335ffa69d22b45388349fd3c48.
---
.werks/6708 | 14 --------------
cmk/gui/wato/pages/services.py | 9 +--------
2 files changed, 1 insertion(+), 22 deletions(-)
diff --git a/.werks/6708 b/.werks/6708
deleted file mode 100644
index 20a148a..0000000
--- a/.werks/6708
+++ /dev/null
@@ -1,14 +0,0 @@
-Title: WATO service discovery: Fixed incorrect creation of disable rule for duplicate
service description
-Level: 1
-Component: wato
-Class: fix
-Compatible: compat
-Edition: cre
-State: unknown
-Version: 1.6.0i1
-Date: 1551265114
-
-Different check_types may have the same service description, for example <tt>CPU
utilization</tt>.
-If you created a <tt>Disabled check</tt> rule for some SNMP based CPU
utilization check and
-used the service discovery page, a <tt>Disabled service</tt> rule was
automatically created for this SNMP
-based check. As a side effect, the TCP based CPU utilization check was disabled as
well..
diff --git a/cmk/gui/wato/pages/services.py b/cmk/gui/wato/pages/services.py
index f00d3a5..ea48703 100644
--- a/cmk/gui/wato/pages/services.py
+++ b/cmk/gui/wato/pages/services.py
@@ -666,8 +666,7 @@ class ModeAjaxServiceDiscovery(WatoWebApiMode):
return discovery_result
def _do_discovery(self, discovery_result, request):
- services_to_save, remove_disabled_rule, add_disabled_rule, saved_services = {},
set(), set(
- ), set()
+ services_to_save, remove_disabled_rule, add_disabled_rule = {}, [], []
apply_changes = False
for table_source, check_type, _checkgroup, item, paramstring, _params, \
descr, _state, _output, _perfdata in discovery_result.check_table:
@@ -693,14 +692,12 @@ class ModeAjaxServiceDiscovery(WatoWebApiMode):
if table_source == DiscoveryState.UNDECIDED:
if table_target == DiscoveryState.MONITORED:
services_to_save[(check_type, item)] = paramstring
- saved_services.add(descr)
elif table_target == DiscoveryState.IGNORED:
add_disabled_rule.append(descr)
elif table_source == DiscoveryState.VANISHED:
if table_target != DiscoveryState.REMOVED:
services_to_save[(check_type, item)] = paramstring
- saved_services.add(descr)
if table_target == DiscoveryState.IGNORED:
add_disabled_rule.append(descr)
@@ -710,7 +707,6 @@ class ModeAjaxServiceDiscovery(WatoWebApiMode):
DiscoveryState.IGNORED,
]:
services_to_save[(check_type, item)] = paramstring
- saved_services.add(descr)
if table_target == DiscoveryState.IGNORED:
add_disabled_rule.append(descr)
@@ -726,7 +722,6 @@ class ModeAjaxServiceDiscovery(WatoWebApiMode):
DiscoveryState.IGNORED,
]:
services_to_save[(check_type, item)] = paramstring
- saved_services.add(descr)
if table_target == DiscoveryState.IGNORED:
add_disabled_rule.append(descr)
@@ -735,12 +730,10 @@ class ModeAjaxServiceDiscovery(WatoWebApiMode):
DiscoveryState.CLUSTERED_OLD,
]:
services_to_save[(check_type, item)] = paramstring
- saved_services.add(descr)
if apply_changes:
need_sync = False
if remove_disabled_rule or add_disabled_rule:
- add_disabled_rule = add_disabled_rule - remove_disabled_rule -
saved_services
self._save_host_service_enable_disable_rules(remove_disabled_rule,
add_disabled_rule)
need_sync = True