How many clients are connected to specified port number
Question
How can I count all connections (clients) that are connected to the specified port on my (remote) server?
Lets say port number is gonna be: 3306
(MySQL port), so how to count how many clients are connected to this port during the same time?
Solution
Look, I know I'd do this in linux:
netstat -anp | grep ":3306.*ESTABLISHED" | wc -l
I expect it to work in FreeBSD as well.... let me know the result!
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow