Module: check_mk
Branch: master
Commit: dd327ed45956449a19e31824858d20bf70bc7f9a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dd327ed4595644…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Jan 16 18:51:14 2015 +0100
#1213 New Macro $SERVICEDESC_FOR_URL$ for asciimail
The new macrco $SERVICEDESC_FOR_URL$ can be used in the body of asciimails. The Macro
replaces
whitespaces in the servicename with %20. This makes it possible to create custom urls who
can e.g. be used
to ackknowledge services.
---
.werks/1213 | 13 +++++++++++++
ChangeLog | 1 +
notifications/asciimail | 1 +
3 files changed, 15 insertions(+)
diff --git a/.werks/1213 b/.werks/1213
new file mode 100644
index 0000000..33c573c
--- /dev/null
+++ b/.werks/1213
@@ -0,0 +1,13 @@
+Title: New Macro $SERVICEDESC_FOR_URL$ for asciimail
+Level: 1
+Component: notifications
+Class: feature
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1421430462
+
+The new macrco $SERVICEDESC_FOR_URL$ can be used in the body of asciimails. The Macro
replaces
+whitespaces in the servicename with %20. This makes it possible to create custom urls who
can e.g. be used
+to ackknowledge services.
+
diff --git a/ChangeLog b/ChangeLog
index d90793b..2a631dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -106,6 +106,7 @@
Notifications:
* 1662 notification plugin spectrum: finalized script. now able to handle host
notications
+ * 1213 New Macro $SERVICEDESC_FOR_URL$ for asciimail...
* 1661 FIX: mknotifyd: improved performance when receiving forwarded notifications
* 1664 FIX: mknotifyd: further performance improvements for notification forwarding
* 1205 FIX: RBN: Fixed match contactgroup condition...
diff --git a/notifications/asciimail b/notifications/asciimail
old mode 100755
new mode 100644
index 5d6b203..9de5fa0
--- a/notifications/asciimail
+++ b/notifications/asciimail
@@ -159,6 +159,7 @@ def construct_content(context):
tmpl_body += context["PARAMETER_SERVICE_BODY"]
else:
tmpl_body += tmpl_service_body
+ context['SERVICEDESC_FOR_URL'] =
context['SERVICEDESC'].replace(' ','%20')
context['SUBJECT'] = substitute_context(tmpl, context)
body = substitute_context(tmpl_body, context)