Module: check_mk
Branch: master
Commit: ad579795f0e941004dbff046ea74f033af521d1d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ad579795f0e941…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Apr 30 10:39:21 2013 +0200
logwatch, logwatch.ec: detect error in agent configuration
---
ChangeLog | 1 +
checks/logwatch | 10 ++++++++++
2 files changed, 11 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 24fa977..2d54ece 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -79,6 +79,7 @@
new global config option: timeout_plugins_total
* lnx_if in Linux agent: force deterministical order of network devices
* Linux agent: remove obsolete old <<<netif>>> and
<<<netctr>>> sections
+ * logwatch, logwatch.ec: detect error in agent configuration
Notifications:
* notify.py: unique spoolfiles name no longer created with uuid
diff --git a/checks/logwatch b/checks/logwatch
index 897cace..1669bf2 100644
--- a/checks/logwatch
+++ b/checks/logwatch
@@ -202,6 +202,11 @@ def logwatch_parse_line(line):
# without precompiled checks, the params must be None an will be
# ignored.
def check_logwatch(item, params, info):
+ if len(info) == 1:
+ line = " ".join(info[0])
+ if line.startswith("CANNOT READ CONFIG FILE"):
+ return 3, "Error in agent configuration: %s" % "
".join(info[0][4:])
+
found = False
loglines = []
for l in info:
@@ -430,6 +435,11 @@ def syslog_time():
return value % day
def check_logwatch_ec(item, params, info):
+ if len(info) == 1:
+ line = " ".join(info[0])
+ if line.startswith("CANNOT READ CONFIG FILE"):
+ return 3, "Error in agent configuration: %s" % "
".join(info[0][4:])
+
# 1. Parse lines in info and separate by logfile
logs = {}
logfile = None