Module: check_mk
Branch: master
Commit: 9d88d55cd0bb794d19eab9529eb992b035dd6004
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9d88d55cd0bb79…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Fri Jun 29 18:18:13 2018 +0200
6118 Add a analyze configuration rule for flexible and plain email notifications
A deprecation warning will be shown if rulebased notifications are deactivated
since flexible and plain email notifications are considered deprecated in
version 1.5.0 and will be removed in version 1.6.0. Please consider to
switch to rulebased notifications.
Change-Id: Ibdb7d45eebdacec1cbb2c033aaef5f1b70e5cb70
---
.werks/6118 | 12 ++++++++++++
web/plugins/wato/ac_tests.py | 25 ++++++++++++++++++++++++-
2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/.werks/6118 b/.werks/6118
new file mode 100644
index 0000000..6653801
--- /dev/null
+++ b/.werks/6118
@@ -0,0 +1,12 @@
+Title: Add a analyze configuration rule for flexible and plain email notifications
+Level: 1
+Component: multisite
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1530288849
+Class: feature
+
+A deprecation warning will be shown if rulebased notifications are deactivated
+since flexible and plain email notifications are considered deprecated and will
+be removed in the next release.
diff --git a/web/plugins/wato/ac_tests.py b/web/plugins/wato/ac_tests.py
index f73b850..96db7a3 100644
--- a/web/plugins/wato/ac_tests.py
+++ b/web/plugins/wato/ac_tests.py
@@ -748,7 +748,30 @@ class ACTestESXDatasources(ACTest):
in ['agent', 'hostsystem_agent'])
if vsphere_queries_agent:
all_rules_ok = False
- yield ACResultCRIT("Rule %d in Folder %s is affected" %
(rule_index + 1, folder.title()))
+ yield ACResultCRIT(_("Rule %d in Folder %s is affected") %
(rule_index + 1, folder.title()))
if all_rules_ok:
yield ACResultOK(_("No configured rules are affected"))
+
+
+class ACTestRulebasedNotifications(ACTest):
+ def category(self):
+ return ACTestCategories.deprecations
+
+ def title(self):
+ return _("Flexible and plain email notifications")
+
+ def help(self):
+ return _("Flexible and plain email notifications are considered deprecated
in version 1.5.0 and "
+ " will be removed in Check_MK version 1.6.0. Please consider to
switch to rulebased "
+ "notifications.")
+
+ def is_relevant(self):
+ return True
+
+ def execute(self):
+ settings = watolib.load_configuration_settings()
+ if settings['enable_rulebased_notifications'] != True:
+ yield ACResultCRIT('Rulebased notifications are deactivated in the global
settings')
+ else:
+ yield ACResultOK(_("Rulebased notifications are activated"))