MongoDB Monitoring

MongoDB monitoring involves real-time tracking and analysis of MongoDB performance to ensure efficient database operations and optimization.

Gain visibility into the performance of your MongoDB and MongoDB Atlas databases with Site24x7's ready-to-install MongoDB monitoring plugin integrations. Leverage our MongoDB monitoring tool to gain insights into the availability and health of your MongoDB databases to stay ahead of issues and bottlenecks affecting them.

Add your first server monitoring plugin for free and each subsequent plugin is just $1 per month.

Start 30-day free trial Try now, sign up in 30 seconds
MongoDB Monitoring

What is MongoDB?

MongoDB is an open-source, document-oriented NoSQL database that is built to store, retrieve, and manage huge amounts of data. As opposed to relational SQL databases that store data in the form of tables, MongoDB is a non-relational NoSQL database that stores data as flexible, JSON-like documents. This makes MongoDB highly scalable and suitable to be used across multiple systems for data aggregation and retrieval.

MongoDB Atlas is a fully managed cloud-native database that helps businesses deploy and run MongoDB in the cloud. It offers all the features of MongoDB along with high flexibility and scalability, as well as automating database administration tasks.

MongoDB performance monitoring with Site24x7

Ensure the availability and optimal performance of your MongoDB and MongoDB Atlas database servers, and fix issues before they start affecting end users.

Get insights on critical MongoDB performance metrics

Use key metrics—including memory usage, connections, and replication status—to pinpoint areas impacting MongoDB performance.

Stay updated with instant alerts

Get instant notifications every time values cross pre-defined threshold limits and swiftly take preventative or recovery measures.

Remediate incidents with event-driven IT automation

Set up automated workflows to take corrective measures in MongoDB when pre-defined threshold breaches occur.

Create custom dashboards

Assemble data from different parts of your infrastructure with drag-and-drop widgets and build personalized dashboard views.

Get started with Site24x7's MongoDB monitoring tool

  • Supported Platforms:
  • Python Version:
    2.7 & above
  • Linux Agent Version:
    15.0.0 & above

Performance Metrics

MongoDB performance metrics

You can track the following metrics with the MongoDB monitoring plugin:

Name Description
memory_resident The amount of memory currently used by the database process
memory_virtual The amount of virtual memory used by the mongod process
memory_mapped The amount of mapped memory by the database
connections_current The number of connections to the database server from clients
connections_available The number of unused available incoming connections the database can provide
heap_usage The total size in bytes of heap space used by the database process
page_faults The number of page faults per second that require disk operations
seconds_since_lastflush The amount of time since the last flush operation took to complete
last_flush_length The amount of time that the last flush operation took to complete
flush_length_avrg The average amount of time that the overall flush operation took to complete
cursors_total_open The number of cursors that MongoDB is maintaining for clients
replSet_setName The name of the current replica set, if applicable
replSet_isMaster The Boolean value that reports whether the node is writable
replSet_isSecondary A Boolean value that indicates that the current member is a secondary member of a replica set
replSet_isArbiter A Boolean value that indicates that the current instance is an arbiter
replSet_myState The state of the replica set
MongoDB Atlas performance metrics

You can track the following metrics with the MongoDB Atlas monitoring plugin:

Name Description
analytics_nodes The number of analytics nodes in the region
clustertype The type of the cluster
disksize The capacity (in gigabytes) of the host's root volume
electable_nodes The number of electable nodes in the region
maxinstance_size The maximum instance size to which your cluster can automatically scale
mininstanc_size The minimum instance size to which your cluster can automatically scale
mongodb_majorversion The major version of MongoDB the cluster runs
mongodb_version The version of MongoDB the cluster runs
mongo_uri_updated Timestamp in date and time format in UTC when the connection string was last updated
name The name of the cluster to be retrieved
numshards A positive integer that specifies the number of shards for a sharded cluster
pitenabled A flag that indicates if the cluster uses Continuous Cloud Backups
priority Election priority of the region
provider_backup_enabled A flag that indicates if the cluster uses Cloud Backups for backups
providername The cloud service provider on which Atlas provisioned the hosts
readonly_nodes The number of read-only nodes in the region
replication_factor The number of replica set members
rootcert_type Certificate Authority that MongoDB Atlas clusters use
srvaddress The connection string for connecting to the Atlas cluster
statename The current state of the cluster
zonename The name of the zone

Setup

Prerequisites

Ensure you meet the following requirements before installing the plugin:

  • A Site24x7 account. If you don't have one, sign up here for free.
  • Download and install the Site24x7 server monitoring agent (Linux | Windows) in the network or on the specific host where the MongoDB instance is running.
  • Ensure that the pymongo module is installed.

If pymongo not installed, follow the steps below to install it.

For Linux:

Execute the following command in your server to install it:

pip install pymongo

Note: Install a compatible version of pymongo for your existing Python version:

Python Version Reference link of compatible pymongo versions
Python 3 https://www.mongodb.com/docs/drivers/pymongo/#python-3-compatibility
Python 2 https://www.mongodb.com/docs/drivers/pymongo/#python-2-compatibility

Use "pip" to install pymongo module. pip is a package management system used to install and manage software packages written in Python.

To install pip for CentOS, Fedora, RHEL, use:

yum install python-devel

yum install python-pip (or)

easy_install pip

To install pip for Debian, Ubuntu, use:

apt-get -y install python-pip

Ensure you meet the following requirements before installing the plugin:

  • A Site24x7 account. If you don't have one, sign up here for free.
  • Download and install the Site24x7 server monitoring agent (Linux | Windows) on the server where you have provided access to the MongoDB cluster API.
  • Ensure you have allowed access to the cluster API that is present in https://www.mongodb.com using public_key and private_key.

Installation

  • Create a folder named mongoDB.
  • Download the mongoDB.py and the mongoDB.cfg files from our Github repository and place them in the mongoDB folder.
    wget https://raw.githubusercontent.com/site24x7/plugins/master/mongoDB/mongoDB.py
    wget https://raw.githubusercontent.com/site24x7/plugins/master/mongoDB/mongoDB.cfg
  • Add the following configuration in mongoDB.cfg file:
    ["mongodb"]
    host=<host_name>
    port=<port_number>
    username=<your_username>
    password=<your_password>
    dbstats=<dbstats>
    replset=<replset>
    dbname=<dbname>
    authdb=<authdb>
  • Follow the steps in this article to learn how to run the python script on a Windows server. You don't need to do this for Linux.
  • Move the mongoDB to the Site24x7 server monitoring plugin directory.

    For Linux: /opt/site24x7/monagent/plugins/

    For Windows: C:\Program Files (x86)\Site24x7\WinAgent\monitoring\plugins\

  • To verify if the plugin is working, execute the command below with appropriate arguments to check for a valid JSON output:
    python mongoDB.py --host= --port= --username= --password= --dbstats= --replset= --dbname= --authdb=

The agent will automatically execute the plugin within five minutes and send performance data to the Site24x7 data center.

To view performance charts and set thresholds for the various performance metrics:

  • Log in to Site24x7.
  • Navigate to Server > Plugin Integrations
  • Click the required monitor.
  • Create a folder named mongodb_atlas.
  • Download the mongodb_atlas.py and the mongodb_atlas.cfg files from our Github repository and place them in the mongodb_atlas folder.
    wget https://raw.githubusercontent.com/site24x7/plugins/master/mongodb_atlas/mongodb_atlas.py
    wget https://raw.githubusercontent.com/site24x7/plugins/master/mongodb_atlas/mongodb_atlas.cfg
  • Add the following configuration in mongodb_atlas.cfg file:
    [mongodb_atlas]
    group_id =
    public_key =
    private_key =
  • Follow the steps in this article to learn how to run the python script on a Windows server. You don't need to do this for Linux.
  • Move the mongodb_atlas folder to the Site24x7 server monitoring plugin directory.

    For Linux: /opt/site24x7/monagent/plugins/

    For Windows: C:\Program Files (x86)\Site24x7\WinAgent\monitoring\plugins\

  • To verify if the plugin is working, execute the command below with appropriate arguments to check for a valid JSON output:
    python mongodb_atlas.py --group_id= --public_key= --private_key=

The agent will automatically execute the plugin within five minutes and send performance data to the Site24x7 data center.

To view performance charts and set thresholds for the various performance metrics:

  • Log in to Site24x7.
  • Navigate to Plugins > click the required monitor.

Plugin Contribution

Feel free to contribute to our existing plugin and come up with suggestions or feedback on our Community.

  • Supported Platforms:
  • Python Version: 2.7 & above
  • Linux Agent Version:15.0.0 & above

Over 12,000 customers trust Site24x7

Brand logos of our various customers

Check out our 100+ plugin integrations, or build your own

Choose from our list of more than 100 ready-to-use plugins and monitor your full stack of applications across web servers, databases, load balancers, and more.

See all plugin integrations