I finally got it working but it was not that easy. As I am using CentOS 5, by default the requiretty value in the /etc/sudoers file is activated, so I had to edit it like this:<div><div>#Defaults    requiretty</div><div>nagios ALL=(ALL) NOPASSWD:/usr/local/nagios/libexec/check_procs</div>
</div><div><br></div><div>And the command in the .cfg file would be like this:</div><div>command[check_total_procs]=sudo /usr/local/nagios/libexec/check_procs -w 150 -c 200</div><div><br></div><div>Hope it helps!!</div><div>
<br><div class="gmail_quote">2012/6/18 Andreas Ericsson <span dir="ltr"><<a href="mailto:ae@op5.se" target="_blank">ae@op5.se</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 06/18/2012 11:51 AM, Axel Amigo Arnold wrote:<br>
> Hi Andreas, thank you for the response.<br>
><br>
> I already have the suid bit activated in the check_procs binary as you can<br>
> see here (I just copied the values of check_icmp)<br>
> -r-sr-sr-x<br>
><br>
> The user for this binary is root, and the group is nagios (just as<br>
> check_icmp), but I still can't access the total process list.<br>
> In the command definition, should I make something like this?<br>
><br>
> command[check_total_procs]=/usr/local/nagios/libexec/sudo check_procs -w<br>
> 150 -c 200<br>
><br>
<br>
</div>That might help. Try and find out.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Andreas Ericsson                   <a href="mailto:andreas.ericsson@op5.se">andreas.ericsson@op5.se</a><br>
OP5 AB                             <a href="http://www.op5.se" target="_blank">www.op5.se</a><br>
Tel: <a href="tel:%2B46%208-230225" value="+468230225">+46 8-230225</a>                  Fax: <a href="tel:%2B46%208-230231" value="+468230231">+46 8-230231</a><br>
<br>
Considering the successes of the wars on alcohol, poverty, drugs and<br>
terror, I think we should give some serious thought to declaring war<br>
on peace.<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Un saludo,<div><br></div><div>Axel Amigo Arnold</div><br>
</div>