Hi Andreas, thank you for the response.<div><br></div><div>I already have the suid bit activated in the check_procs binary as you can see here (I just copied the values of check_icmp)</div><div>-r-sr-sr-x</div><div><br></div>
<div>The user for this binary is root, and the group is nagios (just as check_icmp), but I still can't access the total process list.</div><div>In the command definition, should I make something like this?</div><div><br>
</div><div>command[check_total_procs]=/usr/local/nagios/libexec/sudo check_procs -w 150 -c 200</div><div><br></div><div><br></div><div>Thanks!</div><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/17/2012 03:47 PM, Axel Amigo Arnold wrote:<br>
> Hello, I am using nagios plugins 1.4.15 and I have a question about the<br>
> check_procs plugin.<br>
><br>
</div>> If I execute it as *root*:<br>
<div class="im">> root@localhost[/usr/local/nagios/libexec]# ./check_procs -w 50 -c 100<br>
> PROCS CRITICAL: 126 processes<br>
><br>
</div>> Now if I do it as *nagios user*:<br>
<div class="im">> nagios@localhost[/usr/local/nagios/libexec]# ./check_procs -w 50 -c 100<br>
> PROCS OK: 2 processes<br>
><br>
</div>> Obviously it gives me the result of doing *ps *as the selected user, and I<br>
<div class="im">> don't want this to happen like this.<br>
>> From the remote Nagios Server using NRPE, I also have the wrong result of 2<br>
> processes.<br>
> Is there a fix for this? May I have to write a script for myself?<br>
><br>
<br>
</div>The only fix is to run check_procs as root, or make the plugins suid<br>
root. Writing your own script won't work either, since it's the kernel<br>
blocking access to other users' processes.<br>
<span class="HOEnZb"><font color="#888888"><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>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Un saludo,<div><br></div><div>Axel Amigo Arnold</div><br>
</div></div>