MongoDB is a free and open-source cross-platform document-oriented database program. 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.
Performance Metrics
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.
Prerequisites
- Ensure the 'pymongo' module is installed to get the performance metrics of the MongoDB database. The Site24x7 Linux monitoring agent will automatically try to install 'pymongo' using the 'pip' command. If the installation fails, refer the below section to manually install the module.
- User should have 'clusterMonitor' role to fetch performance metrics of MongoDB.
- Our Linux server monitoring agent should be installed in the server where you plan to run the plugin.
- While adding a plugin, the plugin name and its folder name should be identical.
- Execute the following command in your server to to install pymongo
pip install pymongo
Installing pip:
- Use "pip" to install pymongo
Note: pip is a package management system that is used to install and manage software packages written in Python.
- For CentOS, Fedora, RHEL: yum install python-develyum install python-pip (or)easy_install pip
- For Debian, Ubuntu: apt-get -y install python-pip
Plugin Installation
- Download and install the latest version of the Site24x7 Linux agent in the server where you plan to run the plugin. If it is installed successfully, you will see a Linux server monitor in the Site24x7 Control Panel. This confirms that the agent is able to communicate with our data center.
- Download the file mongod.py from our GitHub repository. wget https://raw.githubusercontent.com/site24x7/plugins/master/mongod/mongod.py
- By default, the plugin will monitor MongoDB instance that is configured on "localhost". To change the configuration, edit the "#Config Section:" in 'mongod.py' file. #Config Section:MONGODB_USERNAME="USER"MONGODB_PWD="PASSWORD"MONGODB_AUTHDB="AUTH"MONGODB_HOST='127.0.0.1'MONGODB_PORT=27017MONGODB_DBSTATS="yes"MONGODB_REPLSET="no"
- Create a folder with the name 'mongod', under Site24x7 Linux Agent plugin directory '/opt/site24x7/monagent/plugins/' and place the 'mongod.py' under '/opt/site24x7/monagent/plugins/mongod/'
View Data in the Site24x7 Web Client
- Log in to Site24x7 and go to Server > Plugins > Name of Plugin Monitor.
- You will be able to view the performance charts on the various metrics for your MongoDB server.
Plugin Contribution
Feel free to contribute to our existing plugin and come up with suggestions or feedback on our Community.
Other Plugin Integrations
- 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 - Linux and Windows