You can configure your MongoDB instance to use SSL connections.

  1. Create a keystore on the database agent host.

  2. Import the SSL certificates to this keystore using the following command:

    keytool -importcert -trustcacerts -file <mongodb certificate location> -keystore <keystore e.g. path/mongo.jks> -storepass <keystore password> -alias <alias>
    CODE
  3. Start the database agent with the following flags:

    java -Ddbagent.name=<DBAgent Name> -Djavax.net.ssl.trustStore=<keystore e.g. path/mongo.jks> -Djavax.net.ssl.trustStorePassword=<keystore password> -jar db-agent.jar
    CODE
  4. Create the mongodb collector with custom URL:

    mongodb://<mongodb-host>:27017/?ssl=true
    CODE