Module: check_mk
Branch: master
Commit: 94bf2708088d10857a92ba2afdc8a32d8f790630
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=94bf2708088d10…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 9 16:07:32 2014 +0100
#1749 Allow title of notifiation script to be in third line if second line is encoding:
utf-8
This allows to write Python script with non-ASCII characters as notification scripts:
F+:mynotify
#!/usr/bin/python
# encoding: utf-8
# Notify With Föbäz
F-:
---
.werks/1749 | 15 +++++++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 2 ++
3 files changed, 18 insertions(+)
diff --git a/.werks/1749 b/.werks/1749
new file mode 100644
index 0000000..3e73821
--- /dev/null
+++ b/.werks/1749
@@ -0,0 +1,15 @@
+Title: Allow title of notifiation script to be in third line if second line is encoding:
utf-8
+Level: 1
+Component: notifications
+Compatible: compat
+Version: 1.2.5i7
+Date: 1418137567
+Class: feature
+
+This allows to write Python script with non-ASCII characters as notification scripts:
+
+F+:mynotify
+#!/usr/bin/python
+# encoding: utf-8
+# Notify With Föbäz
+F-:
diff --git a/ChangeLog b/ChangeLog
index 47e6f17..b2bae67 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -262,6 +262,7 @@
Notifications:
* 1512 Bulk notification can now be grouped according to custom macro values...
* 1650 Enabled rule based notifications by default (for new installations)...
+ * 1749 Allow title of notifiation script to be in third line if second line is
encoding: utf-8...
* 1168 FIX: HTML mails can now be configured to display graphs among each other...
* 1514 FIX: Try harder to detect previous hard state in notification when using
Nagios as core...
* 1582 FIX: Fixed missing graphs in mails when sending notifications to
non-contacts...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 9315159..4867850 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -11408,6 +11408,8 @@ def load_notification_scripts_from(adir):
lines = file(path)
lines.next()
line = lines.next().strip()
+ if line.startswith("#") and "encoding:" in line:
+ line = lines.next().strip()
if line.startswith("#"):
info["title"] =
line.lstrip("#").strip().split("#", 1)[0]
while True: