[omd-users] Monitoring a MongoDB instance with Check MK Enterprise 1.2.8p1

Edwards,PR,Peter,TAG7 R peter.3.edwards at bt.com
Fri Dec 30 12:13:09 CET 2016


I am working on a project which has an existing Check MK implementation - Enterprise 1.2.8p1, installed by someone who is no longer available.

I have a virtual server which is running the check mk agent software, and is visible through the Hosts link of the "WATO - Configuration" tab in the main Check MK GUI.  The services have been auto-discovered and I can see that it is monitoring the kernel memory, and mount points etc. of the operating system.

Under Check Plugins /  Applications, I can see that there is a MongoDB section which lists 9 types of check for a MongoDB instance - which I believe means that the MongoDB plugin is installed on the Check MK server and should therefore be usable to monitor a MongoDB instance running on the virtual server.

However, the MongoDB instance was clearly not picked up by auto-discovery.

By googling around, I have found this Check MK plugin:


I only have a check_mk_agent binary on my target virtual server, so I don't believe I can install this plugin directly on it?  I assume this is the same plugin which is already installed on the Check MK server?  I installed the active_checks_mongodb.py from this plugin into /usr/lib/check_mk_agent/plugins on the target server, anyway, but it didn't seem to do anything.  If I run check_mk_agent, I get nothing regarding mongodb in the output, except in the running processes detail.

On further reading, I realised that this plugin appears to be a wrapper around an underlying Nagios-MongoDB plugin:


I copied the check_mongodb.py script from this plugin into /usr/lib/check_mk_agent/plugins on the target server and also installed the Python pymongo dependency.  Now, I can run that script from the command line on the target server and it will connect to the MongoDB instance.

Running check_mk_agent resulted in an error that it could connect to the server on the localhost IP address, which is the default value in the script.  check_mk_agent is clearly running the script in the plugins directory, but it is not calling the script with any parameters - such as the one needed to specify the correct local IP address that MongoDB is listening on.  I temporarily fudged that by changing the default value in the check_mongodb.py script to use the correct IP address - now running the check_mk_agent on the command line, results in an additional line at the end of the output:

OK - Connection took 0 seconds

Which is the same as when the script is now run on the command line with no parameters:

# ./check_mongodb.py
OK - Connection took 0 seconds

If I re-run the auto-refresh of the services tab of the machine in question in the Check MK GUI, I can see there is an orange status output from the "local" plugin which says:

Invalid performance data Connection in local check output OK - Connection took 0 seconds

Clearly, the check_mk_agent is not calling the Nagios-MongoDB plugin with the correct parameters, and certainly doesn't appear to be monitoring MongoDB in any meaningful way.

I've been wading through the Check MK documentation, but I think I must be missing something fundamental in how one is expected to setup Check MK to monitor services like MongoDB using plugins.

Could someone point me in the right direction of just what the steps should be to get this working?

Many thanks,


Peter Edwards

BT Technology, Service & Operations
This Personal email contains my own opinions, sent In Confidence and does not represent the views of British Telecommunications plc or BT Technology, Service & Operations

BT Group plc Registered office: 81 Newgate Street London EC1A 7AJ. Registered in England and Wales no. 4190816 This electronic message contains information from BT Group plc which may be privileged or confidential.  The information is intended to be for the use of the individual(s) or entity named above.  If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited.  If you have received this electronic message in error, please delete it and notify me immediately by telephone or email.

More information about the omd-users mailing list