Module: check_mk
Branch: master
Commit: aaa0acd5353296514b95b27cb60ff2e906cef10e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=aaa0acd5353296…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Apr 13 11:37:41 2012 +0200
Logwatch: Fixed handling when no patterns/rules are defined
---
checks/logwatch | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/checks/logwatch b/checks/logwatch
index 81a8d48..a0194a7 100644
--- a/checks/logwatch
+++ b/checks/logwatch
@@ -235,7 +235,10 @@ def check_logwatch(item, params, info):
(username(), e))
# Get the patterns (either compile or reuse the precompiled ones)
- if params:
+ # Check_MK creates an empty string if the precompile function has
+ # not been exectued yet. The precomile function creates an empty
+ # list when no rules/patterns are defined.
+ if params != '':
patterns = params # patterns already precompiled
else:
patterns = logwatch_precompile(g_hostname, item, None)