http://fishcried.com/2015-06-17/ss_usage/
userparameter_tcp.conf
UserParameter=socket.tcp_listen,ss state all |grep "\bLISTEN\b" |wc -l
UserParameter=socket.tcp_synsent,ss state all |grep "\bSYN-SENT\b" |wc -l
UserParameter=socket.tcp_synrecv,ss state all |grep "\bSYN-RECV\b" |wc -l
UserParameter=socket.tcp_established,ss -s |awk '/estab/ {print $4}' |cut -d',' -f1
UserParameter=socket.tcp_finwait1,ss state all |grep "\bFIN-WAIT1\b" |wc -l
UserParameter=socket.tcp_finwait2,ss state all |grep "\bFIN-WAIT2\b" |wc -l
UserParameter=socket.tcp_closewait,ss state all |grep "\bCLOSE-WAIT\b"|wc -l
UserParameter=socket.tcp_closing,ss state all |grep "\bCLOSING\b" |wc -l
UserParameter=socket.tcp_lastack,ss state all |grep "\bLAST-ACK\b" |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 测试