Introducing Open Source MongoDB Monitoring Library

mongodbMonitoring In a previous Monitoring Performance on MongoDB – Mongo Basics article we went over some basics about Mongo and monitoring Mongo performance.  In this article we are going to examine some interesting services, that can help with our Mongo monitoring.

Basically, we have two sets of statistics we would like to collect from our Mongo instances.  First, the basic computer stats that you need to collect for any machine in your fleet, and second we want to collect all these great DB stats from the Mongo HTTP Console.

We want to collect all these statistics, but we also need somewhere to store and view them.  That’s where Monitis comes into play!

Monitis is a slick monitoring as a service offering that can help monitor almost anything, and is aptly suited for helping out with our Mongo databases and clusters.  To get started download the Monitis Mongo code onto your mongo server:

git clone git://
cd Monitis-Linux-Scripts/mongo

then open up the file, and put in your API key and secret.

At this point you need to make sure of two things, one that you have the python elementtree library installed ( and that you are running mongo with the rest interface enabled (run mongod with “–rest” option).

Now you can set up the custom Mongo monitors:


This will setup the following custom monitors in Monitis:
Mongo Build Info
Mongo Databases
Mongo Server Status
Mongo Memory
Mongo Connections
Mongo Op Counters
Mongo Cursors
Mongo Network
Mongo Background Flushes

Now that you have your monitors setup, you can send data by running:


Schedule the following code to run with Cron or any other scheduling agent and you’re done.  Pretty simple and now you can watch all you monitoring data stream in.

You might also like