Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a working Nagios setup where I e.g. monitor disk usage through the NRPE daemon without parsing arguments through NRPE for security reasons. So I know that NRPE works.

Now I would like to check NFS using the check_mountpoints plugin, but I get

NRPE: Unable to read output 

On Nagios Monitor host I have set

define command {
  command_name check_mountpoints
  command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c check_mountpoints 
}

define service {
  use                     generic-service
  name                    check_mountpoints
  host_name               example.com
  service_description     Check_mountpoints for nfs cifs davfs
  check_command           check_nrpe!check_mountpoints
  contact_groups          linux-admins
}

On the remote host have I set

command[check_mountpoints]=/usr/lib/nagios/plugins/check_mountpoints.sh /nas1/home

To verify that the correct arguments have been given the command outputs this

[root@nas ~]# /usr/lib/nagios/plugins/check_mountpoints.sh /nas1/home
OK: all mounts were found ( /nas1/home)
[root@nas ~]# 

And both Nagios monitor host and remote host have a working NRPE daemon running.

Question

How do I debug something like this?

share|improve this question
1  
Did you try to run the same script with nagios user? I can see that you are running it as root in the working example above. –  Khaled May 9 '12 at 9:08
    
Very nicely spotted. That was the problem. The permissions of check_mountpoints.sh were 750, which had to be 755. –  Sandra May 9 '12 at 9:13

1 Answer 1

up vote 2 down vote accepted

From my experience, this error is caused by missing permissions. You tried to execute the nrpe client script as root. Try to execute it as the user the nrpe daemon is running as. This should give you an hint towards the cause. If this does not help, try to run

strace usr/lib/nagios/plugins/check_mountpoints.sh /nas1/home

as the nrpe user.

share|improve this answer
    
You are a genius! The permissions of check_mountpoints.sh had to be changed to 755. Doing that solved the problem =) –  Sandra May 9 '12 at 9:11
    
I'm glad that i can help you. Since the problem is resolved, please accept the answer. –  Johann May 9 '12 at 9:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.