MongoDB: Monitoring MongoDB with OpsDash

Note: If you are using the OpsDash Smart Agent v.1.1, please upgrade to v1.3 before you begin MongoDB monitoring. You can find upgrade instructions here.

Quick Start

1. Install the OpsDash Smart Agent on the MongoDB server that you wish to monitor. If you need instructions for how to do this, here they are:  Debian/UbuntuCentOS/RHELGeneric.

2. Edit the OpsDash Smart Agent configuration file at /etc/opsdash/agent.cfg and add a new service:

# choose a good, unique name for the service (here my-mongodb-1 is used)
service "my-mongodb-1" {
    type = "mongodb"
    host = "127.0.0.1"
}

3. Reload the OpsDash Smart Agent so that it picks up the new configuration:

sudo service opsdash-agent reload

4. You should see the service my-mongodb-1 appear under  https://app.opsdash.com/sources within a minute or so. Clicking on it should take you to the dashboard at https://app.opsdash.com/source/my-mongodb-1. If it does not, check the agent log file at /var/log/opsdash/agent.log.

Authentication

If you're running MongoDB with authentication enabled, you can make OpsDash connect to MongoDB as a particular user. Use the following configuration:

# choose a good, unique name for the service (here my-mongodb-1 is used)
service "my-mongodb-1" {
    type = "mongodb"
    host = "127.0.0.1"
    user = "opsdash"
    pass = "p@ssw0rd"
}<br>
	

OpsDash will use the "admin" database as the user database.

The user should have the "clusterMonitor" role.

Notes

  • MongoDB versions 2.6, 3.0, 3.2 and 3.4 are supported.
  • You can install the OpsDash Smart Agent on any server that can connect to the MongoDB instance -- adjust "127.0.0.1" accordingly in the above instructions.
  • You can also specify a port (port = 27017) in the service configuration block if needed.
  • The OpsDash Smart Agent will also collect and report metrics of the server itself, where it is installed. This will appear under the "Servers" section on the Sources page.