Skip to content

Instantly share code, notes, and snippets.

@a5ync
Created December 20, 2018 00:31
Show Gist options
  • Select an option

  • Save a5ync/f01c3f7970c614a4ffccaf9d34cf4f1a to your computer and use it in GitHub Desktop.

Select an option

Save a5ync/f01c3f7970c614a4ffccaf9d34cf4f1a to your computer and use it in GitHub Desktop.
Lists connections (ESTABLISHED) between containers and mysql instance
docker ps -q -f name=utmsp_backend | xargs docker inspect -f '{{.State.Pid}}' | xargs -i nsenter -t {} -n netstat|grep :mysql|grep ESTABLISHED| cut -d ":" -f1|awk '{print $4}'|uniq -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment