Module: check_mk
Branch: master
Commit: a5709952183748b1ce7e14ca18c46ff32a2029dd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a5709952183748…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Wed Jun 29 14:43:38 2016 +0200
3149 FIX fixed rare crash if alert handling tried to long non-latin characters
---
.werks/3149 | 10 ++++++++++
ChangeLog | 1 +
modules/events.py | 2 ++
3 files changed, 13 insertions(+)
diff --git a/.werks/3149 b/.werks/3149
new file mode 100644
index 0000000..96361b6
--- /dev/null
+++ b/.werks/3149
@@ -0,0 +1,10 @@
+Title: fixed rare crash if alert handling tried to long non-latin characters
+Level: 1
+Component: core
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1467204048
+
+
diff --git a/ChangeLog b/ChangeLog
index dc1b951..9fd0561 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,7 @@
* 3471 FIX: Repair ignoring discovery errors when bogus %s is contained in service
description...
* 3616 FIX: Fix cmk -I ignoring the option --cache...
* 3617 FIX: cmk -I without host specification now (again) always uses cache files...
+ * 3149 FIX: fixed rare crash if alert handling tried to long non-latin characters
Checks & Agents:
* 3183 aruba_wlc_aps: new check which monitors the provisioned accesspoints of an
Aruba Network WLAN Controller
diff --git a/modules/events.py b/modules/events.py
index bfdbadf..a659703 100644
--- a/modules/events.py
+++ b/modules/events.py
@@ -168,6 +168,8 @@ def render_context_dump(raw_context):
def event_log(logfile_path, message):
+ if isinstance(message, str):
+ message = message.decode("utf-8")
formatted = u"%s %s\n" % (time.strftime("%F %T",
time.localtime()), message)
file(logfile_path, "a").write(formatted.encode("utf-8"))