Module: check_mk
Branch: master
Commit: 45666fded546f3187124c5efe96e8563befc9f4e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=45666fded546f3…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Oct 28 11:45:55 2016 +0200
3972 It's now possible to bulk notifications based on Event console contacts
---
.werks/3972 | 9 +++++++++
ChangeLog | 1 +
modules/notify.py | 9 +++++++++
web/htdocs/wato.py | 1 +
4 files changed, 20 insertions(+)
diff --git a/.werks/3972 b/.werks/3972
new file mode 100644
index 0000000..5900711
--- /dev/null
+++ b/.werks/3972
@@ -0,0 +1,9 @@
+Title: It's now possible to bulk notifications based on Event console contacts
+Level: 1
+Component: notifications
+Compatible: compat
+Version: 1.4.0i2
+Date: 1477647911
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 964d617..caae362 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -67,6 +67,7 @@
Notifications:
* 3957 mail: now allows extra HTML section between body and table
+ * 3972 It's now possible to bulk notifications based on Event console contacts
* 3900 FIX: Notification analysis: Fixed wrong color for host notification states
* 3968 FIX: Notifications / Alert handling: Fixed configuring nth notifications
without state changes...
diff --git a/modules/notify.py b/modules/notify.py
index d0555e2..bd32de0 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -1306,22 +1306,31 @@ def do_bulk_notify(contact, plugin, params, plugin_context,
bulk):
what = plugin_context["WHAT"]
bulk_path = (contact, plugin, str(bulk["interval"]),
str(bulk["count"]))
bulkby = bulk["groupby"]
+
if "host" in bulkby:
bulk_path += ("host", plugin_context["HOSTNAME"])
elif "folder" in bulkby:
bulk_path += ("folder", find_wato_folder(plugin_context))
+
if "service" in bulkby:
bulk_path += ("service", plugin_context.get("SERVICEDESC",
""))
+
if "sl" in bulkby:
sl = plugin_context.get(what + "_SL", "")
bulk_path += ("sl", sl)
+
if "check_type" in bulkby:
command = plugin_context.get(what + "CHECKCOMMAND",
"").split("!")[0]
bulk_path += ("check_type", command)
+
if "state" in bulkby:
state = plugin_context.get(what + "STATE", "")
bulk_path += ("state", state)
+ if "ec_contact" in bulkby:
+ ec_contact = plugin_context.get("EC_CONTACT", "")
+ bulk_path += ("ec_contact", ec_contact)
+
# User might have specified _FOO instead of FOO
bulkby_custom = bulk.get("groupby_custom", [])
for macroname in bulkby_custom:
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 7c4997a..0782882 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -6987,6 +6987,7 @@ def vs_notification_bulkby():
( "sl", _("Service level") ),
( "check_type", _("Check type") ),
( "state", _("Host/Service state") ),
+ ( "ec_contact", _("Event console contact") ),
],
default_value = [ "host" ],
)