Module: check_mk
Branch: master
Commit: 2a60ca3eaa754fb3aec7f78b4df5236614519f81
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2a60ca3eaa754f…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Dec 16 11:02:11 2014 +0100
#1205 FIX RBN: Fixed match contactgroup condition
The condtion used the host context in case of service notifications and no context
in case of host notifications. This is fixed now.
---
.werks/1205 | 12 ++++++++++++
ChangeLog | 1 +
modules/notify.py | 2 +-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/1205 b/.werks/1205
new file mode 100644
index 0000000..a98637d
--- /dev/null
+++ b/.werks/1205
@@ -0,0 +1,12 @@
+Title: RBN: Fixed match contactgroup condition
+Level: 1
+Component: notifications
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1418724026
+
+The condtion used the host context in case of service notifications and no context
+in case of host notifications. This is fixed now.
+
diff --git a/ChangeLog b/ChangeLog
index 43c6fb9..4594d34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,7 @@
Notifications:
* 1662 notification plugin spectrum: finalized script. now able to handle host
notications
* 1661 FIX: mknotifyd: improved performance when receiving forwarded notifications
+ * 1205 FIX: RBN: Fixed match contactgroup condition...
1.2.6b1:
diff --git a/modules/notify.py b/modules/notify.py
index 4b47bcd..a94d260 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -700,7 +700,7 @@ def rbn_match_servicegroups(rule, context):
def rbn_match_contactgroups(rule, context):
required_groups = rule.get("match_contactgroups")
- if context["WHAT"] != "SERVICE":
+ if context["WHAT"] == "SERVICE":
cgn = context.get("SERVICECONTACTGROUPNAMES")
else:
cgn = context.get("HOSTCONTACTGROUPNAMES")