mirror of
https://github.com/aljazceru/zabbix.git
synced 2025-12-17 10:44:21 +01:00
tcpstats
This commit is contained in:
@@ -15,7 +15,7 @@ if [ -f ${CACHE} ]; then
|
||||
fi
|
||||
|
||||
if [ ! -f ${CACHE} ]; then
|
||||
ss -ant | awk '{++stats[$1]} END {for(a in stats) print a, stats[a]}' > ${CACHE}
|
||||
ss -ant | awk 'BEGIN {stats["CLOSE-WAIT"]=0;stats["ESTAB"]=0;stats["FIN-WAIT-1"]=0;stats["FIN-WAIT-2"]=0;stats["LAST-ACK"]=0;stats["SYN-RECV"]=0;stats["SYN-SENT"]=0;stats["TIME-WAIT"]=0} {++stats[$1]} END {for(a in stats) print a, stats[a]}' > ${CACHE}
|
||||
fi
|
||||
|
||||
grep $1 ${CACHE} | cut -d " " -f2
|
||||
Reference in New Issue
Block a user