Page 1 of 1

execute check_logfiles

Posted: Wed Sep 28, 2016 4:32 am
by gselvakumar
While trying to execute check_logfiles in command line we get the following error ,

Code: Select all

/usr/local/nagios/libexec/check_logfiles-2.3.1.2/plugins-scripts/check_logfiles --logfile=/tmp/messages  --criticalpattern='FAIL|CRITICAL'
Can't use string ("0") as an ARRAY ref while "strict refs" in use at /usr/local/nagios/libexec/check_logfiles-2.3.1.2/plugins-scripts/check_logfiles line 1568. 
Could you please advise of the issue. Thank you.

Re: execute check_logfiles

Posted: Wed Sep 28, 2016 10:09 am
by rkennedy
Perhaps it's worth updating to a newer version? I just tested this on my end and it worked without issues. I'm using 3.7.4.2 though.

Code: Select all

[root@localhost libexec]# wget https://labs.consol.de/assets/downloads/nagios/check_logfiles-3.7.4.2.tar.gz
[root@localhost libexec]# tar zxf check_logfiles-3.7.4.2.tar.gz
[root@localhost libexec]# cd check_logfiles-3.7.4.2
[root@localhost check_logfiles-3.7.4.2]# ./configure
[root@localhost check_logfiles-3.7.4.2]# ./make
[root@localhost check_logfiles-3.7.4.2]# ./make install
[root@localhost check_logfiles-3.7.4.2]# cd plugins-scripts/
[root@localhost plugins-scripts]# ./check_logfiles --logfile=/var/log/messages --criticalpattern='FAIL|CRITICAL'
OK - no errors or warnings|default_lines=0 default_warnings=0 default_criticals=0 default_unknowns=0
[root@localhost plugins-scripts]# ./check_logfiles --logfile=/tmp/messages --criticalpattern='FAIL|CRITICAL'
UNKNOWN - (1 unknown in check_logfiles.protocol-2016-09-28-11-07-05) - could not find logfile /tmp/messages |default_lines=0 default_warnings=0 default_criticals=0 default_unknowns=1
Could you try this, and let us know if that works for you?

Re: execute check_logfiles

Posted: Thu Sep 29, 2016 4:06 am
by gselvakumar
Hi rkennedy,

Thank you so much for the update. The new version of plugin works. We are able to see the required output.

Code: Select all

 ./check_logfiles --logfile=/tmp/messages --criticalpattern='FAIL|CRITICAL'
CRITICAL - (1 errors in check_logfiles.protocol-2016-09-29-04-03-04) - FAIL |default_lines=3 default_warnings=0 default_criticals=1 default_unknowns=0 

Re: execute check_logfiles

Posted: Thu Sep 29, 2016 12:07 pm
by avandemore
Perfect! I'm closing this thread since you have resolved your issue. Thanks for being part of the Nagios Community.