[Check_mk (english)] Logwatch question

Hi list,

At our company we’re trying to implement monitoring of application log files using check_mk logwatch extention. However, we’re stuck because of the manner of log file rotation.

Every log file is named according to the pattern -.log, e.g. error-20141106.log. I tried setting logwatch up like this:

/path/to/error-*.log

C Error: (.*)

Upon inventory, this resulted in three logfiles being added (files are gzipped after that). However, what we’d like is to monitor only today’s log file. Is there a possibility in logwatch to achieve this?

I have an idea of how this could be achieved, but this would require a change to logwatch. The idea is to set it up in logwatch configuration like this:

/path/to/error-date +%Y%m%d.log service_name=error.log

C Error: (.*)

The service in Nagios would then be named ‘LOG error.log’ and the logwatch plugin would evaluate the filename upon executing the check.

Met vriendelijke groet / Best regards,

Paul Bongers

Application Engineer

E-mail: paul.bongers@osudio.com

Web: http://www.osudio.com

image001.png

Hi Paul,

I’d implement a cronjob, running at midnight (or “after new error-log has been placed”), symlinking something like “error.log” to the new logfile.

CMK can then be configured to watch “error.log” insteda of the specific file.

HTH,

Marcel

image001.png

image001.png

···

Paul Bongers Paul.Bongers@osudio.com schrieb am Thu Nov 06 2014 at 10:41:52:

Hi list,

At our company we’re trying to implement monitoring of application log files using check_mk logwatch extention. However, we’re stuck because of the manner of log file rotation.

Every log file is named according to the pattern -.log, e.g. error-20141106.log. I tried setting logwatch up like this:

/path/to/error-*.log

C Error: (.*)

Upon inventory, this resulted in three logfiles being added (files are gzipped after that). However, what we’d like is to monitor only today’s log file. Is there a possibility in logwatch to achieve this?

I have an idea of how this could be achieved, but this would require a change to logwatch. The idea is to set it up in logwatch configuration like this:

/path/to/error-date +%Y%m%d.log service_name=error.log

C Error: (.*)

The service in Nagios would then be named ‘LOG error.log’ and the logwatch plugin would evaluate the filename upon executing the check.

Met vriendelijke groet / Best regards,

Paul Bongers

Application Engineer

E-mail: paul.bongers@osudio.com

Web: http://www.osudio.com


checkmk-en mailing list

checkmk-en@lists.mathias-kettner.de

http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en