check_logfiles
check_logfiles copied to clipboard
Check Alerts problems
Hello and thanks for this awesome work !
Maybe im a ***ing noob and this is just because i don't know how it works but i have a problem with nagios alerts.
The first launch, all is ok : I have my logs errors and im happy ! The second check : It say, no errors .. like a reset (rotation, seekfile ?) but my log file is always full of errors !?
Hi,
someone blogged about check_logfiles in France? Ten minutes after your mail i got the same question from another french guy When you run check_logfiles, it looks where it sopped last time (end-of-file last time) and then reads from this position tot he new end-of-file. Then it saves the end-of-file position again in a so-called seek-file (in /var/tmp/check_logfiles or $OMD_ROOT/var/tmp/check_logfiles if you use OMD). This way, check_logfiles scans only the lines which were appended tot he logfile since the last run. You cannot repeat this by subsequently calling check_logfiles. In the service-definition you write:
max_check_attempts 1 is_volatile 1 check_period 5
Now you get an alert whenever in the last 5 minutes there was an error message.
Gerhard
Also note that you can use options => 'sticky=3600'
to keep the alert for 1 hour.