netstat -n
http://www.zsythink.net/archives/2062
netstat -n|awk '/^tcp/{++S[$NF]} END{for(a in S) print a, S[a]}' |grep CLOSE_WAIT