Module: check_mk
Branch: master
Commit: 06197fe358a79210c8ee9bbc73d817b3e50f7c66
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=06197fe358a792…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Mar 11 10:12:33 2015 +0100
Logwatch option maxfilesize now produces periodic errors
Every time that the files has again grown, a new message will be output
---
agents/plugins/mk_logwatch | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/agents/plugins/mk_logwatch b/agents/plugins/mk_logwatch
index ff77b5a..bf6f745 100755
--- a/agents/plugins/mk_logwatch
+++ b/agents/plugins/mk_logwatch
@@ -312,8 +312,9 @@ def process_logfile(logfile, patterns):
sys.stdout.flush()
# Handle option maxfilesize, regardless of warning or errors that have happened
- if opt_maxfilesize != None and offset <= opt_maxfilesize and new_offset >
opt_maxfilesize:
- sys.stdout.write("%sW Maximum allowed logfile size (%d bytes)
exceeded.%s\n" % (tty_yellow, opt_maxfilesize, tty_normal))
+ if opt_maxfilesize != None and (offset / opt_maxfilesize) < (new_offset /
opt_maxfilesize):
+ sys.stdout.write("%sW Maximum allowed logfile size (%d bytes) exceeded for
the %dth time.%s\n" %
+ (tty_yellow, opt_maxfilesize, new_offset / opt_maxfilesize,
tty_normal))
try: