Page 1 of 1

check_file_age is not working with check_nrpe

Posted: Wed Dec 02, 2020 5:27 am
by fsodah
I have problem when use the following:

from nagios server:
./check_nrpe -H <Host> -c check_file_age
the output is "NRPE: Command 'check_file_age' not defined"

while when executing the command from the host:
/usr/lib/nagios/plugins/check_file_age -w 21600 -c 21601 -f <file>

the output is "OK", which means that check_file_age is working fine on the host.

Re: check_file_age is not working with check_nrpe

Posted: Wed Dec 02, 2020 2:25 pm
by vtrac
Hi fsodah,
The command "check_file_age" must be defined on the <HOST> (nrpe) server for this to works.

Please add the following lines to "/usr/local/nagios/etc/nrpe/common.cfg":

Code: Select all

### CHECK FILE AGE ###
command[check_file_age]=/usr/local/nagios/libexec/check_file_age $ARG1$
While you have the configuration file open, make sure you have command arguments enabled:

Code: Select all

dont_blame_nrpe=1
Once added, please restart nrpe service:

Code: Select all

systemctl restart nrpe.service
You can test the command on your Nagios XI as:

Code: Select all

./check_nrpe -H <HOST> -c check_file_age -a '-w 21600 -c 21601 -f <FILENAME>'

Best Regards,
Vinh

Re: check_file_age is not working with check_nrpe

Posted: Thu Dec 03, 2020 4:48 am
by fsodah
after following your steps it worked fine.


tanks you.

Re: check_file_age is not working with check_nrpe

Posted: Thu Dec 03, 2020 9:07 am
by scottwilkerson
fsodah wrote:after following your steps it worked fine.


tanks you.
Great!

Locking thread