Module: check_mk
Branch: master
Commit: 981ccc3319e2a627e7b23eb0869c1bd77f6c209e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=981ccc3319e2a6…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 19 11:43:15 2016 +0100
4154 Do not send notifications if host found and currently in downtime
When you forward notifications from the Event Console to Check_MK then
from now on these are being suppressed if the host can be found in the
active monitoring and is currently in a scheduled downtime.
This is very much what users except and want to happen. Please note that
- however - this is an incompatible change sind now some notifications
will not longer be sent that have been sent previously.
Change-Id: Iee146930e13e2b382193c6f4c1abcf8e9b7d4808
---
.werks/4154 | 15 +++++++++++++++
ChangeLog | 4 ++++
bin/mkeventd | 6 ++++++
3 files changed, 25 insertions(+)
diff --git a/.werks/4154 b/.werks/4154
new file mode 100644
index 0000000..24d7135
--- /dev/null
+++ b/.werks/4154
@@ -0,0 +1,15 @@
+Title: Do not send notifications if host found and currently in downtime
+Level: 2
+Component: ec
+Compatible: incomp
+Version: 1.4.0i4
+Date: 1482144072
+Class: feature
+
+When you forward notifications from the Event Console to Check_MK then
+from now on these are being suppressed if the host can be found in the
+active monitoring and is currently in a scheduled downtime.
+
+This is very much what users except and want to happen. Please note that
+- however - this is an incompatible change sind now some notifications
+will not longer be sent that have been sent previously.
diff --git a/ChangeLog b/ChangeLog
index 65da6be..598017a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,10 @@
* 4142 New extended search dialog for rulesets and rules...
* 4003 FIX: esx_vsphere_objects: fixed check parameters display bug during WATO
service discovery
+ Event Console:
+ * 4154 Do not send notifications if host found and currently in downtime...
+ NOTE: Please refer to the migration notes!
+
1.4.0i3:
Core & Setup:
diff --git a/bin/mkeventd b/bin/mkeventd
index 6462a51..ae6bb11 100755
--- a/bin/mkeventd
+++ b/bin/mkeventd
@@ -3967,6 +3967,12 @@ def do_notify(event, username=None, is_cancelling=False):
for varname, value in sorted(context.items()):
verbose(" %-25s: %s" % (varname, value))
+ if context["HOSTDOWNTIME"] != "0":
+ log("Host %s is currently in scheduled downtime. "
+ "Skipping notification of event %s." % (
+ context["HOSTNAME"], event["id"]))
+ return
+
# Send notification context via stdin.
context_string = to_utf8("".join([