Created
June 20, 2012 16:14
-
-
Save dolinsky/2960726 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
# Print summary of hostnames mongod has open connections to | |
sudo lsof | grep TCP | grep mongod | awk ' | |
BEGIN {} | |
{ | |
split($9,p,":"); | |
conn = p[1] p[2]; | |
conns[conn]++; | |
} | |
END { for (c in conns) { | |
printf "%s\t%d\n", c, conns[c] | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment