Created
December 6, 2019 14:25
-
-
Save niedbalski/30bcd19cdd1cddecf7c1b15802e792a8 to your computer and use it in GitHub Desktop.
monitor-mongorestore.sh
This file contains hidden or 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
| #!/bin/bash | |
| dbpass=$(grep statepassword /var/lib/juju/agents/machine-*/agent.conf | cut -d' ' -f2) | |
| while true; do mongo 127.0.0.1:37017/juju -u "machine-0" -p "$dbpass" --sslAllowInvalidCertificates --ssl --authenticationDatabase admin --eval "printjson(db.stats())" | grep -Ei '(datasize|storage|objects)' && sleep 1;done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment