Skip to content

Instantly share code, notes, and snippets.

@niedbalski
Created December 6, 2019 14:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save niedbalski/30bcd19cdd1cddecf7c1b15802e792a8 to your computer and use it in GitHub Desktop.
monitor-mongorestore.sh
#!/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