Module: check_mk
Branch: master
Commit: 081871de5fa1ddff9fba6a6948c5ca6477b8d790
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=081871de5fa1dd…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Jan 27 13:31:58 2015 +0100
logwatch.ec: fixed bug in logwatch reclassification
---
checks/logwatch | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/checks/logwatch b/checks/logwatch
index 5dd602f..f8d50b3 100644
--- a/checks/logwatch
+++ b/checks/logwatch
@@ -605,18 +605,20 @@ def check_logwatch_ec(item, params, info):
log_reclassify_patterns.extend(patterns)
for line in lines:
+ rclfd_level = None
if log_reclassify_patterns:
counts = {} # unused...
old_level, text = line.split(" ", 1)
level = logwatch_reclassify(counts, log_reclassify_patterns, line[2:]) or
old_level
if level != old_level:
rclfd_total += 1
+ rclfd_level = level
if level == "I": # Ignored lines are not forwarded
rclfd_to_ignore += 1
continue
- msg = '<%d>' % (facility + logwatch_to_prio(line[0]),)
+ msg = '<%d>' % (facility + logwatch_to_prio(rclfd_level or
line[0]),)
msg += '%s %s %s: %s' % (cur_time, g_hostname, logfile, line[2:])
messages.append(msg)
forwarded_logfiles.add(logfile)