Module: check_mk
Branch: master
Commit: e68bb49c6767824759a7b4f312d76690569ae66b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e68bb49c676782…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu May 16 09:52:50 2013 +0200
WATO: New rule for notification_options of hosts and services
---
ChangeLog | 1 +
web/plugins/wato/check_mk_configuration.py | 51 +++++++++++++++++++++++++++-
2 files changed, 51 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 41d9723..d688d30 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -125,6 +125,7 @@
for each logfile on a host
* Configuration of an alternativ host check command
* Inventory: Display link symbol for ps ruleset
+ * New rule for notification_options of hosts and services
* FIX: Rulesets: correct display of rules within subfolders
diff --git a/web/plugins/wato/check_mk_configuration.py
b/web/plugins/wato/check_mk_configuration.py
index 2a90b6a..1bc5f19 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -1257,8 +1257,57 @@ register_rule(group,
"service completely. Per default all notifications are
enabled."),
choices = [ ("1", _("Enable service notifications")),
("0", _("Disable service notifications")) ],
+ ),
+ itemtype = "service"
+)
+
+register_rule(group,
+ "extra_host_conf:notification_options",
+ Transform(
+ ListChoice(
+ choices = [
+ ( "d", _("Host goes down")),
+ ( "u", _("Host gets unreachble")),
+ ( "r", _("Host goes up again")),
+ ( "f", _("Start or end of flapping state")),
+ ( "s", _("Start or end of a scheduled downtime")),
+ ],
+ default_value = [ "d", "u", "r", "f",
"s" ],
),
- itemtype = "service")
+ title = _("Notified events for hosts"),
+ help = _("This ruleset allows you to restrict notifications of host problems
to certain "
+ "states, e.g. only notify on DOWN, but not on UNREACHABLE. Please
select the types "
+ "of events that should initiate notifications. Please note that
several other "
+ "filters must also be passed in order for notifications to finally
being sent out."),
+ forth = lambda x: x != 'n' and x.split(",") or [],
+ back = lambda x: ",".join(x) or "n",
+ ),
+)
+
+register_rule(group,
+ "extra_service_conf:notification_options",
+ Transform(
+ ListChoice(
+ choices = [
+ ("w", _("Service goes into warning state")),
+ ("u", _("Service goes into unknown state")),
+ ("c", _("Service goes into critical state")),
+ ("r", _("Service recovers to OK")),
+ ("f", _("Start or end of flapping state")),
+ ("s", _("Start or end of a scheduled downtime")),
+ ],
+ default_value = [ "w", "u", "c", "r",
"f", "s" ],
+ ),
+ title = _("Notified events for services"),
+ help = _("This ruleset allows you to restrict notifications of service
problems to certain "
+ "states, e.g. only notify on CRIT, but not on WARN. Please select the
types "
+ "of events that should initiate notifications. Please note that
several other "
+ "filters must also be passed in order for notifications to finally
being sent out."),
+ forth = lambda x: x != 'n' and x.split(",") or [],
+ back = lambda x: ",".join(x) or "n",
+ ),
+ itemtype = "service"
+)
register_rule(group,
"extra_host_conf:notification_period",