MongoDB MonitoringLast updated on 07 March, 2023
LogicMonitor’s MongoDB monitoring package offers monitoring for databases, server health, and replication for clusters. The package uses the MongoDB Java Driver to monitor the servers directly.
As of December 2020, LogicMonitor’s MongoDB package is known to be compatible with versions 4.1 or older.
Add Resources Into Monitoring
Add your MongoDB hosts into monitoring. For more information on adding resources into monitoring, see Adding Devices.
LogicMonitor must provide the appropriate credentials in order to successfully access the MongoDB resource’s data. These credentials must belong to a user account that has been assigned the following minimum permissions:
|replSetGetStatus||Ability to run the replSetGetStatus command (required for monitoring replication)|
|serverStatus||Ability to run the serverStatus command (required for the MongoDB_Server_Overview DataSource)|
|dbStats||Ability to run the dbStats command|
Assign Properties to Resources
Set the following custom properties must be set on the MongoDB resource within LogicMonitor. For more information on setting properties, see Resource and Instance Properties.
|mongodb.user||(Optional, if authentication is in use) MongoDB username.|
|mongodb.pass||(Optional, if authentication is in use) MongoDB password.|
|mongodb.ssl||(Optional) Set this property to TRUE if the host needs to use SSL to connect to MongoDB. (While TRUE is a recommendation, any value can be set for this property in order to activate SSL connection.)|
|mongodb.ports||(Optional) By default, LogicMonitor tries to connect to 27017. If there are multiple ports running MongoDB on the host, (for multiple instances on the same server), enter the ports as a comma-separated list. Note: If you do customize this property and 27017 is one of the ports LogicMonitor should try, ensure it is included in the comma-separated list.|
From the LogicMonitor public repository, import all MongoDB LogicModules, which are listed in the LogicModules in Package section of this support article. If these LogicModules are already present, ensure you have the most recent versions.
Once the LogicModules are imported (assuming all previous setup requirements have been met), data collection will automatically commence.
Consideration: Two Sets of LogicModules for MongoDB Monitoring
LogicMonitor currently has two sets of MongoDB LogicModules in our MongoDB monitoring package:
- Compatible ONLY with Collector versions 29.105 and lower. The original set of MongoDB DataSources will not work with Collector versions 29.106 and higher due to a hard JAR dependency.
- Compatible ONLY with Collector versions 29.106 and higher. The newer set of MongoDB DataSources use a newer MongoDB driver only available in newer Collectors.
Both sets offer similar coverage; their primary differentiator is Collector compatibility. You can see the LogicModules that make up both sets in the LogicModules in Package section of this support article.
LogicMonitor recommends that, even if you’re still using a Collector version lower than 29.106 to monitor MongoDB, you import the newer set as well. The newer set will not associate with any MongoDB resources until the Collector version is updated to 29.106 or higher at which time they will automatically associate, ensuring a smooth monitoring transition. At that time, the older set will cease to function.
LogicModules in Package
LogicMonitor’s package for MongoDB consists of the following LogicModules. For full coverage, please ensure that all of these LogicModules are imported into your LogicMonitor platform.
|Name||Type||Collector Version Compatibility||Description|
|addCategory_MongoDB||PropertySource||All||Adds “MongoDB” as a value to the system.categories property on MongoDB resources.|
|MongoDB_Server_Overview||DataSource||29.106 or higher||High level overview of MongoDB server health and statistics.|
|MongoDB Server Databases||DataSource||29.106 or higher||Monitors basic stats on MongoDB databases.|
|MongoDB_Sever_Replication||DataSource||29.106 or higher||Discover all members of replica set and measures replication and status.|
|MongoDB Replication||DataSource||29.105 or lower||Discover all members of replica set and measures replication and status.|
|MongoDB Databases||DataSource||29.105 or lower||Monitors individual MongoDB databases on the host.|
|MongoDB-||DataSource||29.105 or lower||Monitors core MongoDB functionality|
When setting static datapoint thresholds on the various metrics tracked by this package’s DataSources, LogicMonitor follows the technology owner’s best practice KPI recommendations. If necessary, we encourage you to adjust these predefined thresholds to meet the unique needs of your environment. For more information on tuning datapoint thresholds, see Tuning Static Thresholds for Datapoints.