Module: check_mk
Branch: master
Commit: 851c3c8247e63287b62ff13ee26c01d1d0e53f85
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=851c3c8247e632…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jan 15 17:49:14 2015 +0100
#1843 FIX Fixed crash in display of crash report for precompiled host checks
---
.werks/1843 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/crashed_check.py | 10 +++++++++-
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/.werks/1843 b/.werks/1843
new file mode 100644
index 0000000..61b796f
--- /dev/null
+++ b/.werks/1843
@@ -0,0 +1,10 @@
+Title: Fixed crash in display of crash report for precompiled host checks
+Level: 2
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1421340523
+
+
diff --git a/ChangeLog b/ChangeLog
index c1053d2..d90793b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -89,6 +89,7 @@
* 1802 FIX: Links in messages like "successfully sent X commands" are now
working again...
* 1803 FIX: Fixed exception in Check_MK prediction page...
* 1804 FIX: Fixed prechecked checkboxes in view actions after first action submit...
+ * 1843 FIX: Fixed crash in display of crash report for precompiled host checks
WATO:
* 1760 Added search form to manual checks page
diff --git a/web/htdocs/crashed_check.py b/web/htdocs/crashed_check.py
index d9d62da..7639e72 100644
--- a/web/htdocs/crashed_check.py
+++ b/web/htdocs/crashed_check.py
@@ -67,11 +67,19 @@ def page_crashed_check():
raise MKGeneralException("Encoded crash dump data is invalid: %s" % e)
trace = fetch_file_from_tar(tardata, "./trace")
+ tracelines = []
+ for line in trace.splitlines():
+ try:
+ tracelines.append(line.decode('utf-8'))
+ except:
+ tracelines.append(repr(line))
+ trace = "\r\n".join(tracelines)
+
agent_output = fetch_file_from_tar(tardata, "./agent_output")
body = "Dear Check_MK Developer team,\r\n\r\n" \
+ "I hereby send you a report of a crashed check:\r\n\r\n" \
- + trace + "\r\n" \
+ + trace.decode('utf-8') + "\r\n" \
+ "BASE64 encoded tarball with agent output:" \
+ "\r\n\r\n\r\n" + encoded_tardata \
+ "\r\n\r\nWith best regards,\r\n\r\n"