- Reference >
- Monitoring Agent >
- Configure Monitoring Agent for Access Control >
- Configure Monitoring Agent for MONGODB-CR
Configure Monitoring Agent for MONGODB-CR¶
On this page
In MongoDB 3.0 and later, MongoDB’s default authentication mechanism is
a challenge and response mechanism (SCRAM-SHA-1
). Previously, MongoDB
used MongoDB Challenge and Response (MONGODB-CR
) as the default.
The Monitoring Agent can use MONGODB-CR
or SCRAM-SHA-1
to authenticate to hosts that enforce access control.
To authenticate using SCRAM-SHA-1
or MONGODB-CR
, create a user
in the admin
database with the appropriate roles in MongoDB.
Note
In Ops Manager 1.8 and later, Ops Manager can manage agent authentication for you if you use Automation to manage the agents. With Automation, Ops Manager creates the users for each agent and configures the agent appropriately. See: Enable SCRAM-SHA-1 / MONGODB-CR Authentication for your Ops Manager Group for more information.
Procedures¶
Create MongoDB User for the Agent¶
Connect to the mongod or mongos instance as a user with access to create users in the database. See db.createUser() method page for more information.
To authenticate to sharded clusters, create shard-local users on each shard and create cluster-wide users:
- Create cluster users while connected to the mongos: these credentials persist to the config servers.
- Create shard-local users by connecting directly to the replica set for each shard.
MongoDB 2.6 and Later¶
To monitor MongoDB 2.6 instances, create a user in the admin
database with an operation that resembles the following:
See Access Control for MongoDB 2.6 for more information on the required access.
MongoDB 2.4¶
To monitor MongoDB 2.4 instances, create a user in the admin
database with an operation that resembles the following:
Refer to the Access Control for MongoDB 2.4 reference
to choose which MongoDB roles to provide for the Monitoring Agent.
For example, if you wish to monitoring with database profiling,
you will need to include the dbAdminAnyDatabase
role.
Host Settings¶
In addition to adding the agent as a MongoDB user, you must also specify the host’s authentication settings. You can specify the host’s authentication settings when adding the host, or you can edit the settings for an existing host.