check_logfiles seems doesn't work

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
jask
Posts: 3
Joined: Wed Jul 27, 2016 11:08 am

check_logfiles seems doesn't work

Post 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! :mrgreen: :mrgreen:
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_logfiles seems doesn't work

Post 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
Former Nagios Employee
jask
Posts: 3
Joined: Wed Jul 27, 2016 11:08 am

Re: check_logfiles seems doesn't work

Post 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 !! :D :D :D :D
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_logfiles seems doesn't work

Post by mcapra »

Is it alright if we lock this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
jask
Posts: 3
Joined: Wed Jul 27, 2016 11:08 am

Re: check_logfiles seems doesn't work

Post by jask »

mcapra wrote:Is it alright if we lock this thread and mark the issue as resolved?
Yes, please !

Thanks a lot
Locked