check_log

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
pccwglobalit
Posts: 105
Joined: Wed Mar 11, 2015 9:00 pm

check_log

Post by pccwglobalit »

we need to check string in /var/log/secure e.g. Invalid and Failed etc.
i have added the below to /etc/sudoers.d/11-nagios

Defaults:nagios !requiretty
nagios ALL=NOPASSWD: /usr/local/nagios/libexec/check_log

and then i add nrpe cfg in /usr/local/nagios/etc/nrpe/log.cfg
command[check_syslog]=sudo /usr/local/nagios/libexec/check_log -F /var/log/secure -O /tmp/invalid -q Invalid

i then restarted xinetd.

after that, when i check the log using nrpe, it gave the following
/usr/local/nagios/libexec/check_nrpe -H 192.168.88.2 -c check_syslog
(1) < May 24 09:10:01 nls sudo: nagios : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/nagios/libexec/check_log -F /var/log/secure -O /tmp/invalid -q Invalid

The log will have some wording e.g. Failed, Invalid but seems it will not check and prompt.

please help to see what i am missing.
thanks
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_log

Post by rkennedy »

From the remote machine, can you execute sudo /usr/local/nagios/libexec/check_log -F /var/log/secure -O /tmp/invalid -q Invalid as the nagios user and post the full input / output?
Former Nagios Employee
pccwglobalit
Posts: 105
Joined: Wed Mar 11, 2015 9:00 pm

Re: check_log

Post by pccwglobalit »

it will be same result as local.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_log

Post by rkennedy »

Does it execute properly though? I'd like to see the full output returned, because usually something like this is related to permissions.
Former Nagios Employee
Locked