Module: check_mk
Branch: master
Commit: 027a2f4662e180bc31526250549b0756992007cb
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=027a2f4662e180…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Jun 12 11:37:42 2013 +0200
mk_logwatch: fixed bug when rewriting logwatch messages
---
ChangeLog | 3 ++-
agents/plugins/mk_logwatch | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index cf5e825..7b72d7d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,7 +12,8 @@
* logwatch: Logwatch icon no longer uses notes_url
Checks & Agents:
- esx_hostystem multipath: criticize standby paths only if not equal to active paths
+ * esx_hostystem multipath: criticize standby paths only if not equal to active paths
+ * mk_logwatch: fixed bug when rewriting logwatch messages
WATO:
* Allow to configure check-/retry_interval in second precision
diff --git a/agents/plugins/mk_logwatch b/agents/plugins/mk_logwatch
index 46dce99..6823df4 100755
--- a/agents/plugins/mk_logwatch
+++ b/agents/plugins/mk_logwatch
@@ -225,12 +225,12 @@ def process_logfile(logfile, patterns):
level = "."
log_line = line[:-1]
for lev, pattern, replace in patterns:
- if pattern.search(line[:-1]):
+ matches = pattern.search(log_line)
+ if matches:
level = lev
levelint = {'C': 2, 'W': 1, 'O': 0, 'I':
-1, '.': -1}[lev]
worst = max(levelint, worst)
if replace:
- matches = pattern.match(log_line)
replace_count = 1
new_message = replace.replace('\\0', log_line)
for replacement in matches.groups():