Just a quick update on my pymmo project I started over on github. As I stated earlier this year I want to get deeper into Python and would be writing tools for MongoDB (and potentially other databases).

It doesn’t do a whole lot yet but I hope to make regular small improvements. Using the MongoDB shell for some stuff isn’t really ideal. I’m not keen on looking at large JSON documents to get little bits of information. This tool is an attempt to rectify some of that. I’m not 100% sure where I’m going with this project but I imagine it will be some type of DBA tool for MongoDB.

To list the help for the tool…

python mm.py --help

Output will look something like this…

usage: mm.py [-h] [--summary] [--repl]

MongoDB Manager

optional arguments:
  -h, --help show this help message and exit
  --summary Show a summary of the MongoDB Cluster Topology
  --repl Show a summary of the replicaset state

It’s still very simple so there’s only two options. It also currently uses a default connection on the localhost. More improvements will come.

We connect initially to a mongos server so if you’re using a standalone shard setup this tool won’t work for you.

We can display the structure of our cluster….

MongoDB Cluster Summary

We can also display the status of replication…

MongoDB Replication Status

That’s it for now! If you have any suggestions, for what you’d like to see in this tool, let me know in the comments.