DevOps by Default Blog

Finding number of connections from hosts using netstat

Perhaps you’re trying to find out where all your incoming connections are coming from to a server. If for example, it’s a MySQL database then you may be interested in connections on TCP port 3306.

netstat -n | grep :3306 | awk '{ print $5 }' | cut -d':' -f1 | sort -n | uniq -c

Comments