Add MongoDB

You can add MongoDB entities using the Add Entity UI or using the cloud agent command line interface (omcli) with the appropriate JSON files.

Step 1: Prepare MongoDB for monitoring.

Prerequisites

To enable monitoring for a MongoDB Database, you can create a special database user, for example, omc_monitor as follows:

  1. Connect to your database:

    use your MongoDB database name;
  2. Create user:

    db.createUser(
    {
    user: "omc_monitor",
    pwd: "mongo123",
    roles: [ "read" ]
    }
    )

Step 2: Decide how you want to add the MongoDB.

You can add MongoDB entities using one of two ways:

  • Add them from UI
  • Use the agent's omcli add_entity command with the appropriate JSON files

Adding Entities from the UI

  1. From the Management Cloud main menu, select Administration, Discovery, and then Add Entity. The Add Entity page displays.
  2. Select the MongoDB Entity Type.
  3. Enter the following UI properties.
    MongoDB Database UI Fields
    • Entity Name: Your MongoDB database name.
    • Host Name: the fully-qualified host name where the MongoDB Database is installed.
    • Port: MongoDB database port.
    • Database Name: MongoDB database name.
    • Cloud Agent: Cloud agent monitoring the host on which MongoDB is installed.

    Monitoring Credentials

    • Username: MongoDB database user name to be used for monitoring.
    • Password: MongoDB database monitoring user's password.

See Add Entities from the Console for detailed instructions on using the Add Entity UI.

Using omcli and the Appropriate JSON Files

  1. Download and extract the required JSON file(s) from the master JSON zip file. See the table below for the specific JSON files you'll need.
  2. Edit the file(s) and specify the requisite properties shown below.
    MongoDB Database JSON Files and Properties

    Desription File: omc_mongodb_sample.json

    • name: Your MongoDB database name.
    • displayName: Name displayed in the Oracle Infrastructure Monitoring User Interface.
    • timezoneRegion: Time zone of your entity. It is recommended that you use the long values IANA-maintained TZ database time zones. For example: America/New_York
    • host_name: Under “value”, provide the fully-qualified host name where the MongoDB Database is installed.
    • port: Under “value”, list the MongoDB database port.
    • database_name: Under “value”, list the MongoDB database name.

    Credential File: omc_mongodb_creds.json

    • DBUserName: Under “value”, within the square brackets, provide the MongoDB database user name to be used for monitoring. You must have defined this user in the Prerequisite Tasks step.
    • DBPassword: Under “value”, within the square brackets, provide the MongoDB database monitoring user's password.

    Do not remove the square brackets.

  3. Add the entity using omcli.
    omcli add_entity agent DEFINITION_FILE [-credential_file CREDENTIAL_FILE [-encryption_method_gpg]] 
  4. Verify the status of the newly added entity.
    omcli status_entity agent DEFINITION_FILE

See step 4. Adding Entities to Your Service of Add Entities Using JSON Files for more information.

Step 3: (Optional but recommended) Set up alerts.

To enable lights-out monitoring, you can set up alert rules to generate alerts and send notifications if your entities have performance issues.

See Set Up Alert Rules and Set Up Alert Thresholds and Notifications.

Troubleshooting

If you run into any issues regarding discovery or monitoring of MongoDB, see the following: