Module: check_mk
Branch: master
Commit: 519c27008372895f93ec8f312708737ef781b8e5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=519c2700837289…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Nov 17 16:07:33 2015 +0100
#2795 FIX mkeventd: send email action did not work if message text contains umlauts
This werk fixes an encoding exception within the event console.
Message texts like <i>"This wüll break"</i> will no longer cause
trouble.
---
.werks/2795 | 10 ++++++++++
ChangeLog | 1 +
mkeventd/bin/mkeventd | 2 +-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/2795 b/.werks/2795
new file mode 100644
index 0000000..020b62c
--- /dev/null
+++ b/.werks/2795
@@ -0,0 +1,10 @@
+Title: mkeventd: send email action did not work if message text contains umlauts
+Level: 1
+Component: ec
+Compatible: compat
+Version: 1.2.7i4
+Date: 1447772581
+Class: fix
+
+This werk fixes an encoding exception within the event console.
+Message texts like <i>"This wüll break"</i> will no longer cause
trouble.
diff --git a/ChangeLog b/ChangeLog
index dcec0cb..474e83d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -130,6 +130,7 @@
* 2733 Visibility of Event Console events more flexible now...
* 2719 FIX: Events Check: Links to EC were broken when using regular expressions as
application...
* 2757 FIX: Events Check: Fixed check finding too many events (host search was infix
search instead of full match)...
+ * 2795 FIX: mkeventd: send email action did not work if message text contains
umlauts...
Livestatus:
* 2743 FIX: Fixed handling of column types in "GET columns"...
diff --git a/mkeventd/bin/mkeventd b/mkeventd/bin/mkeventd
index 10a6daf..f25ab57 100755
--- a/mkeventd/bin/mkeventd
+++ b/mkeventd/bin/mkeventd
@@ -3251,7 +3251,7 @@ def do_event_action(action, event, user=""):
if action_type == 'email':
to = substitute_event_tags(settings["to"], event)
subject = substitute_event_tags(settings["subject"], event)
- body = substitute_event_tags(settings["body"], event)
+ body = to_utf8(substitute_event_tags(settings["body"], event))
send_email(to, subject, body)
log_event_history(event, "EMAIL", user, "%s|%s" % (to,
subject))
elif action_type == 'script':