<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi List<br><br>I have a problem using check_nrpe:<br><br>The script on the remote machine is running this command: <br>                                                                                      #/bin/bash<br>                          
                                                              output=`sudo /usr/sbin/lsof -X |grep tomcat| wc -l`<br>                                                               &nbs
 p;                       max=$1<br>                                                                                       if [ "$output" -lt "$max" ]; then<br>                &nb
 sp;                                                                            echo "OK |value is "$output""<br>                                                   &nbsp
 ;                                         exit 0;<br>                                                                                       else<br>   &n
 bsp;                                                                                         echo "CRITICAL value is "$output""<br>                                     &nbsp
 ;                                                 exit 2;<br>                                                                                  &nbsp
 ;    fi<br><br><u>I have this line in sudoers file:</u><br><br>nagios   ALL=(ALL)       NOPASSWD: /usr/sbin/lsof<br><br><u>I have this in the nrpe.cfg:</u><br><br>command[check_lsof]=/usr/local/nagios/libexec/check_lsof.sh 256<br><br><br><u>When I run the command from the nagios user on the remote machine:</u><br><br>[nagios@serv_1]$ /usr/local/nagios/libexec/check_lsof.sh 256<br>OK |value is 132<br><br><u>When I run it from the Nagios server (remotely):</u><br>[root@healthy libexec]# ./check_nrpe -H 10.1.1.1 -c check_lsof<br>OK |value is 0<br><br><br>Ive set the user in /etc/xinetd.d/nrpe to "nagios", and all the other checks are working fine.<br><br>Any thoughts?<br><br><br><br><br>                                           </body>
</html>