Configuring MongoDB for DataCollector, Version 5.2

This section describes the required configurations as well as the optional configurations available for the Solution Package for MongoDB in the RTView Configuration Application. You must define the classpath to the Mongo DB jar file and you must also define data source connections for each database connection that you want to monitor. 

Configuring Data Collection

Use the RTView Configuration Application to configure your data collection.

Note: See Creating Secure Connections for additional information on creating secure connections to MongoDB.

  • Navigate to Solution Package Configuration > MongoDB.
  • On the CONNECTIONS tab, provide the correct full path to the directory containing the Mongo DB jar file in the Classpath field.

  • In the Connections region, click the  icon.

The Add Connection dialog displays.

  • Specify the connection information and click SAVE where:

Connection Name: Enter the name you want to specify for the connection.

URL: add the following lines for each MongoDB database to which you want to connect (to enable the Monitor to collect data from them):

The connection string should use the following format:

mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]

mongodb:// is a required prefix to identify that this is a string in the standard connection format.

username:password@ are optional. If given, the driver will attempt to login to a database after connecting to a database server. For some authentication mechanisms, only the username is specified and the password is not, in which case the ":" after the username is left off.

host1 is the only required part of the URI. It identifies a server address to which to connect.

:portX is optional and defaults to :27017 if not provided.

/database is the name of the database to login to and thus is only relevant if the username:password@ syntax is used. If not specified, the admin database will be used by default.

?options are connection options. Note that if the database is absent, there is still a / required between the last host and the ? introducing the options. Options are name=value pairs and the pairs are separated by &. For backwards compatibility, ; is accepted as a separator in addition to &, but should be considered as deprecated.

Example for two database connections:

Name= Mongo1 URL=  mongodb://myUserAdmin:abc123@123.4.567.890:27017

Name= Mongo2 URL= mongodb://123.456.789.012:27027

The newly created connection displays in the Connections section.

  • You can optionally modify the Poll Rates (query interval, in seconds) that will be used to collect the metric data for the MongoDatabase, MongoInstance, and MongoCollection caches by clicking on the DATA COLLECTION tab and entering the desired polling rate.