Page 1 of 1
check_logfiles seems doesn't work
Posted: Wed Jul 27, 2016 11:20 am
by jask
Hi there!
I'm testing check_logfiles plugin and I have some problems.
I've created a file under /tmp directory called jask.tmp that only has "error" word.
monitor@monitor:/usr/local/nagios/libexec$ cat /tmp/jask.log
error
When I execute this command:
monitor@monitor:/usr/local/nagios/libexec$ ./check_logfiles --logfile /tmp/jask.log --criticalpattern 'error' --tag jask
I get:
OK - no errors or warnings|jask_lines=0 jask_warnings=0 jask_criticals=0 jask_unknowns=0
So, I don't know what I'm doing wrong.
Anybody can help me?
Thanks in advance!

Re: check_logfiles seems doesn't work
Posted: Wed Jul 27, 2016 1:49 pm
by rkennedy
The plugin will take into account how the file is the first time it sees it, then it will analyze new data inputted. If you add the word 'error' once again, on a new line, it should trigger as a critical -
Code: Select all
[root@localhost plugins-scripts]# ./check_logfiles --logfile='/tmp/blah' --criticalpattern='error' --tag=perf
OK - no errors or warnings|perf_lines=0 perf_warnings=0 perf_criticals=0 perf_unknowns=0
[root@localhost plugins-scripts]# nano /tmp/blah
[root@localhost plugins-scripts]# ./check_logfiles --logfile='/tmp/blah' --criticalpattern='error' --tag=perf
CRITICAL - (1 errors in check_logfiles.protocol-2016-07-27-13-47-38) - error |perf_lines=1 perf_warnings=0 perf_criticals=1 perf_unknowns=0
Re: check_logfiles seems doesn't work
Posted: Thu Jul 28, 2016 3:09 am
by jask
rkennedy wrote:The plugin will take into account how the file is the first time it sees it, then it will analyze new data inputted. If you add the word 'error' once again, on a new line, it should trigger as a critical -
Code: Select all
[root@localhost plugins-scripts]# ./check_logfiles --logfile='/tmp/blah' --criticalpattern='error' --tag=perf
OK - no errors or warnings|perf_lines=0 perf_warnings=0 perf_criticals=0 perf_unknowns=0
[root@localhost plugins-scripts]# nano /tmp/blah
[root@localhost plugins-scripts]# ./check_logfiles --logfile='/tmp/blah' --criticalpattern='error' --tag=perf
CRITICAL - (1 errors in check_logfiles.protocol-2016-07-27-13-47-38) - error |perf_lines=1 perf_warnings=0 perf_criticals=1 perf_unknowns=0
Thanks a lot !!! It worked !!

Re: check_logfiles seems doesn't work
Posted: Thu Jul 28, 2016 1:16 pm
by mcapra
Is it alright if we lock this thread and mark the issue as resolved?
Re: check_logfiles seems doesn't work
Posted: Thu Jul 28, 2016 2:52 pm
by jask
mcapra wrote:Is it alright if we lock this thread and mark the issue as resolved?
Yes, please !
Thanks a lot