Here are some handy one liners that will allow you to check the number of connections to a port:
#check port 25
netstat -an | grep “:25 “| grep ESTABLISHED | awk ‘{print $4″t”$5}’ | sort -n -k1
#check port 80
netstat -an | grep “:80 “| grep ESTABLISHED | awk ‘{print $4″t”$5}’ | sort -n -k1
#check port 110
netstat -an | grep “:110 “| grep ESTABLISHED | awk ‘{print $4″t”$5}’ | sort -n -k1
#check port 587
netstat -an | grep “:587 “| grep ESTABLISHED | awk ‘{print $4″t”$5}’ | sort -n -k1
Here’s another great command that checks for the number of times an IP is connected to the server:
netstat -an|awk ‘{print $5}’|cut -d “:” -f1|sort|uniq -c|sort -n