Module: check_mk
Branch: master
Commit: 64718f91b5fa3f3e30188e819a671250e311e199
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=64718f91b5fa3f…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Tue Apr 10 15:42:57 2018 +0200
5713 FIX mk_logwatch: Fix message rewriting and continuation patterns
Thanks to Martin Adamiak for the patch!
Change-Id: I7e014b4b8ac847cf6f30471b74e9dd5101f8d886
---
.werks/5713 | 11 +++++++++++
agents/plugins/mk_logwatch | 5 +++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/5713 b/.werks/5713
new file mode 100644
index 0000000..d04cc26
--- /dev/null
+++ b/.werks/5713
@@ -0,0 +1,11 @@
+Title: mk_logwatch: Fix message rewriting and continuation patterns
+Level: 2
+Component: checks
+Class: fix
+Compatible: comp
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1523367537
+
+Thanks to Martin Adamiak for the patch!
diff --git a/agents/plugins/mk_logwatch b/agents/plugins/mk_logwatch
index 15f9e73..47508c9 100755
--- a/agents/plugins/mk_logwatch
+++ b/agents/plugins/mk_logwatch
@@ -201,8 +201,6 @@ def read_config():
raise Exception("Missing logfile names")
level, pattern = line.split(None, 1)
- cont_list = [] # List of continuation patterns
- rewrite_list = [] # List of rewrite patterns
if level == 'A':
cont_list.append(parse_cont_pattern(pattern))
@@ -210,12 +208,15 @@ def read_config():
rewrite_list.append(pattern)
else:
level, compiled = parse_pattern(level, pattern, line)
+ # New pattern for line matching => clear continuation and rewrite
patterns
cont_list = []
rewrite_list = []
patterns.append((level, compiled, cont_list, rewrite_list))
else: # filename line
patterns = []
+ cont_list = [] # Clear list of continuation patterns from last file
+ rewrite_list = [] # Same for rewrite patterns
config.append((parse_filenames(line), patterns))
have_filenames = True
return config