Skip to content

Instantly share code, notes, and snippets.

@justdoit0823
Last active August 11, 2020 06:43
Show Gist options
  • Save justdoit0823/a035aafdce0b9fda58822f16a54be655 to your computer and use it in GitHub Desktop.
Save justdoit0823/a035aafdce0b9fda58822f16a54be655 to your computer and use it in GitHub Desktop.
Show highest rtt within remote tcp server port from local.
# replace 10.73 with your own network and 15138 with port
ss -ti|grep -E '10.73.[[:digit:]]{2,3}.[[:digit:]]{2,3}:15138' -A 1|grep 'ESTAB' -A 1|grep -v -- --|awk '{if(index($0, "ESTAB")) {h = $5} if(index($0, "rtt")) {split($4, a, "rtt:"); split(a[2], b, "/"); if(b[1] > r[h]) {r[h] = b[1]}}} END {for(h in r) print h, r[h]}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment