MongoDB default checks and policies
Agent Client Collector provides the following policies for MongoDB health monitoring. Policies come with the checks specified in the indicated table. Policies and checks are available for both Windows and Linux.
| Type | Check | Description | Usage | Command | Output |
|---|---|---|---|---|---|
| Event | app.mongodb.check-mongodb-alive | Monitors whether the MongoDB server is alive and creating alerts for the MongoDB server health status. |
Usage example: | `commonchecks check-mongodb -p {{.labels.params_port}} -H {{.labels.params_host}}` | `Check mongodb Alive OK`: Indicates that the server is in good health. |
| Event | app.mongodb.check-mongodb-metrics | Creates alerts for any of the MongoDB metrics, based on the threshold limit. To trigger the alerts for any MongoDB server metric, pass the whole metric name in the parameter. |
Usage example: | `commonchecks check-mongodb-metrics -c {{.labels.params_critical}} -d {{.labels.params_database}} -w {{.labels.params_warning}} -H {{.labels.params_host}} -p {{.labels.params_port}} -m {{.labels.params_metric}}` | `Check mongodb Metrics OK`: Indicates that the `mongodb.connection.current` value is within the acceptable threshold. |
| Type | Check | Description | Usage | Command | Output |
|---|---|---|---|---|---|
| Metric | app.mongodb.metrics-mongodb | Returns metrics of the MongoDB server and all databases.Sample metrics: - `mongodb.connections.totalCreated`: Incoming connections - `mongodb.locks.Database.acquireCount_IX`: Intent Exclusive lock mode - `mongodb.locks.Database.acquireCount_X`: Exclusive lock mode - `mongodb.locks.Database.acquireCount_IS`: Intent shared lock mode | `commonchecks check-mongodb` Where: - `host` = Hostname where the MongoDB server is running. - `port` = Port to connect to the MongoDB server. - `database` = Database name. | `commonchecks metrics-mongodb -p {{.labels.params_port}} -H {{.labels.params_host}} -d {{.labels.params_database}}` | ` Parent Topic:Agent Client Collector Monitoring default checks and policies |