Module: check_mk
Branch: master
Commit: e83eaf8ee016a377804abddef1d80692d1ec1972
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e83eaf8ee016a3…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue May 3 09:59:32 2016 +0200
3467 FIX logwatch: fix exception in case the logfile name contains non-ascii characters
---
.werks/3467 | 10 ++++++++++
ChangeLog | 1 +
checks/logwatch | 3 +++
3 files changed, 14 insertions(+)
diff --git a/.werks/3467 b/.werks/3467
new file mode 100644
index 0000000..64b0830
--- /dev/null
+++ b/.werks/3467
@@ -0,0 +1,10 @@
+Title: logwatch: fix exception in case the logfile name contains non-ascii characters
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1462262342
+
+
diff --git a/ChangeLog b/ChangeLog
index 1309c74..d2d405b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -203,6 +203,7 @@
* 3241 FIX: Fixed broken apt plugin
* 3430 FIX: apc_inrow_temp: fixed wrong data handling if data is not available or
incomplete
* 3456 FIX: bluecoat_diskcpu: Fixed visualization of graph
+ * 3467 FIX: logwatch: fix exception in case the logfile name contains non-ascii
characters
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/logwatch b/checks/logwatch
index 5a6395f..ea52ed3 100644
--- a/checks/logwatch
+++ b/checks/logwatch
@@ -409,6 +409,9 @@ def check_logwatch_generic(item, params, loglines, found,
groups=False):
# Logfile (=item) section not found and no local file found. This usually
# means, that the corresponding logfile also vanished on the target host.
+ if type(logfile) == unicode:
+ logfile = logfile.encode("utf-8")
+
if not found and not os.path.exists(logfile):
return (3, "log not present anymore")