Setup Requirements

Data Collection Setup

Metrics are collected via the Mongo Client from the MongoDB admin database.

Network Requirements


Non-Default Port Configuration

If using a port other than the default of 27017, you can append the non-standard port number to the hostname

Port: 27017 (TCP) is the default to Mongos/Mongod host.

  • The Mongos/Mongod host should be listening on the port specified by the user.

Least Privileged User

MongoDB User Name/Password for the admin database with read-only credentials.

To setup a least-privileged user for MongoDB:

  1. Determine which machine within the cluster is the primary member
    The mongo shell provides an excellent method for discerning this information. Visit the MongoDB Documentation for the db.isMaster() command.
  2. Login to the machine that is the primary member of the cluster
  3. Use the mongo command to start the mongo shell and connect to MongoDB
    For more information on the mongo shell and to learn how to connect to MongoDB, visit the MongoDB Documentation.
  4. Switch to the admin database
    use admin
  5. Create the user by running the following command
    Replace CHOOSE_A_PASSWORD with a password of choice
	user: "lpu",
	roles: [{
			role: "readAnyDatabase",
			db: "admin"
			role: "clusterMonitor",
			db: "admin"


Mongos and Mongod Username / Password for the environment

The same Username / Password must exist for all mongos/mongods in your environment

Supported Versions

MongoDB: 3.x, 4.0
MongoDB Advanced Enterprise Edition: 3.x, 4.0
MongoDB Atlas: 3.x, 4.0 and M10+

MongoDB Atlas Configuration

Since MongoDB Atlas is a fully managed cloud database, there are specific configuration settings that apply only to it. Those configurations are outlined below.

Network Access

The server the collector runs on needs access to the MongoDB Atlas installation. To setup or verify access to your MongoDB Atlas instance you will need to login to your Project workspace and in the left hand menu under Security choose Network Access. From there the network or IP address that the Collector is installed on needs to be added to the IP Whitelist. If it's not already in the list, click the green "+Add IP Address" button in the upper right hand corner. Add your IP address or range of addresses and click confirm to save.

Least Privileged User Account Creation

A user account that has access to read from the Admin table is required to access metrics from MongoDB Atlas. To create this account, login to your project workspace. From the left hand navigation, under Security choose Database Access. Click the green "+Add New User" button in the upper right hand corner. Under User Privileges, click the "Add Default Privileges" link. You will need to add two roles, clusterMonitor and readAnyDatabase. For each role you want to use "admin" as the database and can leave "Collection" blank as shown below.


Screen shot of required LPU Roles and Databases.

Host configuration

When configuring the connection to MongoDB Atlas the host you want to use is the host name of the Primary Node. To find this, login to your project workspace. On the left hand navigation under Atlas choose Clusters. Then click on the Cluster name you want to monitor. That should show all the nodes in that cluster, click on the name of the Primary Node. You can then copy the name of the cluster and paste it into the host field on the Source Configuration Parameters. Make sure not to copy the port, usually :27017, but make a note of it and enter it separately in the Port field on the Source Connection Parameters form.

Connection Parameters

HostRequiredThe Mongos and/or Mongod to connect to. Comma Separated list is supported.
PortThe port associated with each host specified above. If this parameter is specified, it must contain the same number of entries as the list of hosts.
NameRequiredA friendly display name for reusing these credentials
Authentication TypeChoose between default and LDAP SASL
Use SSL to connect to host
Connection TimeoutThe number of seconds to allow for connecting to each host.
Collection IntervalThe amount of time between data collections. More frequent collections may affect Source performance or increase Destination costs.