Configuring the agent by using the silent response file

The silent response file contains the agent configuration parameters with default values defined for some parameters. You can edit the silent response file to specify different values for the configuration parameters, and configure the agent.

Before you begin

To run the MongoDB database in the authentication mode, ensure that you configure the agent with a user who has the clusterAdmin, readAnyDatabase, and dbAdminAnyDatabase roles on the MongoDB database.

Procedure

  1. In a text editor, open the silent response file that is available at the following path:
    install_dir/samples/mongodb_silent_config.txt.
  2. For the TYPE parameter, enter one of the following values:
    • 1 for a cluster
    • 2 for a replication set
    • 3 for a stand-alone instance

    By default, the agent monitors a cluster.

  3. For the PORT parameter, specify the port number of the router for a MongoDB cluster or a mongod instance of the MongoDB replication set that is being monitored.
    Remember: If you do not specify any port number, the agent automatically discovers the port number of the appropriate MongoDB process that is active on the default interface. If no MongoDB process is active on the default interface, then the agent selects the port number of the appropriate MongoDB process that is active on the secondary interface.
  4. For the HOST parameter, specify the IP address of the MongoDB host system.
    Remember: If you do not specify any IP address, the agent automatically detects the IP address of the appropriate MongoDB process that is active on the default interface. If no MongoDB process is active on the default interface, then the agent detects the IP address of the appropriate MongoDB process that is active on the secondary interface.
  5. For the Is it a TLS Connection parameter, specify any one of the following values:
    • If you want to use a TLS protocol to connect the agent and MongoDB server, then specify 1=TLS Connection. However, to enable the connection, you must specify the following parameter values:
      • CA File Path: Specify the path to the CA file.
      • TLS Certificate Key File Path: Specify the path to the Client Certificate key file.

        Optionally, for Additional arguments for TLS parameter, you can specify additional arguments for TLS by using space delimiters.

    • If you want to use a Non-TLS protocol to connect the agent and MongoDB server, then specify 2=Non-TLS Connection.
      Note: If you do not specify any value, then by default the agent uses a Non-TLS Connection.
  6. For the AUTHENTICATION parameter, specify YES to indicate that MongoDB is running in the authentication mode. The default value is NO, which indicates that the agent is not running in the authentication mode.
    Remember: When the MongoDB database is running in the authentication mode, the MongoDB agent or any MongoDB client cannot connect to the MongoDB database without credentials. To connect to the database that runs in the authentication mode, specify YES for the AUTHENTICATION parameter.

    If you specify YES, complete the following steps:

    1. For the User Name parameter, specify a user name for the router or the mongod instance. Ensure that minimum roles are assigned to the user. For information about user roles, see Table 1.
    2. For the Password parameter, specify the password.
  7. Save and close the mongodb_silent_config.txt file, and run the following command:
    install_dir/bin/mongodb-agent.sh config instance_name install_dir/samples/mongodb_silent_config.txt
    Where
    • instance_name is the name that you specify for the instance.
    • install_dir is the installation directory of the MongoDB agent.
  8. Run the following command to start the agent:
    install_dir/bin/mongodb-agent.sh start instance_name
    Important: If you upgrade the agent to V1.0.0.9 or later and want to run the agent in the authentication mode, then you must configure the agent again to provide a user name and a password. For collecting data, you must stop and restart the agent after configuration.

What to do next

Log in to the Cloud APM console to view the data that is collected by the agent in the dashboards. For information about using the Cloud APM console, see Starting the Cloud APM console.

If you need help with troubleshooting, see the Troubleshooting section.