check_file_age is not working with check_nrpe

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
fsodah
Posts: 295
Joined: Thu Sep 12, 2019 1:19 am

check_file_age is not working with check_nrpe

Post 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.
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: check_file_age is not working with check_nrpe

Post 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
fsodah
Posts: 295
Joined: Thu Sep 12, 2019 1:19 am

Re: check_file_age is not working with check_nrpe

Post by fsodah »

after following your steps it worked fine.


tanks you.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_file_age is not working with check_nrpe

Post by scottwilkerson »

fsodah wrote:after following your steps it worked fine.


tanks you.
Great!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked