HOSTCONTACTGROUPNAMES parameters no longer causes a notification not to be sent
Message-ID: <593827e8.Uht/qd9iLfRHp5Ez%ab(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: e946ee5a9fca6009e47506baa3fef3740390eef0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e946ee5a9fca60…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Jun 7 17:21:52 2017 +0200
4709 FIX Notifications: Missing SERVICECONTACTGROUPNAMES/HOSTCONTACTGROUPNAMES parameters
no longer causes a notification not to be sent
This werk reverts part of WK3886. The nagios core did not set the environment parameters
mentioned in the topic.
As a result the notifcation condition <i>Match Contact Groups</i> did never
match and a notification was not sent.
This has been changed so that this condition check is skipped, whenever this information
is missing.
An error scenario should always let the message through.
The issue, that the nagios core does not set this environment info will be fixed in a
future werk.
Change-Id: If330de216270299a54f406a913e654526d540381
---
.werks/4709 | 18 ++++++++++++++++++
modules/events.py | 5 +++--
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/.werks/4709 b/.werks/4709
new file mode 100644
index 0000000..02349b0
--- /dev/null
+++ b/.werks/4709
@@ -0,0 +1,18 @@
+Title: Notifications: Missing SERVICECONTACTGROUPNAMES/HOSTCONTACTGROUPNAMES parameters
no longer causes a notification not to be sent
+Level: 1
+Component: notifications
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1496848680
+
+This werk reverts part of WK3886. The nagios core did not set the environment parameters
mentioned in the topic.
+As a result the notifcation condition <i>Match Contact Groups</i> did never
match and a notification was not sent.
+This has been changed so that this condition check is skipped, whenever this information
is missing.
+
+An error scenario should always let the message through.
+
+
+The issue, that the nagios core does not set this environment info will be fixed in a
future werk.
diff --git a/modules/events.py b/modules/events.py
index cfa9b8d..fdc6170 100644
--- a/modules/events.py
+++ b/modules/events.py
@@ -517,8 +517,9 @@ def event_match_contactgroups(rule, context):
if required_groups != None:
if cgn == None:
- return "No information about contact groups is in the context, but
" \
- "must be in group %s" % (" or
".join(required_groups))
+ event_log("Warning: No information about contact groups in the context.
" \
+ "Seems that you don't use the Check_MK Microcore.
")
+ return
if cgn:
contactgroups = cgn.split(",")