check_file_age NRPE: Unable to read output

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
sandeepvreddy
Posts: 3
Joined: Tue Dec 27, 2011 7:39 am

check_file_age NRPE: Unable to read output

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_file_age NRPE: Unable to read output

Post 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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
sandeepvreddy
Posts: 3
Joined: Tue Dec 27, 2011 7:39 am

Re: check_file_age NRPE: Unable to read output

Post 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.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_file_age NRPE: Unable to read output

Post by tmcdonald »

Great to hear. Can this topic be closed now?
Former Nagios employee
Locked