execute check_logfiles

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gselvakumar
Posts: 96
Joined: Wed Mar 02, 2016 4:52 am

execute check_logfiles

Post 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.
Thanks & Regards,
Gomathyshankar Selvakumar
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: execute check_logfiles

Post 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?
Former Nagios Employee
gselvakumar
Posts: 96
Joined: Wed Mar 02, 2016 4:52 am

Re: execute check_logfiles

Post 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 
Thanks & Regards,
Gomathyshankar Selvakumar
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: execute check_logfiles

Post by avandemore »

Perfect! I'm closing this thread since you have resolved your issue. Thanks for being part of the Nagios Community.
Previous Nagios employee
Locked