MongoDB Monitor
ZenPacks.zenoss.MongoDBMonitor
This ZenPack models and collects data from Mongo DB servers and the individual databases belonging to them.
Releases
Version 2.1.0
Released on 2023/08/10
Requires ZenPackLib ZenPack, PS.Utils ZenPack
Compatible with Zenoss 6.x and Virtana Service Observability
Version 2.0.0
Released on 2021/04/30
Requires ZenPackLib ZenPack, PS.Utils ZenPack
Compatible with Zenoss 6.x and Virtana Service Observability
Usage
Once the MongoDBMonitor ZenPack is installed you will have the following new zProperties which should be set either for device classes or individual devices.
zMongoDBPortPort where MongoDBMonitor is listening. Default:
27017zMongoDBUsernameValid Mongo username. No default.
zMongoDBPasswordPassword for user. No default.
zMongoDBSSLEnableWhether to use SSL for connections (see below). Default:
falsezMongoDBMechanismAuthentication mechanism. Default:
SCRAM-SHA-1Possible values: (SCRAM-SHA-1|SCRAM-SHA-256|MONGODB-CR|MONGODB-X509|PLAIN)zMongoDBTLSCertificateKeyContentContent of client certificafile (.pem). No default.
zMongoDBTLSCAContentContent of root Certificate Authoricertificate file (.pem). No default.
zMongoDBHostsList of hostnames, including port. Hosts must be members of the same replica set or mongos instances in the same sharded cluster. No default.
zMongoDBDeploymentType of MongoDB deployment. Default:
Standalone ServerPossible values: (Standalone Server|Replica Set|Sharded Cluster)
In order to use TLS/SSL authentication zMongoDBSSLEnable must be set to true, zMongoDBMechanism should be set to MONGODB-X509, zMongoDBTLSCertificateKeyContent and zMongoDBTLSCAContent should be filled in with valid content data of appropriate certificates.
zMongoDBDeployment property should be configured according to the deployment type of MongoDB. If the deployment type of the server is changed, the value of this property should be updated in order to connect to MongoDB correctly.
In addition to setting these properties, you must add the zenoss.Mongo modeler plugin to a device class or individual device. This modeler plugin will discover all databases using the connectivity information provided through the above settings.
This ZenPack attempts to cache information locally for a short amount of time to avoid multiple, redundant calls to Mongo. If the cached data is older than one minute, it will request fresh information over the network.
Note
Only databases that authenticate against the provided username and password will be modeled and monitored.
Effects of Monitoring
The MongoDBMonitor ZenPack attempts to run lightweight commands for both monitoring and modeling. Monitored MongoDB servers should not be adversely affected by these commands.
Monitoring
By default, the following commands are run every five (5) minutes (300 seconds).
Purpose | Command | Repeats |
|---|---|---|
Server statistics |
| No |
Database statistics |
| Once per database |
Modeling
The following queries will be run whenever the MongoDBMonitor server device is remodeled. By default, this occurs once every 24 hours for Virtana Service Observability and every 12 hours for Virtana Service Dynamics.
Purpose | Command | Repeats |
|---|---|---|
Server attributes |
| Remodel interval |
Database attributes |
| Remodel interval |
Replica Set
To start monitoring a replica set the following properties should be configured:
zMongoDBDeployment - should be set to
Replica SetvaluezMongoDBHosts - (optional) a list of hostnames, including port (must be members of the same replica set) can be provided in the following format:
hostname1:portNumber nostname2:portNumber
MongoS Server Status
To begin modeling and monitoring MongoS Servers
add the SSH enabled device where the MongoDB Shell is configured with access to MongoDB deployments.
zCommandUsername and zCommandPassword should be set to allow for command collection and SSH access on the device.
zMongoDBUsername and zMongoDBPassword should be set if the MongoDB Shell requires authentication for shell commands.
Modeled mongoS servers will update their status every five (5) minutes.
Note
If a mongoS server becomes inactive, only one event will be sent per down mongoS server. If the event is deleted or lost a new event will only be sent again if the device goes from an active state -> inactive state.
Status down events need to be cleared manually; if the device goes from inactive -> active, the event will NOT clear automatically.
Changes
2.1.0
Features
SVC-2940: Support for MongoS Status
SVC-2939: Support for Replica Sets
SVC-2937: Support for certificate-based authentication for SSL databases
SVC-2938: Support for Plain authentication using AD credentials
SVC-3058: Add documentation to build .rst file
SVC-3450: Upgrade PyMongo from 3.7.0 to 3.12.3
2.0.0
Features
Zenpack is rewritten using zenpacklib
1.2.0
Fixes
Fix traceback when monitoring an instance that is also part of a cluster.
1.1.0
Features
Upgraded
pymongofrom 2.5.1 to 3.7.0Added new zProperty zMongoDBMechanism with default value of
SCRAM-SHA-1Removed datapoints
mongoCursorsTotalOpenmongoCursorsClientCursorsSizemongoCursorsTimedOutmongoHeapUsageBytes
Notice
This ZenPack includes the Mongo Python Driver (pymongo), originally authored by Mike Dirolf, and licensed under the Apache 2.0 license. Please note that the license only applies to the Python Mongo Driver, not to the MongoDBMonitor ZenPack itself. The ZenPack simply includes the Python Mongo Driver (according to the Apache 2.0 license), but is not subject to the same conditions.