Created
September 17, 2018 08:04
-
-
Save php-cpm/ba3a7177d242c3c8dd93101b1103c8ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
result=`/usr/sbin/ss -a |grep -v etlservicemgr|awk '{print $2":"$6}'|awk -F ":" '{print $1":"$3}'|sort|uniq -c|sort -nr|head -10` | |
date=`date "+%Y-%m-%d %H:%M:%S"` | |
count=0 | |
for i in $result | |
do | |
count=$count+1 | |
if((count%2==1)) | |
then | |
v=$i | |
else | |
echo $date" "$i" "$v | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this is a quick shell script to count on connections in this machine