http://fishcried.com/2015-06-17/ss_usage/
userparameter_tcp.conf
UserParameter=socket.tcp_listen,ss state all |grep "LISTEN" |wc -l
UserParameter=socket.tcp_synsent,ss state all |grep "SYN-SENT" |wc -l
UserParameter=socket.tcp_synrecv,ss state all |grep "SYN-RECV" |wc -l
UserParameter=socket.tcp_established,ss -s |awk '/estab/ {print $4}' |cut -d',' -f1
UserParameter=socket.tcp_finwait1,ss state all |grep "FIN-WAIT1" |wc -l
UserParameter=socket.tcp_finwait2,ss state all |grep "FIN-WAIT2" |wc -l
UserParameter=socket.tcp_closewait,ss state all |grep "CLOSE-WAIT"|wc -l
UserParameter=socket.tcp_closing,ss state all |grep "CLOSING" |wc -l
UserParameter=socket.tcp_lastack,ss state all |grep "LAST-ACK" |wc -l
UserParameter=socket.tcp_timewait,awk '/TCP:/ {print $7}' /proc/net/sockstat
#####
UserParameter=socket.total_sockets,awk '/sockets:/ {print $3}' /proc/net/sockstat
UserParameter=socket.tcp_inuse,awk '/TCP:/ {print $3}' /proc/net/sockstat
UserParameter=socket.tcp_orphan,awk '/TCP:/ {print $5}' /proc/net/sockstat
UserParameter=socket.tcp_alloc,awk '/TCP:/ {print $9}' /proc/net/sockstat
UserParameter=socket.tcp_mem,awk '/TCP:/ {print $11}' /proc/net/sockstat
UserParameter=socket.udp_inuse,awk '/UDP:/ {print $3}' /proc/net/sockstat
zabbix_agentd -t socket.tcp_established 测试