Search All Sites
Nagios Live WebinarsLet our experts show you how Nagios can help your organization.
Don't miss your chance to attend the 2014 Nagios World Conference, Oct 13-16th. Informative Sessions, Networking, Food and Cocktails! Visit go.nagios.com/conference/ for more information or to register.
check_logfiles is used to scan the lines of a file for regular expressions.
It normally scans only the lines of a logfile which were added since the last run of the plugin.
The main features are:
- multiple regular expressions can be given
- expressions can be categorized as warning or critical
- it can handle any logfile rotation strategy
- hook scripts (either external scripts or a piece of perl-code in the configuration file) are possible, taking actions when a line matches a pattern. (for example, whenever a critical pattern is found, a nsca message is sent to the nagios server)
- it is written in Perl, but also distributed as a Windows .exe
any errors or warnings as in principle check_logfiles scans a log file until the end-of-file is reached. The offset will then be saved in a so-called seekfile. The next time check_logfiles runs this offset will be used as the starting position inside the log file.
I found this to be a bug as I believe until the log file gets updated or appended, the alert shouldn't disappear. But in reality it only sends an alert once and the next time it shows "OK - no errors".
Liked it though and we're using it with cron and a wrapper script to send alerts.