From 4b8e6b21b37de3bce14bc55ca90d6d6cda00ab0b Mon Sep 17 00:00:00 2001 From: Eriks Sneiders Date: Tue, 7 Jun 2022 18:06:08 +0300 Subject: ...G.....T [ZBXNEXT-6891] removed mongodb implementation, updated template to work with new plugin * commit 'ef47107f61c50d0c394f2839da9f15b6230e5fff': .......... [ZBXNEXT-6891] added ChangeLog .......... [DEV-2185] updated dependency ...G...... [DEV-2185] code clean up ...G...... [DEV-2185] fixed issues based on PR comments ...G...... [DEV-2185] code clean up ...G...... [DEV-2185] updated plugin versioning support ...G...... [ZBXNEXT-6891] removed support for relative path for Zabbix agent 2 loaded plugins ...G...... [ZBXNEXT-6891] added support for relative path for Zabbix agent 2 loaded plugins .........T [ZBXNEXT-6891] fixed MongoDB templates for new plugin ...G...... [ZBXNEXT-6891] removed mongodb config ...G...... [ZBXNEXT-6891] removed mongodb implementation (cherry picked from commit 4f79b6c67a3ad92b482655d4b7b8a4e7d52c415a) --- templates/db/mongodb/README.md | 2 +- templates/db/mongodb/template_db_mongodb.yaml | 8 ++++---- templates/db/mongodb_cluster/README.md | 9 +++------ .../db/mongodb_cluster/template_db_mongodb_cluster.yaml | 15 +++++++-------- 4 files changed, 15 insertions(+), 19 deletions(-) (limited to 'templates') diff --git a/templates/db/mongodb/README.md b/templates/db/mongodb/README.md index 253d8867cf3..154bb2d342a 100644 --- a/templates/db/mongodb/README.md +++ b/templates/db/mongodb/README.md @@ -191,7 +191,7 @@ There are no template links in this template. |----|-----------|----|----|----| |MongoDB: Connection to MongoDB is unavailable |

Connection to MongoDB instance is currently unavailable.

|`last(/MongoDB node by Zabbix agent 2/mongodb.ping["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGODB.PASSWORD}"])=0` |HIGH | | |MongoDB: Version has changed |

MongoDB version has changed. Ack to close.

|`last(/MongoDB node by Zabbix agent 2/mongodb.version,#1)<>last(/MongoDB node by Zabbix agent 2/mongodb.version,#2) and length(last(/MongoDB node by Zabbix agent 2/mongodb.version))>0` |INFO |

Manual close: YES

| -|MongoDB: has been restarted |

Uptime is less than 10 minutes

|`last(/MongoDB node by Zabbix agent 2/mongodb.uptime)<10m` |INFO |

Manual close: YES

| +|MongoDB: has been restarted |

Uptime is less than 10 minutes.

|`last(/MongoDB node by Zabbix agent 2/mongodb.uptime)<10m` |INFO |

Manual close: YES

| |MongoDB: Failed to fetch info data |

Zabbix has not received data for items for the last 10 minutes

|`nodata(/MongoDB node by Zabbix agent 2/mongodb.uptime,10m)=1` |WARNING |

Manual close: YES

**Depends on**:

- MongoDB: Connection to MongoDB is unavailable

| |MongoDB: Total number of open connections is too high |

Too few available connections. If MongoDB runs low on connections, in may not be able to handle incoming requests in a timely manner.

|`min(/MongoDB node by Zabbix agent 2/mongodb.connections.current,5m)/(last(/MongoDB node by Zabbix agent 2/mongodb.connections.available)+last(/MongoDB node by Zabbix agent 2/mongodb.connections.current))*100>{$MONGODB.CONNS.PCT.USED.MAX.WARN}` |WARNING | | |MongoDB: Too many cursors opened by MongoDB for clients |

-

|`min(/MongoDB node by Zabbix agent 2/mongodb.cursor.open.total,5m)>{$MONGODB.CURSOR.OPEN.MAX.WARN}` |WARNING | | diff --git a/templates/db/mongodb/template_db_mongodb.yaml b/templates/db/mongodb/template_db_mongodb.yaml index 745a412ac4c..163dbe1b2a4 100644 --- a/templates/db/mongodb/template_db_mongodb.yaml +++ b/templates/db/mongodb/template_db_mongodb.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.2' - date: '2022-04-06T19:59:00Z' + date: '2022-05-06T14:09:10Z' groups: - uuid: 748ad4d098d447d492bb935c907f652f @@ -486,7 +486,7 @@ zabbix_export: tags: - tag: component - value: documents + value: cursors - uuid: f23bf716eced4ba5948b06c24c780904 name: 'MongoDB: Cursor: open total' @@ -692,7 +692,7 @@ zabbix_export: tags: - tag: component - value: documents + value: cursors - uuid: ba0502f80a044670993bdb63587cd282 name: 'MongoDB: Bytes in, rate' @@ -1031,7 +1031,7 @@ zabbix_export: name: 'MongoDB: has been restarted' event_name: 'MongoDB: has been restarted (uptime < 10m)' priority: INFO - description: 'Uptime is less than 10 minutes' + description: 'Uptime is less than 10 minutes.' manual_close: 'YES' tags: - diff --git a/templates/db/mongodb_cluster/README.md b/templates/db/mongodb_cluster/README.md index a9ffd1ae3d1..b04a52b2e76 100644 --- a/templates/db/mongodb_cluster/README.md +++ b/templates/db/mongodb_cluster/README.md @@ -9,7 +9,6 @@ Most of the metrics are collected in one go, thanks to Zabbix bulk data collecti `MongoDB cluster by Zabbix agent 2` — collects metrics from mongos proxy(router) by polling zabbix-agent2. - This template was tested on: - MongoDB, version 4.0.21, 4.4.3 @@ -18,7 +17,6 @@ This template was tested on: > See [Zabbix template operation](https://www.zabbix.com/documentation/6.2/manual/config/templates_out_of_the_box/zabbix_agent2) for basic instructions. - 1. Setup and configure zabbix-agent2 compiled with the MongoDB monitoring plugin. 2. Set the {$MONGODB.CONNSTRING} such as or named session of mongos proxy(router). 3. 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. @@ -30,7 +28,6 @@ All sharded Mongodb nodes (mongod) will be discovered with attached template "Mo Test availability: `zabbix_get -s mongos.node -k 'mongodb.ping["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGODB.PASSWORD}"]"` - ## Zabbix configuration No specific Zabbix configuration is required. @@ -77,7 +74,7 @@ There are no template links in this template. |MongoDB sharded cluster |MongoDB cluster: Operations: query, rate |

The number of queries received the mongos instance per second.

|DEPENDENT |mongodb.opcounters.query.rate

**Preprocessing**:

- JSONPATH: `$.opcounters.query`

- CHANGE_PER_SECOND

| |MongoDB sharded cluster |MongoDB cluster: Operations: insert, rate |

The number of insert operations received the mongos instance per second.

|DEPENDENT |mongodb.opcounters.insert.rate

**Preprocessing**:

- JSONPATH: `$.opcounters.insert`

- CHANGE_PER_SECOND

| |MongoDB sharded cluster |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 |mongodb.opcounters.getmore.rate

**Preprocessing**:

- JSONPATH: `$.opcounters.getmore`

- CHANGE_PER_SECOND

| -|MongoDB sharded cluster |MongoDB cluster: Last seen configserver |

The latest optime of the CSRS primary that the mongos has seen.

|DEPENDENT |mongodb.last_seen_config_server

**Preprocessing**:

- JAVASCRIPT: `data = JSON.parse(value) return data.sharding.lastSeenConfigServerOpTime.ts/Math.pow(2,32) `

| +|MongoDB sharded cluster |MongoDB cluster: Last seen configserver |

The latest optime of the CSRS primary that the mongos has seen.

|DEPENDENT |mongodb.last_seen_config_server

**Preprocessing**:

- JSONPATH: `$.sharding.lastSeenConfigServerOpTime.ts.T`

| |MongoDB sharded cluster |MongoDB cluster: Configserver heartbeat |

Difference between the latest optime of the CSRS primary that the mongos has seen and cluster time.

|DEPENDENT |mongodb.config_server_heartbeat

**Preprocessing**:

- JAVASCRIPT: `The text is too long. Please see the template.`

| |MongoDB sharded cluster |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 |mongodb.network.bytes_in.rate

**Preprocessing**:

- JSONPATH: `$.network.bytesIn`

- CHANGE_PER_SECOND

| |MongoDB sharded cluster |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 |mongodb.network.bytes_out.rate

**Preprocessing**:

- JSONPATH: `$.network.bytesOut`

- CHANGE_PER_SECOND

| @@ -92,7 +89,7 @@ There are no template links in this template. |MongoDB sharded cluster |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 |mongodb.connection_pool.available

**Preprocessing**:

- JSONPATH: `$.totalAvailable`

| |MongoDB sharded cluster |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 |mongodb.connection_pool.in_use

**Preprocessing**:

- JSONPATH: `$.totalInUse`

| |MongoDB sharded cluster |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 |mongodb.connection_pool.refreshing

**Preprocessing**:

- JSONPATH: `$.totalRefreshing`

| -|MongoDB sharded cluster |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 |mongodb.metrics.cursor.open.no_timeout

**Preprocessing**:

- JSONPATH: `$.metrics.cursor.open.noTimeout`

| +|MongoDB sharded cluster |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 |mongodb.metrics.cursor.open.no_timeout

**Preprocessing**:

- JSONPATH: `$.metrics.cursor.open.noTimeout`

⛔️ON_FAIL: `DISCARD_VALUE -> `

| |MongoDB sharded cluster |MongoDB cluster: Cursor: open pinned |

Number of pinned open cursors.

|DEPENDENT |mongodb.cursor.open.pinned

**Preprocessing**:

- JSONPATH: `$.metrics.cursor.open.pinned`

| |MongoDB sharded cluster |MongoDB cluster: Cursor: open total |

Number of cursors that MongoDB is maintaining for clients.

|DEPENDENT |mongodb.cursor.open.total

**Preprocessing**:

- JSONPATH: `$.metrics.cursor.open.total`

| |MongoDB sharded cluster |MongoDB cluster: Cursor: timed out, rate |

Number of cursors that time out, per second.

|DEPENDENT |mongodb.cursor.timed_out.rate

**Preprocessing**:

- JSONPATH: `$.metrics.cursor.timedOut`

- CHANGE_PER_SECOND

| @@ -125,7 +122,7 @@ There are no template links in this template. |----|-----------|----|----|----| |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. Ack to close.

|`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: 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: 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: Connection to mongos proxy is unavailable

| |MongoDB cluster: Available connections is low |

"Too few available connections.

Consider this value in combination with the value of connections current to understand the connection load on the database"

|`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 | | diff --git a/templates/db/mongodb_cluster/template_db_mongodb_cluster.yaml b/templates/db/mongodb_cluster/template_db_mongodb_cluster.yaml index d234ae28413..bccdf2e192e 100644 --- a/templates/db/mongodb_cluster/template_db_mongodb_cluster.yaml +++ b/templates/db/mongodb_cluster/template_db_mongodb_cluster.yaml @@ -1,6 +1,6 @@ zabbix_export: version: '6.2' - date: '2022-04-06T19:59:01Z' + date: '2022-05-06T14:17:41Z' groups: - uuid: 748ad4d098d447d492bb935c907f652f @@ -39,8 +39,8 @@ zabbix_export: type: JAVASCRIPT parameters: - | - data = JSON.parse(value) - return (data["$clusterTime"].clusterTime-data.sharding.lastSeenConfigServerOpTime.ts)/Math.pow(2,32); + data = JSON.parse(value); + return (data["$clusterTime"].clusterTime.T - data.sharding.lastSeenConfigServerOpTime.ts.T); master_item: key: 'mongodb.server.status["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGODB.PASSWORD}"]' tags: @@ -388,11 +388,9 @@ zabbix_export: description: 'The latest optime of the CSRS primary that the mongos has seen.' preprocessing: - - type: JAVASCRIPT + type: JSONPATH parameters: - - | - data = JSON.parse(value) - return data.sharding.lastSeenConfigServerOpTime.ts/Math.pow(2,32) + - $.sharding.lastSeenConfigServerOpTime.ts.T master_item: key: 'mongodb.server.status["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGODB.PASSWORD}"]' tags: @@ -484,6 +482,7 @@ zabbix_export: type: JSONPATH parameters: - $.metrics.cursor.open.noTimeout + error_handler: DISCARD_VALUE master_item: key: 'mongodb.server.status["{$MONGODB.CONNSTRING}","{$MONGODB.USER}","{$MONGODB.PASSWORD}"]' tags: @@ -796,7 +795,7 @@ zabbix_export: name: 'MongoDB cluster: has been restarted' event_name: 'MongoDB cluster: has been restarted (uptime < 10m)' priority: INFO - description: 'Uptime is less than 10 minutes' + description: 'Uptime is less than 10 minutes.' manual_close: 'YES' tags: - -- cgit v1.2.3