Module: check_mk
Branch: master
Commit: 90f05a3a9492a1b00fa7926f75ed0961b16ac85e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=90f05a3a9492a1…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Sep 13 16:27:51 2017 +0200
5127 asciimail, mail: Added macros $COUNT_NOTIFICATIONS$ and $COUNT_HOSTS$ which can be used in bulk notification subject
In notification bulking you're able to customize your own subject.
Moreover if the macro {{$COUNT_NOTIFICATIONS$}} is used, the amount of
notifications will be inserted and if you use the macro {{$COUNT_HOSTS$}}
then the amount of hosts will be applied.
Change-Id: Ic80c5c8ff6eac114463522b44962faa78b78e27e
---
.werks/5127 | 13 +++++++++++++
notifications/asciimail | 19 +++++++++++--------
notifications/mail | 20 ++++++++++++--------
web/htdocs/wato.py | 9 +++++++--
4 files changed, 43 insertions(+), 18 deletions(-)
diff --git a/.werks/5127 b/.werks/5127
new file mode 100644
index 0000000..d763f11
--- /dev/null
+++ b/.werks/5127
@@ -0,0 +1,13 @@
+Title: asciimail, mail: Added macros $COUNT_NOTIFICATIONS$ and $COUNT_HOSTS$ which can be used in bulk notification subject
+Level: 1
+Component: notifications
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1505312621
+Class: feature
+
+In notification bulking you're able to customize your own subject.
+Moreover if the macro {{$COUNT_NOTIFICATIONS$}} is used, the amount of
+notifications will be inserted and if you use the macro {{$COUNT_HOSTS$}}
+then the amount of hosts will be applied.
diff --git a/notifications/asciimail b/notifications/asciimail
index 3e72eef..94f17d8 100755
--- a/notifications/asciimail
+++ b/notifications/asciimail
@@ -216,16 +216,19 @@ def read_bulk_contexts():
def get_bulk_notification_subject(parameters, contexts, hosts):
+ hosts = list(hosts)
if parameters.get("PARAMETER_BULK_SUBJECT"):
- return parameters["PARAMETER_BULK_SUBJECT"]
-
+ subject = parameters["PARAMETER_BULK_SUBJECT"]
+ elif len(hosts) == 1:
+ subject = "Check_MK: $COUNT_NOTIFICATIONS$ notifications for %s" % hosts[0]
else:
- hosts = list(hosts)
- if len(hosts) == 1:
- return "Check_MK: %d notifications for %s" % (len(contexts), hosts[0])
- else:
- return "Check_MK: %d notifications for %d hosts" % \
- (len(contexts), len(hosts))
+ subject = "Check_MK: $COUNT_NOTIFICATIONS$ notifications for $COUNT_HOSTS$ hosts"
+
+ if "$COUNT_NOTIFICATIONS$" in subject:
+ subject.replace("$COUNT_NOTIFICATIONS$", len(contexts))
+ if "$COUNT_HOSTS$" in subject:
+ subject.replace("$COUNT_HOSTS$", len(hosts))
+ return subject
def main():
diff --git a/notifications/mail b/notifications/mail
index 4c8920f..8cbdadd 100755
--- a/notifications/mail
+++ b/notifications/mail
@@ -950,16 +950,20 @@ def read_bulk_contexts():
def get_bulk_notification_subject(parameters, contexts, hosts):
+ hosts = list(hosts)
if parameters.get("PARAMETER_BULK_SUBJECT"):
- return parameters["PARAMETER_BULK_SUBJECT"]
-
+ subject = parameters["PARAMETER_BULK_SUBJECT"]
+ elif len(hosts) == 1:
+ subject = "Check_MK: $COUNT_NOTIFICATIONS$ notifications for %s" % hosts[0]
else:
- hosts = list(hosts)
- if len(hosts) == 1:
- return "Check_MK: %d notifications for %s" % (len(contexts), hosts[0])
- else:
- return "Check_MK: %d notifications for %d hosts" % \
- (len(contexts), len(hosts))
+ subject = "Check_MK: $COUNT_NOTIFICATIONS$ notifications for $COUNT_HOSTS$ hosts"
+
+ if "$COUNT_NOTIFICATIONS$" in subject:
+ subject.replace("$COUNT_NOTIFICATIONS$", len(contexts))
+ if "$COUNT_HOSTS$" in subject:
+ subject.replace("$COUNT_HOSTS$", len(hosts))
+ return subject
+
def main():
if bulk_mode:
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 243c617..a05d0b8 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -7671,9 +7671,14 @@ def vs_notification_rule(userid = None):
( "bulk_subject", TextAscii(
title = _("Subject for bulk notifications"),
help = _("Customize the subject for bulk notifications and overwrite "
- "default subject 'Check_MK: X notifications for HOST' resp. "
- "'Check_MK: X notifications for Y hosts'."),
+ "default subject <tt>Check_MK: $COUNT_NOTIFICATIONS$ notifications for HOST</tt>"
+ " resp. <tt>Check_MK: $COUNT_NOTIFICATIONS$ notifications for $COUNT_HOSTS$ hosts</tt>. "
+ "Both macros <tt>$COUNT_NOTIFICATIONS$</tt> and <tt>$COUNT_HOSTS$</tt> can be used in "
+ "any customized subject. If <tt>$COUNT_NOTIFICATIONS$</tt> is used, the amount of "
+ "notifications will be inserted and if you use <tt>$COUNT_HOSTS$</tt> then the "
+ "amount of hosts will be applied."),
size = 80,
+ default_value = "Check_MK: $COUNT_NOTIFICATIONS$ notifications for $COUNT_HOSTS$ hosts"
)),
],
columns = 1,
Module: check_mk
Branch: master
Commit: a6ff7e43b63e63e20ccf174312c3b80abcc2768e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a6ff7e43b63e63…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Thu Sep 14 15:16:14 2017 +0200
added bug regarding the breakup of a connection between master and slave site
Change-Id: I28d78bb98273a59d5cd64b4639111bcf8046cb0c
---
.bugs/2516 | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/.bugs/2516 b/.bugs/2516
new file mode 100644
index 0000000..fc14396
--- /dev/null
+++ b/.bugs/2516
@@ -0,0 +1,12 @@
+Title: Sites crashes if connection is changed from slave to no replication
+Component: wato
+State: open
+Date: 2017-09-14 15:09:37
+Targetversion: 1.4.0
+Class: nastiness
+
+At the moment there is no warning, if a site connection is changed from
+"Slave" to "No replication". Configured hosts on the master site still
+persists even if the slave site is not available anymore. You will need to
+manually change the attribute "Monitored on site" on all hosts which did
+belong to the slave site. Otherwise you are not able to remove them.
Module: check_mk
Branch: master
Commit: 0f775e6a9ead33068cab3ca5a93908aa95cd5f98
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0f775e6a9ead33…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Thu Sep 14 13:44:38 2017 +0200
made help text for check interval for host checks more specific
Change-Id: I30b08fdde6454b3e7cea3a0cdee93e0d4cc9445b
---
web/plugins/wato/check_mk_configuration.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index 60f2a0c..fbdd4e0 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -1620,7 +1620,7 @@ register_rule(group,
forth = lambda v: int(v * 60),
back = lambda v: float(v) / 60.0,
title = _("Normal check interval for host checks"),
- help = _("The default interval is set to one minute. Here you can specify a larger "
+ help = _("The default interval is set to 6 seconds for smart ping and one minute for all other. Here you can specify a larger "
"interval. The host is contacted in this interval on a regular base. The host "
"check is also being executed when a problematic service state is detected to check "
"wether or not the service problem is resulting from a host problem.")
@@ -1638,7 +1638,7 @@ register_rule(group,
"attempts to a number greater than one. In case a host check is not UP "
"and the maximum number of check attempts is not yet reached, it will be "
"rescheduled with this interval. The retry interval is usually set to a smaller "
- "value than the normal interval."),
+ "value than the normal interval. The default is 6 seconds for smart ping and 60 seconds for all other."),
)
)