Module: check_mk
Branch: master
Commit: 89f1ab85f0a9da5568a03216f96ef4a32e80daa5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=89f1ab85f0a9da…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri May 6 11:25:36 2016 +0200
3469 Show type of rule match of a rule (first, per-parameter, all) in WATO
This additional information makes it clearer to the user whether a just the
first matching rule defines the parameter, or further matching rules can
have influence, too.
---
.werks/3469 | 11 +++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 16 ++++++++++++++++
3 files changed, 28 insertions(+)
diff --git a/.werks/3469 b/.werks/3469
new file mode 100644
index 0000000..69c66a2
--- /dev/null
+++ b/.werks/3469
@@ -0,0 +1,11 @@
+Title: Show type of rule match of a rule (first, per-parameter, all) in WATO
+Level: 2
+Component: wato
+Compatible: compat
+Version: 1.2.9i1
+Date: 1462526650
+Class: feature
+
+This additional information makes it clearer to the user whether a just the
+first matching rule defines the parameter, or further matching rules can
+have influence, too.
diff --git a/ChangeLog b/ChangeLog
index 0323c05..11285ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -287,6 +287,7 @@
* 3304 Bulk deleting users is now available
* 3239 The delay and the period of notifications can be fractions of a minute now.
* 3116 Timerange buttons for downtimes can now be configured...
+ * 3469 Show type of rule match of a rule (first, per-parameter, all) in WATO...
* 3060 FIX: Folder properties: Fixed exception when a user has no alias set...
* 3062 FIX: Git integration: Fixed not adding files in WATO folders to git control
* 3203 FIX: Distributed WATO: Fixed exception in remote host service discovery...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index f00c0e5..de6392a 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -12302,6 +12302,8 @@ def mode_edit_ruleset(phase):
html.help(rulespec["help"])
+ explain_ruleset_match_type(rulespec)
+
# Collect all rulesets
all_rulesets = load_all_rulesets()
ruleset = all_rulesets.get(varname)
@@ -12432,6 +12434,20 @@ def mode_edit_ruleset(phase):
create_new_rule_form(rulespec, hostname, item, varname)
+
+def explain_ruleset_match_type(rulespec):
+ match_type = rulespec["match"]
+ html.write("<b>%s:</b> " % _("Matching"))
+ if match_type == "first":
+ html.write(_("The first matching rule defines the parameter."))
+ elif match_type == "dict":
+ html.write(_("Each parameter is defined by the first matching rule where
that parameter is set (checked)."))
+ elif match_type == "all":
+ html.write(_("All matching rules will add to the resulting list."))
+ else:
+ html.write(_("Unknown match type: %s") % match_type)
+
+
def show_rule_in_table(rulespec, tag_specs, host_list, item_list, varname, value, folder,
rule_options):
# Conditions