Module: check_mk
Branch: master
Commit: 5821ca0b450f4cc1cbbc684a3ebed87157a65911
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5821ca0b450f4c…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Dec 16 12:05:13 2016 +0100
4151 Use notification fallback also for hosts not known to the monitoring
This can happen if you forward notifications from the Event Console. All
contacts that are configured for notifications fallback and also the
global fallback email address will be regarded as contacts in that
case.
Change-Id: I841a56ae239f88aced8f0f403f5a644cea8aa2a7
---
.werks/4151 | 12 ++++++++++++
ChangeLog | 1 +
modules/notify.py | 3 +--
web/htdocs/wato.py | 15 +++++++++------
web/plugins/wato/globals_notification.py | 14 ++++++++------
5 files changed, 31 insertions(+), 14 deletions(-)
diff --git a/.werks/4151 b/.werks/4151
new file mode 100644
index 0000000..2783d59
--- /dev/null
+++ b/.werks/4151
@@ -0,0 +1,12 @@
+Title: Use notification fallback also for hosts not known to the monitoring
+Level: 2
+Component: ec
+Compatible: compat
+Version: 1.4.0i3
+Date: 1481886244
+Class: feature
+
+This can happen if you forward notifications from the Event Console. All
+contacts that are configured for notifications fallback and also the
+global fallback email address will be regarded as contacts in that
+case.
diff --git a/ChangeLog b/ChangeLog
index 09d6409..8e72049 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -133,6 +133,7 @@
Event Console:
* 4132 Monitoring notifications: Add EC_ORIG_HOST to notifiation context...
* 4148 EC: reorder entries in Performance snapin, add overflows and load
+ * 4151 Use notification fallback also for hosts not known to the monitoring...
* 4097 FIX: Event console: Make writing of status file more robust...
* 4147 FIX: Always show rule analyser result on Generate, not only after previous Try
out...
* 4149 FIX: Fix notifications from Event Console if host has more than one
contact...
diff --git a/modules/notify.py b/modules/notify.py
index 8672056..efa0fa8 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -781,8 +781,7 @@ def rbn_object_contacts(context):
if commasepped:
return commasepped.split(",")
else:
- # TODO: Hier die Fallback-Contacts eintragen!
- return []
+ return [ contact["name"] for contact in rbn_fallback_contacts() ]
def rbn_all_contacts(with_email=None):
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index a3e967d..fedbc9d 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -10334,7 +10334,7 @@ def mode_edit_user(phase):
new_user["fallback_contact"] =
html.get_checkbox("fallback_contact")
if new_user["fallback_contact"] and not
new_user["email"]:
raise MKUserError("email",
- _("You have enabled the fallback notifications but missed to
configure a "
+ _("You have enabled the fallback notifications but missed to
configure an "
"email address. You need to configure your mail address in
order "
"to be able to receive fallback notifications."))
@@ -10607,11 +10607,14 @@ def mode_edit_user(phase):
forms.section(_("Fallback notifications"), simple=True)
html.checkbox("fallback_contact", False, label = _("Receive
fallback notifications"))
- html.help(_("When using rule based notifications and a notification is
created which is "
- "not handled by any rule, you can enable this user to receive
those "
- "notifications. As alternative you could configure a single
email address "
- "as the global setting <a
href=\"wato.py?mode=edit_configvar&varname=notification_fallback_email\">"
- "Fallback email address for rule based
notifications</a>."))
+
+ html.help(_("In case none of your notification rules handles a certain event
a notification "
+ "will be sent to this contact. This makes sure that in that case at
least <i>someone</i> "
+ "gets notified. Furthermore this contact will be used for
notifications to any host or service "
+ "that is not known to the monitoring. This can happen when you
forward notifications "
+ "from the Event Console.<br><br>Notification fallback
can also configured in the global "
+ "setting <a
href=\"wato.py?mode=edit_configvar&varname=notification_fallback_email\">"
+ "Fallback email address for notifications</a>."))
forms.header(_("Personal Settings"), isopen = False)
select_language(user)
diff --git a/web/plugins/wato/globals_notification.py
b/web/plugins/wato/globals_notification.py
index 8e67554..aab54b4 100644
--- a/web/plugins/wato/globals_notification.py
+++ b/web/plugins/wato/globals_notification.py
@@ -50,12 +50,14 @@ register_configvar(group,
register_configvar(group,
"notification_fallback_email",
EmailAddress(
- title = _("Fallback email address for rule based notifications"),
- help = _("If you work with rule based notifications then you should
configure an email "
- "address here. In case of a hole in your notification rules a
notification "
- "will be sent to this address. This makes sure that in any case
<i>someone</i> gets "
- "notified. You can also configure single users to receive those
fallback notifications, "
- "by enabling the option in the user profile."),
+ title = _("Fallback email address for notifications"),
+ help = _("In case none of your notification rules handles a certain event a
notification "
+ "will be sent to this address. This makes sure that in that case at
least <i>someone</i> "
+ "gets notified. Furthermore this email address will be used in
notifications as a "
+ "contact for any host or service "
+ "that is not known to the monitoring. This can happen when you
forward notifications "
+ "from the Event Console.<br><br>Notification fallback
can also configured in single "
+ "user profiles."),
empty_text = _("<i>(No fallback email address
configured!)</i>"),
make_clickable = False,
),