User Permissions for MongoDB

For MongoDB < 2.6.x, the readAnyDatabase and ClusterMonitor built-in roles are required to monitor using Splunk AppDynamics Database Visibility. For MongoDB shared clusters, the monitoring user must have access to all shards.

For MongoDB >= 2.6, the clusterMonitor built-in role in addition to read is required.

If you choose to create a new user to monitor MongoDB, the user must be created in the admin database.

You can configure user roles as shown in the sample query below:

use admin
db.createUser({ user: "tanujaAdmin",
pwd: "tanuja123",
    roles: [ 
	{ role: "clusterMonitor", db: "admin" },
  	{ role: "read", db: "admin" },
    ] 
})