Module: check_mk
Branch: master
Commit: f7186656eff6f56ed36eb68c8c654c2fba600ca9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f7186656eff6f5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 26 17:16:44 2019 +0100
Replace individual rule matching with generic code
Change-Id: I4f1bdc87096498192806b47215ff4beec9844aab
---
cmk_base/automations/check_mk.py | 19 +------------------
1 file changed, 1 insertion(+), 18 deletions(-)
diff --git a/cmk_base/automations/check_mk.py b/cmk_base/automations/check_mk.py
index 7ab20a4..424ff35 100644
--- a/cmk_base/automations/check_mk.py
+++ b/cmk_base/automations/check_mk.py
@@ -697,24 +697,7 @@ class AutomationAnalyseServices(Automation):
def static_check_rules_of(self, checkgroup_name, hostname):
config_cache = config.get_config_cache()
-
- rules = []
- for entry in config.static_checks.get(checkgroup_name, []):
- entry, rule_options = config.get_rule_options(entry)
- if rule_options.get("disabled"):
- continue
-
- if len(entry) == 3:
- taglist, hostlist = entry[1:3]
- else:
- hostlist = entry[1]
- taglist = []
-
- if config.hosttags_match_taglist(config_cache.tags_of_host(hostname),
taglist) and \
- config.in_extraconf_hostlist(hostlist, hostname):
- rules.append(entry[0])
-
- return rules
+ return config_cache.host_extra_conf(hostname,
config.static_checks.get(checkgroup_name, []))
automations.register(AutomationAnalyseServices())