yzl
93958d0fb0
|
1 year ago | |
---|---|---|
.. | ||
README.md | 1 year ago | |
template_db_mongodb_cluster.yaml | 1 year ago |
README.md
MongoDB cluster by Zabbix agent 2
Overview
The template to monitor MongoDB sharded cluster by Zabbix that work without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
MongoDB cluster by Zabbix agent 2
— collects metrics from mongos proxy(router) by polling zabbix-agent2.
Requirements
Zabbix version: 7.0 and higher.
Tested versions
This template has been tested on:
- MongoDB 4.0.21, 4.4.3
Configuration
Zabbix should be configured according to the instructions in the Templates out of the box section.
Setup
- Setup and configure zabbix-agent2 compiled with the MongoDB monitoring plugin.
- Set the {$MONGODB.CONNSTRING} such as <protocol(host:port)> or named session of mongos proxy(router).
- Set the user name and password in host macros ({$MONGODB.USER}, {$MONGODB.PASSWORD}) if you want to override parameters from the Zabbix agent configuration file.
Note, depending on the number of DBs and collections discovery operation may be expensive. Use filters with macros {$MONGODB.LLD.FILTER.DB.MATCHES}, {$MONGODB.LLD.FILTER.DB.NOT_MATCHES}, {$MONGODB.LLD.FILTER.COLLECTION.MATCHES}, {$MONGODB.LLD.FILTER.COLLECTION.NOT_MATCHES}.
All sharded Mongodb nodes (mongod) will be discovered with attached template "MongoDB node by Zabbix agent 2".
Test availability: zabbix_get -s mongos.node -k 'mongodb.ping["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGODB.PASSWORD}"]"
Macros used
Name | Description | Default |
---|---|---|
{$MONGODB.CONNSTRING} | Connection string in the URI format (password is not used). This param overwrites a value configured in the "Server" option of the configuration file (if it's set), otherwise, the plugin's default value is used: "tcp://localhost:27017" |
tcp://localhost:27017 |
{$MONGODB.USER} | MongoDB username |
|
{$MONGODB.PASSWORD} | MongoDB user password |
|
{$MONGODB.CONNS.AVAILABLE.MIN.WARN} | Minimum number of available connections |
1000 |
{$MONGODB.LLD.FILTER.COLLECTION.MATCHES} | Filter of discoverable collections |
.* |
{$MONGODB.LLD.FILTER.COLLECTION.NOT_MATCHES} | Filter to exclude discovered collections |
CHANGE_IF_NEEDED |
{$MONGODB.LLD.FILTER.DB.MATCHES} | Filter of discoverable databases |
.* |
{$MONGODB.LLD.FILTER.DB.NOT_MATCHES} | Filter to exclude discovered databases |
(admin|config|local) |
{$MONGODB.CURSOR.TIMEOUT.MAX.WARN} | Maximum number of cursors timing out per second |
1 |
{$MONGODB.CURSOR.OPEN.MAX.WARN} | Maximum number of open cursors |
10000 |
Items
Name | Description | Type | Key and additional info |
---|---|---|---|
MongoDB cluster: Get server status | The mongos statistic |
Zabbix agent | mongodb.server.status["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGODB.PASSWORD}"] |
MongoDB cluster: Get mongodb.connpool.stats | Returns current info about connpool.stats. |
Zabbix agent | mongodb.connpool.stats["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGODB.PASSWORD}"] |
MongoDB cluster: Ping | Test if a connection is alive or not. |
Zabbix agent | mongodb.ping["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGODB.PASSWORD}"] Preprocessing
|
MongoDB cluster: Jumbo chunks | Total number of 'jumbo' chunks in the mongo cluster. |
Zabbix agent | mongodb.jumbo_chunks.count["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGODB.PASSWORD}"] |
MongoDB cluster: Mongos version | Version of the Mongos server |
Dependent item | mongodb.version Preprocessing
|
MongoDB cluster: Uptime | Number of seconds since the Mongos server start. |
Dependent item | mongodb.uptime Preprocessing
|
MongoDB cluster: Operations: command | The number of commands issued to the database per second. Counts all commands except the write commands: insert, update, and delete. |
Dependent item | mongodb.opcounters.command.rate Preprocessing
|
MongoDB cluster: Operations: delete | The number of delete operations the mongos instance per second. |
Dependent item | mongodb.opcounters.delete.rate Preprocessing
|
MongoDB cluster: Operations: update, rate | The number of update operations the mongos instance per second. |
Dependent item | mongodb.opcounters.update.rate Preprocessing
|
MongoDB cluster: Operations: query, rate | The number of queries received the mongos instance per second. |
Dependent item | mongodb.opcounters.query.rate Preprocessing
|
MongoDB cluster: Operations: insert, rate | The number of insert operations received the mongos instance per second. |
Dependent item | mongodb.opcounters.insert.rate Preprocessing
|
MongoDB cluster: Operations: getmore, rate | The number of "getmore" operations the mongos per second. This counter can be high even if the query count is low. Secondary nodes send getMore operations as part of the replication process. |
Dependent item | mongodb.opcounters.getmore.rate Preprocessing
|
MongoDB cluster: Last seen configserver | The latest optime of the CSRS primary that the mongos has seen. |
Dependent item | mongodb.last_seen_config_server Preprocessing
|
MongoDB cluster: Configserver heartbeat | Difference between the latest optime of the CSRS primary that the mongos has seen and cluster time. |
Dependent item | mongodb.config_server_heartbeat Preprocessing
|
MongoDB cluster: Bytes in, rate | The total number of bytes that the server has received over network connections initiated by clients or other mongod/mongos instances per second. |
Dependent item | mongodb.network.bytes_in.rate Preprocessing
|
MongoDB cluster: Bytes out, rate | The total number of bytes that the server has sent over network connections initiated by clients or other mongod/mongos instances per second. |
Dependent item | mongodb.network.bytes_out.rate Preprocessing
|
MongoDB cluster: Requests, rate | Number of distinct requests that the server has received per second. |
Dependent item | mongodb.network.numRequests.rate Preprocessing
|
MongoDB cluster: Connections, current | The number of incoming connections from clients to the database server. This number includes the current shell session. |
Dependent item | mongodb.connections.current Preprocessing
|
MongoDB cluster: New connections, rate | "Rate of all incoming connections created to the server." |
Dependent item | mongodb.connections.rate Preprocessing
|
MongoDB cluster: Connections, active | The number of active client connections to the server. Active client connections refers to client connections that currently have operations in progress. Available starting in 4.0.7, 0 for older versions. |
Dependent item | mongodb.connections.active Preprocessing
|
MongoDB cluster: Connections, available | "The number of unused incoming connections available." |
Dependent item | mongodb.connections.available Preprocessing
|
MongoDB cluster: Connection pool: client connections | The number of active and stored outgoing synchronous connections from the current mongos instance to other members of the sharded cluster. |
Dependent item | mongodb.connection_pool.client Preprocessing
|
MongoDB cluster: Connection pool: scoped | Number of active and stored outgoing scoped synchronous connections from the current mongos instance to other members of the sharded cluster. |
Dependent item | mongodb.connection_pool.scoped Preprocessing
|
MongoDB cluster: Connection pool: created, rate | The total number of outgoing connections created per second by the current mongos instance to other members of the sharded cluster. |
Dependent item | mongodb.connection_pool.created.rate Preprocessing
|
MongoDB cluster: Connection pool: available | The total number of available outgoing connections from the current mongos instance to other members of the sharded cluster. |
Dependent item | mongodb.connection_pool.available Preprocessing
|
MongoDB cluster: Connection pool: in use | Reports the total number of outgoing connections from the current mongos instance to other members of the sharded cluster set that are currently in use. |
Dependent item | mongodb.connection_pool.in_use Preprocessing
|
MongoDB cluster: Connection pool: refreshing | Reports the total number of outgoing connections from the current mongos instance to other members of the sharded cluster that are currently being refreshed. |
Dependent item | mongodb.connection_pool.refreshing Preprocessing
|
MongoDB cluster: Cursor: open no timeout | Number of open cursors with the option DBQuery.Option.noTimeout set to prevent timeout after a period of inactivity. |
Dependent item | mongodb.metrics.cursor.open.no_timeout Preprocessing
|
MongoDB cluster: Cursor: open pinned | Number of pinned open cursors. |
Dependent item | mongodb.cursor.open.pinned Preprocessing
|
MongoDB cluster: Cursor: open total | Number of cursors that MongoDB is maintaining for clients. |
Dependent item | mongodb.cursor.open.total Preprocessing
|
MongoDB cluster: Cursor: timed out, rate | Number of cursors that time out, per second. |
Dependent item | mongodb.cursor.timed_out.rate Preprocessing
|
MongoDB cluster: Architecture | A number, either 64 or 32, that indicates whether the MongoDB instance is compiled for 64-bit or 32-bit architecture. |
Dependent item | mongodb.mem.bits Preprocessing
|
MongoDB cluster: Memory: resident | Amount of memory currently used by the database process. |
Dependent item | mongodb.mem.resident Preprocessing
|
MongoDB cluster: Memory: virtual | Amount of virtual memory used by the mongos process. |
Dependent item | mongodb.mem.virtual Preprocessing
|
Triggers
Name | Description | Expression | Severity | Dependencies and additional info |
---|---|---|---|---|
MongoDB cluster: Connection to mongos proxy is unavailable | Connection to mongos proxy instance is currently unavailable. |
last(/MongoDB cluster by Zabbix agent 2/mongodb.ping["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGODB.PASSWORD}"])=0 |
High | |
MongoDB cluster: Version has changed | MongoDB cluster version has changed. Acknowledge to close the problem manually. |
last(/MongoDB cluster by Zabbix agent 2/mongodb.version,#1)<>last(/MongoDB cluster by Zabbix agent 2/mongodb.version,#2) and length(last(/MongoDB cluster by Zabbix agent 2/mongodb.version))>0 |
Info | Manual close: Yes |
MongoDB cluster: Mongos server has been restarted | Uptime is less than 10 minutes. |
last(/MongoDB cluster by Zabbix agent 2/mongodb.uptime)<10m |
Info | Manual close: Yes |
MongoDB cluster: Failed to fetch info data | Zabbix has not received data for items for the last 10 minutes |
nodata(/MongoDB cluster by Zabbix agent 2/mongodb.uptime,10m)=1 |
Warning | Manual close: Yes Depends on:
|
MongoDB cluster: Available connections is low | Too few available connections. |
max(/MongoDB cluster by Zabbix agent 2/mongodb.connections.available,5m)<{$MONGODB.CONNS.AVAILABLE.MIN.WARN} |
Warning | |
MongoDB cluster: Too many cursors opened by MongoDB for clients | min(/MongoDB cluster by Zabbix agent 2/mongodb.cursor.open.total,5m)>{$MONGODB.CURSOR.OPEN.MAX.WARN} |
Warning | ||
MongoDB cluster: Too many cursors are timing out | min(/MongoDB cluster by Zabbix agent 2/mongodb.cursor.timed_out.rate,5m)>{$MONGODB.CURSOR.TIMEOUT.MAX.WARN} |
Warning |
LLD rule Database discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Database discovery | Collect database metrics. Note, depending on the number of DBs this discovery operation may be expensive. Use filters with macros {$MONGODB.LLD.FILTER.DB.MATCHES}, {$MONGODB.LLD.FILTER.DB.NOT_MATCHES}. |
Zabbix agent | mongodb.db.discovery["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGODB.PASSWORD}"] |
Item prototypes for Database discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
MongoDB {#DBNAME}: Get db stats {#DBNAME} | Returns statistics reflecting the database system's state. |
Zabbix agent | mongodb.db.stats["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGODB.PASSWORD}","{#DBNAME}"] |
MongoDB {#DBNAME}: Objects, avg size | The average size of each document in bytes. |
Dependent item | mongodb.db.size["{#DBNAME}"] Preprocessing
|
MongoDB {#DBNAME}: Size, data | Total size of the data held in this database including the padding factor. |
Dependent item | mongodb.db.data_size["{#DBNAME}"] Preprocessing
|
MongoDB {#DBNAME}: Size, file | Total size of the data held in this database including the padding factor (only available with the mmapv1 storage engine). |
Dependent item | mongodb.db.file_size["{#DBNAME}"] Preprocessing
|
MongoDB {#DBNAME}: Size, index | Total size of all indexes created on this database. |
Dependent item | mongodb.db.index_size["{#DBNAME}"] Preprocessing
|
MongoDB {#DBNAME}: Size, storage | Total amount of space allocated to collections in this database for document storage. |
Dependent item | mongodb.db.storage_size["{#DBNAME}"] Preprocessing
|
MongoDB {#DBNAME}: Objects, count | Number of objects (documents) in the database across all collections. |
Dependent item | mongodb.db.objects["{#DBNAME}"] Preprocessing
|
MongoDB {#DBNAME}: Extents | Contains a count of the number of extents in the database across all collections. |
Dependent item | mongodb.db.extents["{#DBNAME}"] Preprocessing
|
LLD rule Collection discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Collection discovery | Collect collections metrics. Note, depending on the number of DBs and collections this discovery operation may be expensive. Use filters with macros {$MONGODB.LLD.FILTER.DB.MATCHES}, {$MONGODB.LLD.FILTER.DB.NOT_MATCHES}, {$MONGODB.LLD.FILTER.COLLECTION.MATCHES}, {$MONGODB.LLD.FILTER.COLLECTION.NOT_MATCHES}. |
Zabbix agent | mongodb.collections.discovery["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGODB.PASSWORD}"] |
Item prototypes for Collection discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
MongoDB {#DBNAME}.{#COLLECTION}: Get collection stats {#DBNAME}.{#COLLECTION} | Returns a variety of storage statistics for a given collection. |
Zabbix agent | mongodb.collection.stats["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGODB.PASSWORD}","{#DBNAME}","{#COLLECTION}"] |
MongoDB {#DBNAME}.{#COLLECTION}: Size | The total size in bytes of the data in the collection plus the size of every indexes on the mongodb.collection. |
Dependent item | mongodb.collection.size["{#DBNAME}","{#COLLECTION}"] Preprocessing
|
MongoDB {#DBNAME}.{#COLLECTION}: Objects, avg size | The size of the average object in the collection in bytes. |
Dependent item | mongodb.collection.avg_obj_size["{#DBNAME}","{#COLLECTION}"] Preprocessing
|
MongoDB {#DBNAME}.{#COLLECTION}: Objects, count | Total number of objects in the collection. |
Dependent item | mongodb.collection.count["{#DBNAME}","{#COLLECTION}"] Preprocessing
|
MongoDB {#DBNAME}.{#COLLECTION}: Capped, max number | Maximum number of documents in a capped collection. |
Dependent item | mongodb.collection.max["{#DBNAME}","{#COLLECTION}"] Preprocessing
|
MongoDB {#DBNAME}.{#COLLECTION}: Capped, max size | Maximum size of a capped collection in bytes. |
Dependent item | mongodb.collection.max_size["{#DBNAME}","{#COLLECTION}"] Preprocessing
|
MongoDB {#DBNAME}.{#COLLECTION}: Storage size | Total storage space allocated to this collection for document storage. |
Dependent item | mongodb.collection.storage_size["{#DBNAME}","{#COLLECTION}"] Preprocessing
|
MongoDB {#DBNAME}.{#COLLECTION}: Indexes | Total number of indices on the collection. |
Dependent item | mongodb.collection.nindexes["{#DBNAME}","{#COLLECTION}"] Preprocessing
|
MongoDB {#DBNAME}.{#COLLECTION}: Capped | Whether or not the collection is capped. |
Dependent item | mongodb.collection.capped["{#DBNAME}","{#COLLECTION}"] Preprocessing
|
LLD rule Shards discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Shards discovery | Discovery shared cluster hosts. |
Zabbix agent | mongodb.sh.discovery["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGODB.PASSWORD}"] |
LLD rule Config servers discovery
Name | Description | Type | Key and additional info |
---|---|---|---|
Config servers discovery | Discovery shared cluster config servers. |
Zabbix agent | mongodb.cfg.discovery["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGODB.PASSWORD}"] |
Feedback
Please report any issues with the template at https://support.zabbix.com
You can also provide feedback, discuss the template, or ask for help at ZABBIX forums