Configuring a MongoDB environment

This topic provides information about configuring the MongoDB monitor type by using the TrueSight console. The MongoDB monitor type is used to monitor the MongoDB database computers. The MongoDB monitor type can be configured to monitor the MongoDB database MongoS parameters, MongoDB cluster parameters, and the replica set member parameters.

Configuring the MongoDB monitor type

In the Add Monitor Types dialog box, with the Monitoring Profile set to MongoDB Monitoring, and the Monitor Type set to MongoDB, provide the following details:

Global Setting

FieldDescription
Java homeSpecify the path of the Java home.
Data collection logging

Select the check box to turn ON the PSL debug at a global level.

MongoDB Configuration

FieldDescription
MongoDB EnvironmentEnter the name for the MongoDB database environment.
Host NameEnter the host name or IP number that you want to monitor.
Port NumberEnter the port number of the instance that you want to monitor.
Excluded DBsEnter the MongoDB databases that you want to exclude from monitoring. Separate the databases by using a semicolon (;), comma (,), or space.

Use authentication

FieldDescription
UsernameEnter the username to connect to the database.
User PasswordEnter the password to connect to the database.

Note

When using authentication the user needs to have read privilege to admin and local databases at all Mongo components. 

In case, if the MongoDB is a cluster then the user needs to have ClusterMonitor for admin DB as well.

Use SSL

FieldDescription
Trust store certificate file

Enter the path to the directory where the Trust Store certificates are located. The input to this field is the full path of JKS file.

Trust store PasswordEnter the Trust Store Password.
Key store fileEnter the path to the directory where the Key Store certificates are located.
Key store passwordEnter the Key Store Password.

The following steps involved in generating the jks file:

1. Create the key and crt files of ssl connection:

 “-openssl req -new -x509 -days 365 -nodes -out selfsigned-cert.crt -keyout selfsigned-cert.key”

 For example:

openssl.exe req -new -x509 -days 365 -nodes -out selfsigned-cert.crt -keyout selfsigned-cert.key

2. Create the .p12 file from the generated key and crt files: 

“-openssl pkcs12 -export -in [path to certificate] -inkey [path to private key] -certfile [path to certificate ] -out [p12 file name]”

For example:

openssl.exe pkcs12 -export -in selfsigned-cert.crt -inkey selfsigned-cert.key -certfile selfsigned-cert.crt -out testkeystore.p12

3. Generate the jks file using java keytool (from "%JAVA_HOME%\bin"):

“-keytool -importkeystore -srckeystore testkeystore .p12 -srcstoretype pkcs12 -destkeystore %myJksFile %.jks -deststoretype JKS”

 This example generates myJksFile.jks file.

KM admin

FieldDescription
Discovery Interval (mins)Specify the time interval between discovery cycles, in minutes.
ReplicaSet member to deviceSelect to display each host separately. Instance to Device is enabled by default.
Data collection loggingSelect the check box to turn the logging on or off for the MongoDB environment you want to configure. By default, the data collection logging is turned off.

MongoS Parameters

FieldDescription
  • Number of inserts
  • Number of queries
  • Number of updates
  • Number of deletes
  • Number of getMore
  • Number of command
  • Virtual memory size
  • Resident memory size
  • Number of work bytes in
  • Number of work bytes out
  • Number of open connections
  • Number of network requests
  • Number of asserts warning
  • Number of asserts messages
  • Number of asserts users
  • Number of page faults
  • Number of asserts regular
Select one or more from the list of parameters to enable monitoring the MongoS parameters.

Cluster Parameters

FieldDescription
  • Number of chunks
  • Chunk size
  • Number db client connection
  • Number aScoped connection
  • Total available connections
  • Total created connections
Select one or more from the list of parameters to enable monitoring the cluster parameters.

Database Parameters

FieldDescription
  • File size
  • Index size
  • Storage size
  • Number of extents
  • Number of indexes
  • Number of collections
  • Number of objects
  • Average object size
  • Data size
  • Name space size
Select one or more from the list of parameters to enable monitoring the database parameters.

Member Parameters

FieldDescription
  • Lag in replicating
  • Log file size
  • OP log length
  • Log file used MBs
  • Number of inserts
  • Number of queries
  • Number of updates
  • Number of deletes
  • Number of getMore
  • Number of command
  • Mapped memory size
  • Virtual memory size
  • Resident memory size
  • Queue read write
  • Number active clients
  • Number of work bytes in
  • Number of work bytes out
  • Number of open connections
  • Number of network requests
  • Number of asserts warning
  • Number of asserts messages
  • Number of asserts users
  • Number of queue readers
  • Number of queue writers
  • Number of page faults
  • Number of asserts regular
  • Database total size on disk
  • Number of long running operations
Select one or more from the list of parameters to enable monitoring the Replica Set Member parameters

Long running operations filter

FieldDescription
Long running time (sec)

Specify the long running operations period in seconds. By default, the time is 60 sec.

Note

If Operation and NameSpace are empty, it fetches for ALL operations that are running more than the set time.

Filter actionSpecify the Include or Exclude filter operation. Include is selected by default.
Namespace listSpecify the namespace that you want to exclude from monitoring. Separate the list by using a semicolon (;), comma (,), or space. By default, it is user;analytics.

For example, user,analytics

Operation list

Specify the operations that you want to exclude from monitoring. Separate the list by using a semicolon (;), comma (,), or space. By default, it specifies the field with the query.

For example, query,insert

 After you have completed configuring the environment, click OK to add this to the environment configurations list and save the policy. This environment is displayed on the Environment Configuration list. 

Click Cancel to exit without saving any changes. 

Was this page helpful? Yes No Submitting... Thank you

Comments