Module: check_mk
Branch: master
Commit: 37ea1d93bcc628ecb21e89ee440bc3ed25df7214
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=37ea1d93bcc628…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Thu Mar 15 16:21:09 2018 +0100
5751 FIX Add contact group contacts of EC rule if host is not a core host
When an event was received that did not belong to a host in the monitoring the
contacts of the contact groups specified in a Event Console rule were not
added to the notification context if the option "Host's contact groups have
precedence" was set in the Event Console rule. Now the contacts of the
specified contact groups are added even when the option is set.
Change-Id: I1a98fb4ddf5f6c2bca3022f6ff7946206e51a938
---
.werks/5751 | 14 ++++++++++++++
cmk/ec/main.py | 3 ++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/5751 b/.werks/5751
new file mode 100644
index 0000000..5b973a8
--- /dev/null
+++ b/.werks/5751
@@ -0,0 +1,14 @@
+Title: Add contact group contacts of EC rule if host is not a core host
+Level: 1
+Component: ec
+Compatible: compat
+Edition: cre
+Version: 1.5.0i4
+Date: 1521126878
+Class: fix
+
+When an event was received that did not belong to a host in the monitoring the
+contacts of the contact groups specified in a Event Console rule were not
+added to the notification context if the option "Host's contact groups have
+precedence" was set in the Event Console rule. Now the contacts of the
+specified contact groups are added even when the option is set.
diff --git a/cmk/ec/main.py b/cmk/ec/main.py
index 180f652..c36f3ac 100644
--- a/cmk/ec/main.py
+++ b/cmk/ec/main.py
@@ -4587,7 +4587,8 @@ def add_contacts_from_rule(context, event):
if event.get("contact_groups") is not None and \
event.get("contact_groups_notify") and (
"CONTACTS" not in context or
- event.get("contact_groups_precedence", "host") !=
"host"):
+ event.get("contact_groups_precedence", "host") !=
"host" or
+ not event['core_host']):
add_contact_information_to_context(context, event["contact_groups"])
# "CONTACTS" is allowed to be missing in the context, cmk --notify will