Page 1 of 1

check_file_age NRPE: Unable to read output

Posted: Thu Feb 06, 2014 12:55 am
by sandeepvreddy
Hi,

I am trying to get file age with check_file_age plugin.

When I ran check_file_age command getting correct output, I used following command:

Code: Select all

/usr/lib/nagios/plugins/check_file_age -f /tmp/test -w 100 -c 200 
Output:
FILE_AGE CRITICAL: /tmp/test is 1673 seconds old and 10 bytes

I added same above command in nrpe_local.cfg & following is line in my nrpe_local.cfg

Code: Select all

command[age]=/usr/lib/nagios/plugins/check_file_age -f /tmp/test -w 100 -c 200
After adding above command I restarted nrpe daemon with command "service nagios-nrpe-server restart"

Now If I run above command using check_nrpe, the output is "NRPE: Unable to read output"

I used following command:

Code: Select all

/usr/lib/nagios/plugins/check_nrpe -H localhost -c age
Output:
NRPE: Unable to read output

From past 2 days I am trying to debug this issue, but unable to get any clue.
Someone please help me to resolve this issue.

Thanks,
Sandeep.

Re: check_file_age NRPE: Unable to read output

Posted: Thu Feb 06, 2014 10:49 am
by abrist
Sandeep,
Lets first make sure that you can communicate through nrpe:

Code: Select all

/usr/lib/nagios/plugins/check_nrpe -H localhost
If that works, then lets try to run the plugin as user "nagios":

Code: Select all

su nagios
/usr/lib/nagios/plugins/check_file_age -f /tmp/test -w 100 -c 200 
Could you post a copy of the remote host's nrpe.cfg that you are working with?

Re: check_file_age NRPE: Unable to read output

Posted: Tue Feb 11, 2014 4:45 am
by sandeepvreddy
This issue is due to file permissions of user.

For my user home directory file permissions are set to 700, I changed it to 755 with chmod.

After changing file permissions its working without any issue.

Re: check_file_age NRPE: Unable to read output

Posted: Tue Feb 11, 2014 9:52 am
by tmcdonald
Great to hear. Can this topic be closed now?