[Nagios-users] NRPE

Ihab Samara ihab24 at hotmail.com
Tue Dec 7 16:09:45 UTC 2010


Hi List

I have a problem using check_nrpe:

The script on the remote machine is running this command: 
                                                                                      #/bin/bash
                                                                                       output=`sudo /usr/sbin/lsof -X |grep tomcat| wc -l`
                                                                                       max=$1
                                                                                       if [ "$output" -lt "$max" ]; then
                                                                                             echo "OK |value is "$output""
                                                                                             exit 0;
                                                                                       else
                                                                                             echo "CRITICAL value is "$output""
                                                                                       exit 2;
                                                                                       fi

I have this line in sudoers file:

nagios   ALL=(ALL)       NOPASSWD: /usr/sbin/lsof

I have this in the nrpe.cfg:

command[check_lsof]=/usr/local/nagios/libexec/check_lsof.sh 256


When I run the command from the nagios user on the remote machine:

[nagios at serv_1]$ /usr/local/nagios/libexec/check_lsof.sh 256
OK |value is 132

When I run it from the Nagios server (remotely):
[root at healthy libexec]# ./check_nrpe -H 10.1.1.1 -c check_lsof
OK |value is 0


Ive set the user in /etc/xinetd.d/nrpe to "nagios", and all the other checks are working fine.

Any thoughts?




 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nagios.com/pipermail/nagios-users/attachments/20101207/ff479a6c/attachment.html>


More information about the Nagios-users mailing list