Monitoring MongoDB using Oracle Enterprise Manager Cloud Control

Scott Wardrop from AIDEV told me that they produced a plugin for Oracle Enterprise Manager Cloud Control 12c to monitor MongoDB. We use MongoDB in our production systems, so I decided to examine the plugin and write a blog post about it. Unfortunately version of our MongoDB databases are too old (2.4.x series) so the plugin didn’t work. Of course, it didn’t stop me. We created a simple MongoDB Cluster environment to test the MongoDB plugin for EM12c.

Becasue the installation is well documented by the vendor, I will not give a step by step installation guide. You can find the installation document on the download page. By the way, you need to manually download and deploy the plugin using EMCLI. Before you start deployment, send an email to info@aidev.uk for the unlock password (of the zip file). After you receive the password, download the latest plugin zip file, unzip it and run EMCLI:

After the installation is done, you need to deploy it to the OMS, and to the agents running on MongoDB servers.

mongoagent

Before you add the MongoDB targets using “Add Targets Declaratively by Specifying Target Monitoring Properties”, you also need to make some preparation on target MongoDB database and server. First you need to create a “monitoring” user. Login to target MongoDB database and run the following scripts:

The above script creates a new role (emRole) and give required permission to read-only access to MongoDB cluster/database, then it will create a new user and assign the emRole role to it. Don’t forget to modify the password. The plugin will need some JAR files, so download org.json libraries v20140107 and mongDB java driver v2.13.1 from http://search.maven.org/ to the target server(s). Be careful about the version numbers! The deployment document shows the correct versions and you should download exact versions. These files should be accessible by the user running EM agent.

addmongot

When everything is ready, you can add the mongoDB database target. Click setup > add target > add target manually, pick the server, enter the target name, the user name (you created in MongoDB), the folder which contains jar files, MongoDB port number and then click OK. The plugin can monitor both mongos and mongod instances. If you’ll monitor a MongoDB cluster, I recommend you to add all nodes, config servers, database nodes and mongos instances to EM12c system.

If you connect mongos instance, you won’t be able to use “top waits” and “clients” page (these pages will be blank). On the other hand, to check the database sizes of the cluster, you need to connect mongos instances.

mongohome

The MongoDB plugin shows very detailed information including replication info (when connected to database nodes), sharding information (when connected to mongos instances).

mongostroage

You can see how much disk storage used by each database, their growth history, connections, locks and many more. It is surely well designed and fetch all the useful information provided by MongoDB.

mongologs

It’s also very useful to be able to see the logs of the instance.

mongojobs

One of the interesting feature of the plugin is, you can create javascript jobs to run on MongoDB servers. When testing this feature, I’ve found a small error about the path of the mongodb client. When creating a javascript job, instead of entering full path of the executable, you need to enter the path of the bin directory, because the plugin will add “mongo” to the path. I’m sure it will be fixed soon.

I liked the plugin, and I recommend you to use it if you want to monitor MongoDB clusters with EM12c. It’s really easy to connect Scott (the developer of the plugin) and ask questions, even ask new features 🙂 By the way, I do not know the price but the plugin is not free. On the other hand, you can test it for 31 days at no cost.

Please share
  • 11
  •  
  •  
  •  
  •  
  •  

AWS Big Data Specialist. Oracle Certified Professional (OCP) for EBS R12, Oracle 10g and 11g. Co-author of "Expert Oracle Enterprise Manager 12c" book published by Apress. Awarded as Oracle ACE (in 2011) and Oracle ACE Director (in 2016) for the continuous contributions to the Oracle users community. Founding member, and vice president of Turkish Oracle User Group (TROUG). Presented at various international conferences including Oracle Open World.

1 Comment

  1. Hi Gokhan, many thanks for the positive review.

    The .js job functionality requires the full path to the location of the mongo binary, not the full path of the binary – an easy misunderstanding to make.

    Our Javascript jobs guide pdf explains the process to follow when setting up EM jobs of this nature.

    thanks again,

    info@aidev.uk

Leave Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.