Show connections per destination for a specific port
PORT=5432; netstat -an |grep ":${PORT} " | \
awk '{count[$5]++} END {for (host in count) print host, count[host]}'
To view the same over time:
PORT=5432; watch "netstat -an |grep \":${PORT} \" | \
awk '{count[\$5]++} END {for (host in count) print host, count[host]}'"
Comments
Post a Comment