[checkmk-commits] Check_MK Git: check_mk: #1378 FIX mk_logwatch: remove exceeding \n when rewriting message and using \0

Mathias Kettner mk at mathias-kettner.de
Sun Aug 24 22:05:29 CEST 2014


Module: check_mk
Branch: master
Commit: ebc7a7193a9bbd0f1802df520fbed1ac8a142190
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ebc7a7193a9bbd0f1802df520fbed1ac8a142190

Author: Mathias Kettner <mk at mathias-kettner.de>
Date:   Sun Aug 24 22:05:24 2014 +0200

#1378 FIX mk_logwatch: remove exceeding \n when rewriting message and using \0

When using <tt>R</tt> for rewriting message and then using <tt>\0</tt> for
inserting the complete original message there was only exceeding linefeed.
This has been removed and thus the format being fixed.

---

 .werks/1378                |   11 +++++++++++
 ChangeLog                  |    1 +
 agents/plugins/mk_logwatch |    2 +-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/.werks/1378 b/.werks/1378
new file mode 100644
index 0000000..b4c2bd6
--- /dev/null
+++ b/.werks/1378
@@ -0,0 +1,11 @@
+Title: mk_logwatch: remove exceeding \n when rewriting message and using \0
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1408910658
+Class: fix
+
+When using <tt>R</tt> for rewriting message and then using <tt>\0</tt> for
+inserting the complete original message there was only exceeding linefeed.
+This has been removed and thus the format being fixed.
diff --git a/ChangeLog b/ChangeLog
index ef7e7f4..ca9b26b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -56,6 +56,7 @@
     * 1144 FIX: blade_bx_temp, dell_chassis_temp, emerson_temp, ibm_svc_enclosurestats, ups_bat_temp: rename service description...
             NOTE: Please refer to the migration notes!
     * 1145 FIX: windows_tasks: handle case correctly where task is currently running...
+    * 1378 FIX: mk_logwatch: remove exceeding \n when rewriting message and using \0...
 
     Multisite:
     * 1066 Implemented Dashboard Designer...
diff --git a/agents/plugins/mk_logwatch b/agents/plugins/mk_logwatch
index 65ab679..d5326ef 100755
--- a/agents/plugins/mk_logwatch
+++ b/agents/plugins/mk_logwatch
@@ -282,7 +282,7 @@ def process_logfile(logfile, patterns):
 
                 # Replacement
                 for replace in replacements:
-                    line = replace.replace('\\0', line) + "\n"
+                    line = replace.replace('\\0', line.rstrip()) + "\n"
                     for nr, group in enumerate(matches.groups()):
                         line = line.replace('\\%d' % (nr+1), group)
 



More information about the checkmk-commits mailing list