Skip to content

Instantly share code, notes, and snippets.

@amuraru
Last active December 26, 2015 03:59
Show Gist options
  • Save amuraru/7089810 to your computer and use it in GitHub Desktop.
Save amuraru/7089810 to your computer and use it in GitHub Desktop.
Watch all connections from a load balancer to a pool of servers (check for connection persistence)
watch -n 0.02 "ss -nn state established '( sport >= :8081 and sport <= :8088 )' src `ifconfig | grep inet | sed 's/\s\+/:/g' |cut -f4 -d':' | head -1` dst 10.15.204.0/24 | sed 's/\s\+/ /g' | cut -f 3-6 -d' ' | sort -t ':' -k3 -n"
watch -n 2 "ss -nn state established '( sport = :80 )' src `ifconfig | grep inet | sed 's/\s\+/:/g' |cut -f4 -d':' | head -1` | sed 's/\s\+/ /g' | cut -f 3-6 -d' ' | sort -t ':' -k3 -n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment