MongoDB Monitoring

Configure Site24x7 plugin to monitor the performance metrics of your MongoDB databases.

MongoDB is a free and open-source cross-platform document-oriented database program. Use Site24x7 plugins and gain in-depth visibility into the right MongoDB metrics to optimize your data infrastructures.

This document details how to configure the MongoDB plugin and the monitoring metrics for providing in-depth visibility into the performance, availability, and usage stats of MongoDB servers.

MongoDB performance monitoring metrics:

The Various out-of-the-box metrics we support are:

Available connections

"connections_available" metric counts and records the total number of unused connections available for new clients in your MongoDB setup.

Current connections

"connections_current" metric counts and records the total number of connections active to the database in your MongoDB setup.

Heap usage

The total amount of heap space in bytes used by the databases in your MongoDB setup is recorded using the metric "heap_usage".

Total open cursors

The metric "cursors_total_open" identifies and records the total number of cursors currently opened by your MongoDB setup for clients.

How it works?

  • Log-in to your Site24x7 account. Sign up here if you don't have one.
  • Download and install the latest version of Site24x7 Linux Agent
  • Install the MongoDB plugin
  • The agent will execute the MongoDB plugin and push the data to the Site24x7 server

Prerequisites:

  • Site24x7 MongoDB plugin uses "pymongo" module to get the performance metrics of MongoDB database

Note: Site24x7 Linux agent will automatically try to install "pymongo" using the "pip" command. If the installations fails, users can manually install the module following the steps mentioned under the section "How to install pymongo?".

How to install pymongo?

MongoDB plugin installation:

  • Create a directory with the name "mongod", under Site24x7 Linux Agent plugin directory - /opt/site24x7/monagent/plugins/
  • Download the file "mongod.py" from our GitHub repository and place it under the "mongod" directory
  • Commands to perform the above step:
  • cd /opt/site24x7/monagent/plugins/
    mkdir mongod
    cd mongod
    wget https://raw.githubusercontent.com/site24x7/plugins/master/mongod/mongod.py
  • Once the plugin file is downloaded, the agent will mark it up in the next data collection and you can view it in Site24x7 client

MongoDB plugin configuration:

  • By default, the plugin will monitor MongoDB instance that is configured on "localhost"
  • The default python path given in the plugin script is #!/usr/bin/python. If you wish to provide an alternate python path, replace the existing one preceded by the shebang character "#!".
  • In order to change the monitoring configuration, go to plugins directory and edit the "#Config Section:" in mongod.py file
  • MongoDB plugin file location - /opt/site24x7agent/monagent/plugins/mongod/mongod.py

    #Config Section:
    MONGODB_USERNAME="USER"
    MONGODB_PWD="PASSWORD"
    MONGODB_AUTHDB="AUTH"
    MONGODB_HOST='127.0.0.1'
    MONGODB_PORT=27017
    MONGODB_DBSTATS="yes"
    MONGODB_REPLSET="no"

Monitoring additional metrics:

  • To monitor additional metrics, edit the "mongod.py" file and add the new metrics that need monitoring
  • Increment the plugin version value in the file "mongod.py" to view the newly added metrics ( For e.g. change the default plugin version from PLUGIN_VERSION = "1" to "PLUGIN_VERSION = "2")

Related plugins:

  • RabbitMQ plugin - Monitor performance metrics of your RabbitMQ databases
  • MySQL plugin - Monitor performance metrics of your MySQL databases
  • Samba plugin - Analyze performance of your Samba server
  • Nagios plugin - Execute thousands of Nagios plugins in Site24x7 without the need of running a Nagios server
  • Out-of-the-box plugins - Monitor your entire app stack with our extensive list of integrations
  • Create custom plugins - Create custom Linux and Windows plugins and monitor custom attributes
Trusted

World's leading companies

Client

Don't have a Site24x7 account? Sign up now!