List and Count HTTP Connections

On October 20, 2009, in Apache, Bash, LightHTTPd, Linux, Mac, Unix, nginx, by Code Monk

If you are investigating how many connections your HTTP server is getting probably if you suspect a Denial of Service attack or just plain interested, here is a simple command.

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

It can be interchanged with any other services i.e. SMTP, just change :80 to :25.

Tagged with:  

Leave a Reply