Thanks for reply ,<br><br>I am able to run command as nagios and its returning right value 120 to me  <br><br>----------------------------------------------------------------------------------------------------------<br>[nagios@monitor ~]$  /usr/bin/sudo /sbin/iptables -vL|/bin/grep ':ssh'|/bin/awk '{print $1}'<br>
120<br>----------------------<br><br><br><div class="gmail_quote">On Fri, Jul 20, 2012 at 5:33 PM, Voigt, Thomas <span dir="ltr"><<a href="mailto:Thomas.Voigt@netkom.de" target="_blank">Thomas.Voigt@netkom.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
is your nagios user allowed to run the sudo command from the first line in your script?<br>
<br>
Please login as <your nagios user> and execute the command<br>
<div class="im"><br>
/usr/bin/sudo /sbin/iptables -vL|/bin/grep ':ssh'|/bin/awk '{print $1}'<br>
<br>
</div>directly. Do you see any output?<br>
<br>
--<br>
Regards<br>
<span class="HOEnZb"><font color="#888888"><br>
Thomas Voigt<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
------------------------------------------------------------------------------<br>
Live Security Virtual Conference<br>
Exclusive live event will cover all the ways today's security and<br>
threat landscape has changed and how IT managers can respond. Discussions<br>
will include endpoint security, mobile security and the latest in malware<br>
threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a><br>
_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><a href="http://linuxmantra.com">http://linuxmantra.com</a><br>