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.
jask
Posts: 3 Joined: Wed Jul 27, 2016 11:08 am
Post
by jask » Wed Jul 27, 2016 11:20 am
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!
rkennedy
Posts: 6579 Joined: Mon Oct 05, 2015 11:45 am
Post
by rkennedy » Wed Jul 27, 2016 1:49 pm
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
Post
by jask » Thu Jul 28, 2016 3:09 am
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 !!
mcapra
Posts: 3739 Joined: Thu May 05, 2016 3:54 pm
Post
by mcapra » Thu Jul 28, 2016 1:16 pm
Is it alright if we lock this thread and mark the issue as resolved?
jask
Posts: 3 Joined: Wed Jul 27, 2016 11:08 am
Post
by jask » Thu Jul 28, 2016 2:52 pm
mcapra wrote: Is it alright if we lock this thread and mark the issue as resolved?
Yes, please !
Thanks a lot