Sudo issue on Centos Red Hat ES 4

Hello,

I’m trying to run check_nfs on a remote host using check_nrpe and sudo but when I run the command (check_nrpe -H 196.x.x.x -c check_nfs) I get a “NRPE: Unable to read output” error message. When I login to the server as nagios and run sudo /usr/local/nagios/libexec/check_nfsmounts it works fine.

I have setup /etc/sudoers as follows:

nagios ALL=(ALL) NOPASSWD: /usr/local/nagios/libexec/check_nfsmount

and /etc/nrpe.cfg:

#Check Nfs
command[check_nfs]=sudo /usr/local/nagios/libexec/check_nfsmount

I’ve checked /var/log/debug and I found the following error:

Jan 12 12:48:38 sabccmsapp1 sudo(pam_unix)[12630]: authentication failure; logname= uid=0 euid=0 tty= ruser= rhost= user=nagios

Does anyone have any ideas on why this is happening?

Thanks
Rudi

Try running sudoers and commenting out requiretty if it hasn’t already been…

Might fix it.

HTH

/S

Thanks for the suggestion, unfortunetyly I don’t have requiretty in my /etc/sudoers file :frowning: