Hi Members,

I wrote below script to monitor ssh traffic

+++++++++++++++++++++++++++++++++++++++++++
a=$(/usr/bin/sudo /sbin/iptables -vL|/bin/grep ':ssh'|/bin/awk '{print $1}')
if [ $a -gt 3 ]; then
echo "SSH aatempt is TOO High | $a"
exit 2
else
if [ $a -gt 2 ]; then
echo "SSH aatempt is Average | $a"
exit 1
else
echo "No SSH attempts | $a"
exit 0
fi
fi
exit 3
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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".

What I can notice that variable a not holding any value while running via
nagios , while its working fine when running via shell.

Can you please drive me in right direction ?


Thanks
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

Reply via email to