Hi Members,<br><br>I wrote below script to monitor ssh traffic <br><br>+++++++++++++++++++++++++++++++++++++++++++<br>a=$(/usr/bin/sudo /sbin/iptables -vL|/bin/grep ':ssh'|/bin/awk '{print $1}')<br>if [ $a -gt 3 ]; then<br>
echo "SSH aatempt is TOO High | $a"<br>exit 2<br>else<br>if [ $a -gt 2 ]; then<br>echo "SSH aatempt is Average | $a"<br>exit 1<br>else<br>echo "No SSH attempts | $a"<br>exit 0<br>fi<br>fi<br>
exit 3<br>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br><br>This script is working fine on shell and returning "SSH attempt is too high" . But when i run it via nagios the output returned OK and print "No SSH attempts".<br>
<br>What I can notice that variable a not holding any value while running via nagios , while its working fine when running via shell.<br><br>Can you please drive me in right direction ?<br><br><br>Thanks<br>