From c5434d842c85f0d44af210949411e22ca41f764d Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Tue, 9 Jul 2024 14:03:58 +0400 Subject: [PATCH 01/28] feature: add grafana dashboard - Add Grafana Dashboard for Postgresql metrics emitted from mamonsu credits go to @konstantin-kornienko --- ...pro-postgresql-mamonsu-dashboard_rev1.json | 18843 ++++++++++++++++ 1 file changed, 18843 insertions(+) create mode 100644 grafana/dashboards/postgrespro-postgresql-mamonsu-dashboard_rev1.json diff --git a/grafana/dashboards/postgrespro-postgresql-mamonsu-dashboard_rev1.json b/grafana/dashboards/postgrespro-postgresql-mamonsu-dashboard_rev1.json new file mode 100644 index 0000000..698261f --- /dev/null +++ b/grafana/dashboards/postgrespro-postgresql-mamonsu-dashboard_rev1.json @@ -0,0 +1,18843 @@ +{ + "__inputs": [ + { + "name": "DS_ZABBIX", + "label": "Zabbix", + "description": "", + "type": "datasource", + "pluginId": "alexanderzobnin-zabbix-datasource", + "pluginName": "Zabbix" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "datasource", + "id": "alexanderzobnin-zabbix-datasource", + "name": "Zabbix", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "alexanderzobnin-zabbix-triggers-panel", + "name": "Zabbix Problems", + "version": "" + }, + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "state-timeline", + "name": "State timeline", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "enable": true, + "iconColor": "red", + "name": "PostgreSQL problems", + "target": { + "application": { + "filter": "" + }, + "fromAnnotations": true, + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "options": { + "hideAcknowledged": false, + "minSeverity": 0, + "showHostname": true, + "showOkEvents": true + }, + "trigger": { + "filter": "/^PostgreSQL /" + } + } + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "enable": true, + "iconColor": "yellow", + "name": "Mamonsu problems", + "target": { + "application": { + "filter": "" + }, + "fromAnnotations": true, + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "options": { + "hideAcknowledged": false, + "minSeverity": 0, + "showHostname": true, + "showOkEvents": true + }, + "trigger": { + "filter": "/^Mamonsu /" + } + } + } + ] + }, + "description": "Version 1.0. Visualizes PostgreSQL metrics collected by Mamonsu.\n\nZabbix: https://zabbix.com\nMamonsu: https://github.com/postgrespro/mamonsu\n", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, + "id": null, + "links": [ + { + "asDropdown": false, + "icon": "info", + "includeVars": false, + "keepTime": false, + "tags": [], + "targetBlank": true, + "title": "Mamonsu metrics", + "tooltip": "", + "type": "link", + "url": "https://github.com/postgrespro/mamonsu/blob/master/documentation/metrics.md" + } + ], + "panels": [ + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 51, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "", + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 52, + "options": { + "ackEventColor": "rgb(56, 219, 156)", + "ackField": true, + "ageField": false, + "allowDangerousHTML": false, + "customLastChangeFormat": false, + "descriptionAtNewLine": false, + "descriptionField": true, + "fontSize": "100%", + "highlightBackground": false, + "highlightNewEvents": false, + "highlightNewerThan": "1h", + "hostField": true, + "hostGroups": false, + "hostProxy": false, + "hostTechNameField": false, + "lastChangeFormat": "", + "layout": "table", + "markAckEvents": false, + "okEventColor": "rgb(56, 189, 113)", + "opdataField": false, + "pageSize": 5, + "problemTimeline": true, + "severityField": true, + "showTags": true, + "sortProblems": "lastchange", + "statusField": true, + "statusIcon": false, + "triggerSeverity": [ + { + "color": "rgb(108, 108, 108)", + "priority": 0, + "severity": "Not classified", + "show": true + }, + { + "color": "rgb(120, 158, 183)", + "priority": 1, + "severity": "Information", + "show": true + }, + { + "color": "rgb(175, 180, 36)", + "priority": 2, + "severity": "Warning", + "show": true + }, + { + "color": "rgb(255, 137, 30)", + "priority": 3, + "severity": "Average", + "show": true + }, + { + "color": "rgb(255, 101, 72)", + "priority": 4, + "severity": "High", + "show": true + }, + { + "color": "rgb(215, 0, 0)", + "priority": 5, + "severity": "Disaster", + "show": true + } + ] + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "acknowledged": 2, + "count": false, + "disableDataAlignment": false, + "hostProxy": false, + "hostsInMaintenance": false, + "limit": 1001, + "minSeverity": 0, + "showDisabledItems": false, + "skipEmptyValues": false, + "sortProblems": "default", + "useTimeRange": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "5", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "showProblems": "problems", + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "/^(PostgreSQL|Mamonsu) /" + } + } + ], + "type": "alexanderzobnin-zabbix-triggers-panel" + } + ], + "title": "Zabbix Problems", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 54, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "fixed" + }, + "custom": { + "fillOpacity": 70, + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": 120000, + "lineWidth": 0, + "spanNulls": false + }, + "mappings": [ + { + "options": { + "0": { + "color": "dark-green", + "index": 0, + "text": "UP" + } + }, + "type": "value" + }, + { + "options": { + "match": "null", + "result": { + "color": "dark-red", + "index": 1, + "text": "DOWN" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "text" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 12, + "x": 0, + "y": 10 + }, + "hideTimeOverride": true, + "id": 57, + "options": { + "alignValue": "center", + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "mergeValues": true, + "rowHeight": 0.9, + "showValue": "always", + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "Mamonsu: Plugin Keep Alive" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Mamonsu plugin keepalive history", + "type": "state-timeline" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "text" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 12, + "x": 12, + "y": 10 + }, + "hideTimeOverride": true, + "id": 56, + "maxDataPoints": 3, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "Mamonsu: RSS Memory Max Usage" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "timeFrom": "1h", + "title": "Mamonsu plugin max used RSS memory", + "type": "stat" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "light-red" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 24, + "x": 0, + "y": 14 + }, + "hideTimeOverride": true, + "id": 55, + "maxDataPoints": 3, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "/^Mamonsu: Plugin Errors$/", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "Mamonsu: Plugin Errors" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "2", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "timeFrom": "1h", + "title": "Mamonsu plugin errors", + "type": "stat" + } + ], + "title": "Mamonsu", + "type": "row" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 2 + }, + "id": 7, + "panels": [], + "title": "Overview", + "type": "row" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Is Mamonsu plugin sending keepalives", + "fieldConfig": { + "defaults": { + "color": { + "mode": "fixed" + }, + "mappings": [ + { + "options": { + "0": { + "color": "dark-green", + "index": 0, + "text": "OK" + } + }, + "type": "value" + }, + { + "options": { + "match": "null", + "result": { + "color": "dark-red", + "index": 1, + "text": "DOWN" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "text", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 0, + "y": 3 + }, + "hideTimeOverride": true, + "id": 58, + "interval": "1m", + "maxDataPoints": 1, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [], + "group": { + "filter": "$group" + }, + "hide": false, + "host": { + "filter": "$host" + }, + "item": { + "filter": "Mamonsu: Plugin Keep Alive" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "B", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "timeFrom": "3m", + "title": "Mamonsu", + "type": "stat" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Is Postgres database is accessible by Mamonsu", + "fieldConfig": { + "defaults": { + "color": { + "mode": "fixed" + }, + "mappings": [ + { + "options": { + "from": 0, + "result": { + "color": "dark-green", + "index": 0, + "text": "OK" + }, + "to": 99999999 + }, + "type": "range" + }, + { + "options": { + "match": "null", + "result": { + "color": "dark-red", + "index": 1, + "text": "DOWN" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "text", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 2, + "y": 3 + }, + "hideTimeOverride": true, + "id": 59, + "interval": "1m", + "maxDataPoints": 1, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [], + "group": { + "filter": "$group" + }, + "hide": false, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Health: Ping" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "B", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "timeFrom": "3m", + "title": "DB ping", + "type": "stat" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 4, + "y": 3 + }, + "hideTimeOverride": true, + "id": 1, + "maxDataPoints": 3, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^PostgreSQL Health: Server Version$/", + "values": false + }, + "showPercentChange": false, + "text": {}, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Health: Server Version" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "2", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "timeFrom": "1h", + "title": "Server version", + "type": "stat" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "MASTER": { + "color": "dark-green", + "index": 0 + }, + "STANDBY": { + "color": "dark-yellow", + "index": 1 + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 6, + "y": 3 + }, + "hideTimeOverride": true, + "id": 103, + "maxDataPoints": 3, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "/^PostgreSQL Instance: Server Mode$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Instance: Server Mode" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "2", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "timeFrom": "1h", + "title": "Server mode", + "type": "stat" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Database uptime", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green", + "value": null + } + ] + }, + "unit": "dateTimeAsSystem" + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 8, + "y": 3 + }, + "hideTimeOverride": true, + "id": 2, + "maxDataPoints": 3, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + 100 + ], + "name": "scale", + "params": [ + { + "name": "factor", + "options": [ + 100, + 0.01, + 10, + -1 + ], + "type": "float" + } + ] + }, + "params": [ + "1000" + ], + "text": "scale(100)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Health: Service Uptime" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "timeFrom": "1h", + "title": "Database started", + "type": "stat" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 3, + "x": 11, + "y": 3 + }, + "hideTimeOverride": true, + "id": 13, + "maxDataPoints": 3, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Connections: Number of Total User Connections" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "timeFrom": "1h", + "title": "User Connections", + "type": "stat" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Cache Hit Ratio calculates as ratio between last value of Blocks hit and summa of last values of Blocks hit and Blocks read.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-red", + "value": null + }, + { + "color": "dark-orange", + "value": 95 + }, + { + "color": "dark-yellow", + "value": 98 + }, + { + "color": "dark-green", + "value": 99 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 2, + "x": 14, + "y": 3 + }, + "hideTimeOverride": true, + "id": 46, + "interval": "$interval", + "maxDataPoints": 3, + "options": { + "minVizHeight": 175, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": false, + "sizing": "auto" + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Health: Cache Hit Ratio" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "timeFrom": "1h", + "title": "Cache hit", + "type": "gauge" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Shows the database with the highest number of bloated table", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 16, + "y": 3 + }, + "hideTimeOverride": true, + "id": 39, + "interval": "1m", + "maxDataPoints": 10, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value_and_name", + "wideLayout": true + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Filter", + "defaultParams": [ + 5, + "avg" + ], + "name": "top", + "params": [ + { + "name": "number", + "type": "int" + }, + { + "name": "value", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "1", + "max" + ], + "text": "top(5, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^PostgreSQL Databases: (.+) size$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/^PostgreSQL Databases: $database size$/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Largest database", + "type": "stat" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Shows the database with the highest number of bloated table", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green", + "value": null + }, + { + "color": "#EAB839", + "value": 1 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 4, + "x": 20, + "y": 3 + }, + "hideTimeOverride": true, + "id": 37, + "interval": "1m", + "maxDataPoints": 10, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value_and_name", + "wideLayout": true + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Filter", + "defaultParams": [ + 5, + "avg" + ], + "name": "top", + "params": [ + { + "name": "number", + "type": "int" + }, + { + "name": "value", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "1", + "max" + ], + "text": "top(5, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.* Count of Bloating Tables in (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/^PostgreSQL Databases: Count of Bloating Tables in $database$/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Max number of bloated tables", + "type": "stat" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "1. Transactions committed rate\n2. Transaction rollback events per [$interval]", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green", + "value": null + } + ] + }, + "unit": "ops" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Rollback Events" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "semi-dark-red", + "mode": "fixed" + } + }, + { + "id": "unit" + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 6 + }, + "hideTimeOverride": true, + "id": 4, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [], + "name": "setAlias", + "params": [ + { + "name": "alias", + "type": "string" + } + ] + }, + "params": [ + "Transactions Commited rate" + ], + "text": "setAlias()" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Instance: Transactions Committed" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + }, + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [], + "name": "setAlias", + "params": [ + { + "name": "alias", + "type": "string" + } + ] + }, + "params": [ + "Rollback Events" + ], + "text": "setAlias()" + } + ], + "group": { + "filter": "$group" + }, + "hide": false, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Instance: Rollback Events" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "B", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Transactions rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Connections to the database by type", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "area" + } + }, + "mappings": [], + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "dark-green", + "value": null + }, + { + "color": "semi-dark-yellow", + "value": 75 + }, + { + "color": "red", + "value": 90 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Max Connections" + }, + "properties": [ + { + "id": "custom.lineWidth", + "value": 2 + }, + { + "id": "color", + "value": { + "fixedColor": "semi-dark-red", + "mode": "fixed" + } + }, + { + "id": "custom.lineStyle", + "value": { + "dash": [ + 5, + 5 + ], + "fill": "dash" + } + }, + { + "id": "custom.showPoints", + "value": "never" + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 6 + }, + "hideTimeOverride": true, + "id": 3, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/.*Number of (.*) Connections$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/Number of .* Connections$/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + }, + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [], + "name": "setAlias", + "params": [ + { + "name": "alias", + "type": "string" + } + ] + }, + "params": [ + "Max Connections" + ], + "text": "setAlias()" + } + ], + "group": { + "filter": "$group" + }, + "hide": false, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Connections: Max Connections" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "B", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Connections", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Tuples metrics use information from pg_stat_database.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 13 + }, + "hideTimeOverride": true, + "id": 14, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/^PostgreSQL Instance: Tuples/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Tuples rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Blocks Hit maps to blks_hit.\nBlocks Read maps to blks_read.\n\nBlocks metrics use information from pg_stat_database.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green", + "value": null + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 13 + }, + "hideTimeOverride": true, + "id": 29, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/PostgreSQL Instance: Blocks/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Blocks", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Cache Hit Ratio calculates as ratio between last value of Blocks hit and summa of last values of Blocks hit and Blocks read.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 19 + }, + "hideTimeOverride": true, + "id": 5, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "min", + "mean", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Health: Cache Hit Ratio" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Cache hit ratio", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Ping calculates as difference between ping query start time and time of receiving ping query result.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "fieldMinMax": false, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 19 + }, + "hideTimeOverride": true, + "id": 45, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "min", + "mean", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Health: Ping" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Query ping time", + "type": "timeseries" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 25 + }, + "id": 15, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Archiving metrics use information from pg_stat_archiver view.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "yellow", + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 26 + }, + "hideTimeOverride": true, + "id": 16, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "sum" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "sum" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "sum" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Archiver: Archived Files Count" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + }, + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "sum" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "sum" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "sum" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "hide": false, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Archiver: Attempts to Archive Files Count" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "B", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + }, + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "sum" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "sum" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "sum" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "hide": false, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Archiver: Files in archive_status Need to Archive Count" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "C", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": " Archived Status", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Size Of Files Need To Archive is calculated as difference between current WAL number and last archived WAL number multiplied by wal_segment_size\n\nArchiving metrics use information from pg_stat_archiver.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "yellow", + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 26 + }, + "hideTimeOverride": true, + "id": 19, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Archiver: Files Need to Archive Size" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Size Of Files Need To Archive", + "type": "timeseries" + } + ], + "title": "Archiver", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 26 + }, + "id": 20, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Autovacuum metrics use information from pg_stat_activity.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 35 + }, + "hideTimeOverride": true, + "id": 21, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Name", + "sortDesc": false + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [], + "name": "setAlias", + "params": [ + { + "name": "alias", + "type": "string" + } + ] + }, + "params": [ + "Autovacuum Utiliazation" + ], + "text": "setAlias()" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Autovacuum: Utilization per 30 seconds" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Autovacuum Utilization", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Autovacuum metrics use information from pg_stat_activity.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "blue", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "bars", + "fillOpacity": 50, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 35 + }, + "hideTimeOverride": true, + "id": 22, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Name", + "sortDesc": false + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [], + "name": "setAlias", + "params": [ + { + "name": "alias", + "type": "string" + } + ] + }, + "params": [ + "Autovacuum Workers" + ], + "text": "setAlias()" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Autovacuum: Count of Autovacuum Workers" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Autovacuum workers", + "type": "timeseries" + } + ], + "title": "Autovacuum", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 27 + }, + "id": 23, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Buffers Allocated maps to buffers_alloc.\n\nBackground Writer metrics use information from pg_stat_bgwriter.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "orange", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 36 + }, + "hideTimeOverride": true, + "id": 24, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Name", + "sortDesc": false + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL bgwriter: Buffers Allocated" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Buffers Allocated", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Buffers Written maps to buffers_clean.\n\nBackground Writer metrics use information from pg_stat_bgwriter.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "orange", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 8, + "y": 36 + }, + "hideTimeOverride": true, + "id": 25, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Name", + "sortDesc": false + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL bgwriter: Buffers Written" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Buffers Written", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Buffers Written Directly By a Backend maps to buffers_backend.\nBuffers Written During Checkpoints maps to buffers_checkpoint.\n\nBackground Writer metrics use information from pg_stat_bgwriter.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "orange", + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 36 + }, + "hideTimeOverride": true, + "id": 26, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Name", + "sortDesc": false + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/PostgreSQL bgwriter: Buffers Written /" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Buffers Written details", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Bgwriter Stopped a Cleaning Scan maps to maxwritten_clean.\n\nBackground Writer metrics use information from pg_stat_bgwriter.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "orange", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 44 + }, + "hideTimeOverride": true, + "id": 27, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Name", + "sortDesc": false + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL bgwriter: Number of bgwriter Stopped by Max Write Count" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Number of bgwriter Stopped by Max Write Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Backend Executes Its Own Fsync Call maps to buffers_backend_fsync.\n\nBackground Writer metrics use information from pg_stat_bgwriter.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "orange", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 44 + }, + "hideTimeOverride": true, + "id": 28, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Name", + "sortDesc": false + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL bgwriter: Times a Backend Execute Its Own Fsync" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Backend Executes Its Own Fsync Call", + "type": "timeseries" + } + ], + "title": "Background Writer", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 28 + }, + "id": 35, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 52 + }, + "hideTimeOverride": true, + "id": 36, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "min", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^PostgreSQL Databases: (.+) size$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/^PostgreSQL Databases: $database size$/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Database size", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 52 + }, + "hideTimeOverride": true, + "id": 40, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "min", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^PostgreSQL Databases: Max datfrozenxid Age in: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/^PostgreSQL Databases: Max datfrozenxid Age in: (.+)$/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Max datfrozenxid Age", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 60 + }, + "hideTimeOverride": true, + "id": 38, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.* Count of Bloating Tables in (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/^PostgreSQL Databases: Count of Bloating Tables in $database$/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Count of Bloating Tables in database", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 60 + }, + "hideTimeOverride": true, + "id": 41, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^PostgreSQL Databases: Count of Invalid Indexes in (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/^PostgreSQL Databases: Count of Invalid Indexes in ${database}$/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Count of Invalid Indexes in database", + "type": "timeseries" + } + ], + "title": "Databases", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 29 + }, + "id": 30, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Checkpoints Sync Time maps checkpoint_sync_time.\n\nCheckpoints metrics use information from pg_stat_bgwriter.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 30 + }, + "hideTimeOverride": true, + "id": 31, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Checkpoints: Sync Time" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Checkpoints Sync Time", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Checkpoints Write Time maps checkpoint_write_time.\n\nCheckpoints metrics use information from pg_stat_bgwriter.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 30 + }, + "hideTimeOverride": true, + "id": 32, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Checkpoints: Write Time" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Checkpoints Write Time", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Scheduled Checkpoints maps checkpoints_timed.\n\nCheckpoints metrics use information from pg_stat_bgwriter.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 38 + }, + "hideTimeOverride": true, + "id": 33, + "interval": "1h", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "1h", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [], + "name": "setAlias", + "params": [ + { + "name": "alias", + "type": "string" + } + ] + }, + "params": [ + "Scheduled Checkpoints" + ], + "text": "setAlias()" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Checkpoints: by Timeout (in hour)" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Requested Checkpoints [per 1 hour]", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Requested Checkpoints maps checkpoints_req.\n\nCheckpoints metrics use information from pg_stat_bgwriter.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 38 + }, + "hideTimeOverride": true, + "id": 34, + "interval": "1h", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "1h", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [], + "name": "setAlias", + "params": [ + { + "name": "alias", + "type": "string" + } + ] + }, + "params": [ + "Requested Checkpoints" + ], + "text": "setAlias()" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Checkpoints: by WAL (in hour)" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Requested Checkpoints [per 1 hour]", + "type": "timeseries" + } + ], + "title": "Checkpoints", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 30 + }, + "id": 94, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 47 + }, + "hideTimeOverride": true, + "id": 97, + "interval": "1h", + "options": { + "legend": { + "calcs": [ + "min", + "max", + "last" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL CFS: Current Ratio" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Current Ratio", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 47 + }, + "hideTimeOverride": true, + "id": 98, + "interval": "10m", + "options": { + "legend": { + "calcs": [ + "min", + "max", + "last" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL CFS: Total Ratio" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Total Ratio", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Scanned Speed maps cfs_gc_activity_processed_pages().", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "recps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 54 + }, + "hideTimeOverride": true, + "id": 99, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL CFS: Scanned byte/s" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Scanned byte/s", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Scanned Files maps cfs_gc_activity_scanned_files().", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "recps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 54 + }, + "hideTimeOverride": true, + "id": 96, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL CFS: Scanned Files" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Scanned Files processing rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Compressed Files maps cfs_gc_activity_processed_files()", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "recps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 62 + }, + "hideTimeOverride": true, + "id": 95, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL CFS: Compressed Files" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Compressed Files processing rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Written Speed maps cfs_gc_activity_processed_bytes()", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "recps" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 62 + }, + "hideTimeOverride": true, + "id": 100, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL CFS: Written byte/s" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Written Speed", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Last compression ratio" + }, + "properties": [ + { + "id": "custom.width", + "value": 180 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 70 + }, + "hideTimeOverride": true, + "id": 101, + "interval": "$interval", + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^PostgreSQL CFS: Relation (.+) Compress Ratio$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/^PostgreSQL CFS: Relation (.+) Compress Ratio$/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Relations compression ratio", + "transformations": [ + { + "id": "reduce", + "options": { + "reducers": [ + "last" + ] + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "includeByName": {}, + "indexByName": {}, + "renameByName": { + "Field": "Relation", + "Last": "Last compression ratio" + } + } + } + ], + "type": "table" + } + ], + "title": "CFS (Postgres Pro)", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 31 + }, + "id": 42, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Events per [$interval]\n\nEvents metrics use information from pg_stat_database.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 53 + }, + "hideTimeOverride": true, + "id": 6, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "sum" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "sum" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "sum" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Instance: Conflict Events" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Conflict Events", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Events per [$interval]\n\nEvents metrics use information from pg_stat_database.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 8, + "y": 53 + }, + "hideTimeOverride": true, + "id": 43, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "sum" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "sum" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "sum" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Instance: Deadlock Events" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Deadlock Events", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Events per [$interval]\n\nEvents metrics use information from pg_stat_database.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 53 + }, + "hideTimeOverride": true, + "id": 44, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "sum" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "sum" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "sum" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Instance: checksum_failures Events" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Checksum Failures Events", + "type": "timeseries" + } + ], + "title": "Events", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 32 + }, + "id": 8, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Wait Sampling metrics use information from pgpro_stats extension by default or from pg_wait_sampling extension if you installed it on non-PostgrePro edition.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 8, + "x": 0, + "y": 40 + }, + "hideTimeOverride": true, + "id": 10, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/^PostgreSQL Wait Sampling LWLocks: /" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Locks by type rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Wait Sampling metrics use information from pgpro_stats extension by default or from pg_wait_sampling extension if you installed it on non-PostgrePro edition.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 8, + "x": 8, + "y": 40 + }, + "hideTimeOverride": true, + "id": 12, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/^PostgreSQL Wait Sampling HWLocks/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Lightweight Locks rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Wait Sampling metrics use information from pgpro_stats extension by default or from pg_wait_sampling extension if you installed it on non-PostgrePro edition.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 8, + "x": 16, + "y": 40 + }, + "hideTimeOverride": true, + "id": 11, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.*)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/^PostgreSQL Wait Sampling LWLocks/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Heavyweight Locks rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Average number of locks from pg_locks per [$interval] for different query types.\n\nAccess share locks - Sum of locks from pg_locks with mode Access Share. Metric describes a total number of locks acquired (or waiting) by queries that only reads tables and do not modify.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 50 + }, + "hideTimeOverride": true, + "id": 9, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.* by all queries like (.*)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/total number of locks acquired \\(or waiting\\) by all queries like (.*)$/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + }, + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [], + "name": "setAlias", + "params": [ + { + "name": "alias", + "type": "string" + } + ] + }, + "params": [ + "Access share locks" + ], + "text": "setAlias()" + } + ], + "group": { + "filter": "$group" + }, + "hide": false, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/total number of locks acquired \\(or waiting\\) by queries that only reads tables and do not modify$/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "B", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Locks sampling", + "type": "timeseries" + } + ], + "title": "Locks & Wait sampling", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 33 + }, + "id": 48, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "", + "gridPos": { + "h": 10, + "w": 9, + "x": 0, + "y": 41 + }, + "id": 49, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "### Memory Leak detection plugin\nThis plugin allows detects possible memory leaks while working with PostgreSQL using /proc/pid/status and /proc/pid/statm.\n\nThis plugin is **disabled** by default. \\\nTo enable the plugin - set *\"enabled = True\"* in the Mamonsu agent configuration file, section **[memoryleakdiagnostic]**.\n\nWe use RES and SHR difference to calculate approximate volume of private anonymous backend memory.\nIf it exceeds private_anon_mem_threshold then that pid will be added to a message. An example is presented below\nstatm - 'pid: {pid}, RES {RES} - SHR {SHR} more then {private_anon_mem_threshold}\\n'\nSince Linux 4.5 RssAnon, RssFile and RssShmem have been added.\nThey allows to distinguish types of memory such as private anonymous, file-backed, and shared anonymous memory.\nWe are interested in RssAnon. If its value exceeds private_anon_mem_threshold then that pid will also be added to a message.", + "mode": "markdown" + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [], + "group": { + "filter": "" + }, + "host": { + "filter": "" + }, + "item": { + "filter": "" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "type": "text" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "PostgreSQL Memory Leak: Number of Pids Which Private Anonymous Memory Exceeds private_anon_mem_threshold", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 15, + "x": 9, + "y": 41 + }, + "hideTimeOverride": true, + "id": 50, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [], + "name": "setAlias", + "params": [ + { + "name": "alias", + "type": "string" + } + ] + }, + "params": [ + "Number of PIDs" + ], + "text": "setAlias()" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Memory Leak: Number of Pids Which Private Anonymous Memory Exceeds private_anon_mem_threshold" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Number of Pids exceeds private_anon_mem_threshold", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Can be empty, if there's no memory leaks", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "text" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 15, + "x": 9, + "y": 47 + }, + "hideTimeOverride": true, + "id": 47, + "interval": "$interval", + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "value", + "wideLayout": true + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^PostgreSQL Databases: (.+) size$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Memory Leak: Number of Pids Which Private Anonymous Memory Exceeds private_anon_mem_threshold, text of message" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "2", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Memory Leak plugin message", + "type": "stat" + } + ], + "title": "Memory Leak Detection", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 34 + }, + "id": 67, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "", + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 34 + }, + "id": 68, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "### Relations size\nGets size of specified relations.\nIf the relation is blocked by some process such as vacuum full or create index, the result will be -1.\n\nThis plugin is **disabled** by default. \\\nTo enable the plugin - set *\"enabled = True\"* in the Mamonsu agent configuration file, section **[relationssize]**.\n\n\n", + "mode": "markdown" + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [], + "group": { + "filter": "" + }, + "host": { + "filter": "" + }, + "item": { + "filter": "" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "type": "text" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 16, + "x": 8, + "y": 34 + }, + "hideTimeOverride": true, + "id": 69, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/^PostgreSQL Relation Size:/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Relations Size", + "type": "timeseries" + } + ], + "title": "Relations Size", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 35 + }, + "id": 102, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Server Mode shows server status as MASTER or STANDBY.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "MASTER": { + "color": "dark-green", + "index": 0 + }, + "STANDBY": { + "color": "dark-yellow", + "index": 1 + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 0, + "y": 36 + }, + "hideTimeOverride": true, + "id": 53, + "maxDataPoints": 3, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "/^PostgreSQL Instance: Server Mode$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Instance: Server Mode" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "2", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "timeFrom": "1h", + "title": "Server mode", + "type": "stat" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Non-active Replication Slots calculates as count of slots with false active status.\n\nReplication metrics use information from pg_replication_slots.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "0": { + "color": "dark-green", + "index": 0 + } + }, + "type": "value" + }, + { + "options": { + "from": 1, + "result": { + "color": "dark-yellow", + "index": 1 + }, + "to": 999999 + }, + "type": "range" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 12, + "x": 12, + "y": 36 + }, + "hideTimeOverride": true, + "id": 104, + "maxDataPoints": 3, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Replication: Count Non-Active Replication Slots" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "timeFrom": "1h", + "title": "Non-Active Replication Slots", + "type": "stat" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Streaming Replication Lag calculates as difference between now and pg_last_xact_replay_timestamp.\n\nReplication metrics use information from pg_replication_slots.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "#bd2eb1", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 39 + }, + "hideTimeOverride": true, + "id": 105, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max", + "last" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Replication: Streaming Replication Lag" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Streaming Replication Lag", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Replication metrics use information from pg_replication_slots.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "#bd2eb1", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 39 + }, + "hideTimeOverride": true, + "id": 106, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max", + "last" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^PostgreSQL Replication: (.+) Delta of Total Lag$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/^PostgreSQL Replication: .+ Delta of Total Lag$/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Delta of Total Lag", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "**Flush Lag** - Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written and flushed it.\n\t\n**Receive Lag** - Time elapsed between receiving recent WAL locally and receiving notification that this standby server has flushed it.\n\n**Replay Lag** - Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written, flushed and applied.\n\n**Send Lag** - Time elapsed sending recent WAL locally.\n\t\n**Write Lag** - Time elapsed between flushing recent WAL locally and receiving notification that this standby server has written it\n\nReplication metrics use information from pg_replication_slots.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "#bd2eb1", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 46 + }, + "hideTimeOverride": true, + "id": 107, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max", + "last" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "max" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "max" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^PostgreSQL Replication: (.+) (\\S+ Lag)/", + "$1/$2" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "/^PostgreSQL Replication: .+ (Flush|Receive|Replay|Send|Write) Lag/" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Lag details", + "type": "timeseries" + } + ], + "title": "Replication", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 36 + }, + "id": 70, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Amount of WAL Files maps wal_bytes.\n\nStatements metrics use information from pg_stat_statements and pg_stat_statements_info for PostgreSQL cluster and from pgpro_stats extension for PostgresPro cluster.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 46 + }, + "hideTimeOverride": true, + "id": 93, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Statements: Amount of WAL Files" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Amount of WAL Files", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Amount of WAL Records maps wal_records.\n\nStatements metrics use information from pg_stat_statements and pg_stat_statements_info for PostgreSQL cluster and from pgpro_stats extension for PostgresPro cluster.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "recps" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 46 + }, + "hideTimeOverride": true, + "id": 85, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Statements: Amount of WAL Records" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Amount of WAL Records", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Dirty Bytes calculates as summa of shared_blks_dirtied and local_blks_dirtied.\n\nStatements metrics use information from pg_stat_statements and pg_stat_statements_info for PostgreSQL cluster and from pgpro_stats extension for PostgresPro cluster.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "recps" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 46 + }, + "hideTimeOverride": true, + "id": 86, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Statements: Dirty bytes/s" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Dirty Bytes", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Read IO Time maps blk_read_time.\n\nStatements metrics use information from pg_stat_statements and pg_stat_statements_info for PostgreSQL cluster and from pgpro_stats extension for PostgresPro cluster.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "recps" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 53 + }, + "hideTimeOverride": true, + "id": 88, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Statements: Read IO Time" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Read IO Time", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Write IO Time maps blk_write_time.\n\nStatements metrics use information from pg_stat_statements and pg_stat_statements_info for PostgreSQL cluster and from pgpro_stats extension for PostgresPro cluster.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "recps" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 53 + }, + "hideTimeOverride": true, + "id": 89, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Statements: Write IO Time" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Write IO Time", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Other Time calculates as total_time - blk_read_time - blk_write_time.\n\nStatements metrics use information from pg_stat_statements and pg_stat_statements_info for PostgreSQL cluster and from pgpro_stats extension for PostgresPro cluster.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "recps" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 53 + }, + "hideTimeOverride": true, + "id": 90, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Statements: Other (mostly CPU) Time" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Other time", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Read Speed calculates as shared_blks_read, local_blks_read and temp_blks_read.\n\nStatements metrics use information from pg_stat_statements and pg_stat_statements_info for PostgreSQL cluster and from pgpro_stats extension for PostgresPro cluster.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "recps" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 60 + }, + "hideTimeOverride": true, + "id": 91, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Statements: Read bytes/s" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Read Speed", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Write Speed calculates as summa of shared_blks_written and local_blks_written.\n\nStatements metrics use information from pg_stat_statements and pg_stat_statements_info for PostgreSQL cluster and from pgpro_stats extension for PostgresPro cluster.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "recps" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 60 + }, + "hideTimeOverride": true, + "id": 92, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Statements: Write bytes/s" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Write Speed", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "WAL FPI maps wal_fpi.\n\nStatements metrics use information from pg_stat_statements and pg_stat_statements_info for PostgreSQL cluster and from pgpro_stats extension for PostgresPro cluster.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "recps" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 60 + }, + "hideTimeOverride": true, + "id": 87, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Last *", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Statements: Full Page Writes" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "WAL Full Page Writes", + "type": "timeseries" + } + ], + "title": "Statements", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 37 + }, + "id": 60, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Shared Buffer Size is a count of all rows in pg_buffercache multiplied by block_size", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "purple", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 43 + }, + "hideTimeOverride": true, + "id": 61, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL pg_buffercache: Shared Buffer Size" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Shared Buffer Size", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Shared Buffer Dirty Size is a count of all isdirty rows in pg_buffercache multiplied by block_size.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "purple", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 43 + }, + "hideTimeOverride": true, + "id": 62, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL pg_buffercache: Shared Buffer Dirty Size" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Shared Buffer Dirty Size", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Shared Buffer Twice Used Size is a count of all rows in pg_buffercache where usagecount greater than 1 multiplied by block_size.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "purple", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 43 + }, + "hideTimeOverride": true, + "id": 63, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL pg_buffercache: Shared Buffer Twice Used Size" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Shared Buffer Twice Used Size ", + "type": "timeseries" + } + ], + "title": "Shared Buffers", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 38 + }, + "id": 82, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Temp Files created per [$interval].\n\nTemp Files metrics use information from pg_stat_database.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "purple", + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 37 + }, + "hideTimeOverride": true, + "id": 84, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "sum" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "sum" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "sum" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Instance: Temp Files Created" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Temp Files Created", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Temp Bytes Written per [$interval].\n\nTemp Files metrics use information from pg_stat_database.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "purple", + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 37 + }, + "hideTimeOverride": true, + "id": 83, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "sum" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Special", + "defaultParams": [ + "avg" + ], + "name": "consolidateBy", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "sum" + ], + "text": "consolidateBy(avg)" + }, + { + "added": true, + "def": { + "category": "Trends", + "defaultParams": [ + "avg" + ], + "name": "trendValue", + "params": [ + { + "name": "type", + "options": [ + "avg", + "min", + "max", + "sum", + "count" + ], + "type": "string" + } + ] + }, + "params": [ + "sum" + ], + "text": "trendValue(avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Instance: Temp Bytes Written" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Temp Bytes Written", + "type": "timeseries" + } + ], + "title": "Temp Files", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 39 + }, + "id": 64, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Oldest XID Age calculates based on data from pg_stat_activity", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "purple", + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 45 + }, + "hideTimeOverride": true, + "id": 72, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Transactions: Age of the Oldest XID" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Age of the Oldest XID", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Oldest Transaction Time calculates based on data from pg_stat_activity", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "purple", + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 45 + }, + "hideTimeOverride": true, + "id": 73, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Transactions: the Oldest Transaction Running Time in sec" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "the Oldest Transaction Running Time in sec", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Prepared Transactions Count calculates as summa of all rows in pg_prepared_xacts.\n\nPrepared Transactions metrics use information from pg_prepared_xacts.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "purple", + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 52 + }, + "hideTimeOverride": true, + "id": 65, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Prepared Transactions: Number of Prepared Transactions" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "Number of Prepared Transactions", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "Oldest Prepared Transaction Time calculates as max(now() - prepared).\n\nPrepared Transactions metrics use information from pg_prepared_xacts.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "purple", + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 52 + }, + "hideTimeOverride": true, + "id": 66, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL Prepared Transactions: the Oldest Prepared Transaction Running Time in sec" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "the Oldest Prepared Transaction Running Time", + "type": "timeseries" + } + ], + "title": "Transactions", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 40 + }, + "id": 76, + "panels": [ + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "WAL count calculates as count of WAL files in pg_wal directory via pg_ls_dir().", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "yellow", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 46 + }, + "hideTimeOverride": true, + "id": 77, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL WAL: Count of WAL Files" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "WAL Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "WAL Records Generated maps wal_records.\n\nWAL metrics use information from pg_stat_wal.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "yellow", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 16, + "x": 8, + "y": 46 + }, + "hideTimeOverride": true, + "id": 79, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL WAL: Records Generated" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "WAL Records Generated", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "WAL Sync Time maps wal_sync_time.\n\nWAL metrics use information from pg_stat_wal.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "yellow", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 54 + }, + "hideTimeOverride": true, + "id": 80, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [], + "name": "setAlias", + "params": [ + { + "name": "alias", + "type": "string" + } + ] + }, + "params": [ + "WAL Write Time" + ], + "text": "setAlias()" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL WAL: Sync Time (ms)" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "WAL Sync Time", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "WAL Sync Duty calculates as change of wal_sync_time per mamonsu interval.\n\nWAL metrics use information from pg_stat_wal.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "yellow", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 8, + "y": 54 + }, + "hideTimeOverride": true, + "id": 81, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL WAL: Sync Duty (%)" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "WAL Sync Duty", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "WAL FPI Generated maps wal_fpi.\n\nWAL metrics use information from pg_stat_wal.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "yellow", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "ops" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 54 + }, + "hideTimeOverride": true, + "id": 78, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL WAL: Full Page Images Generated" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "WAL Full Page Images (FPI) Generated", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "WAL Write Time maps wal_write_time.\n\nWAL metrics use information from pg_stat_wal.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "yellow", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 62 + }, + "hideTimeOverride": true, + "id": 74, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [], + "name": "setAlias", + "params": [ + { + "name": "alias", + "type": "string" + } + ] + }, + "params": [ + "WAL Write Time" + ], + "text": "setAlias()" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL WAL: Write Time (ms)" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "WAL Write Time", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "WAL Write Speed calculates as difference between current WAL file and 0/00000000.\n\nWAL metrics use information from pg_stat_wal.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "yellow", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 8, + "y": 62 + }, + "hideTimeOverride": true, + "id": 18, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [], + "name": "setAlias", + "params": [ + { + "name": "alias", + "type": "string" + } + ] + }, + "params": [ + "WAL Write Speed" + ], + "text": "setAlias()" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL WAL: Write Speed" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "WAL Write Speed", + "type": "timeseries" + }, + { + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "description": "WAL Buffers Full maps wal_buffers_full.\n\nWAL metrics use information from pg_stat_wal.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "yellow", + "mode": "fixed" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 34, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "dark-green" + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 62 + }, + "hideTimeOverride": true, + "id": 75, + "interval": "$interval", + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.0.0", + "targets": [ + { + "application": { + "filter": "" + }, + "countTriggersBy": "", + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "evaltype": "0", + "functions": [ + { + "added": true, + "def": { + "category": "Transform", + "defaultParams": [ + "1m", + "avg" + ], + "name": "groupBy", + "params": [ + { + "name": "interval", + "type": "string" + }, + { + "name": "function", + "options": [ + "avg", + "min", + "max", + "sum", + "count", + "median", + "first", + "last" + ], + "type": "string" + } + ] + }, + "params": [ + "$interval", + "avg" + ], + "text": "groupBy(1m, avg)" + }, + { + "added": true, + "def": { + "category": "Alias", + "defaultParams": [ + "/(.*)/", + "$1" + ], + "name": "replaceAlias", + "params": [ + { + "name": "regexp", + "type": "string" + }, + { + "name": "newAlias", + "type": "string" + } + ] + }, + "params": [ + "/^.*: (.+)$/", + "$1" + ], + "text": "replaceAlias(/(.*)/, $1)" + } + ], + "group": { + "filter": "$group" + }, + "host": { + "filter": "$host" + }, + "item": { + "filter": "PostgreSQL WAL: Buffers Full" + }, + "itemTag": { + "filter": "" + }, + "macro": { + "filter": "" + }, + "options": { + "count": false, + "disableDataAlignment": false, + "showDisabledItems": false, + "skipEmptyValues": false, + "useTrends": "default", + "useZabbixValueMapping": false + }, + "proxy": { + "filter": "" + }, + "queryType": "0", + "refId": "A", + "resultFormat": "time_series", + "schema": 12, + "table": { + "skipEmptyValues": false + }, + "tags": { + "filter": "" + }, + "textFilter": "", + "trigger": { + "filter": "" + } + } + ], + "title": "WAL Buffers full", + "type": "timeseries" + } + ], + "title": "WAL", + "type": "row" + } + ], + "refresh": "", + "schemaVersion": 39, + "tags": [ + "pgpro", + "mamonsu", + "postgres", + "zabbix" + ], + "templating": { + "list": [ + { + "current": {}, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "definition": "Zabbix - group", + "description": "Zabbix host group", + "hide": 0, + "includeAll": false, + "label": "Host group", + "multi": false, + "name": "group", + "options": [], + "query": { + "application": "", + "group": "/.*/", + "host": "", + "item": "", + "itemTag": "", + "queryType": "group" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "definition": "Zabbix - host", + "description": "Zabbix host.\nMamonsu template should be assigned to the host.", + "hide": 0, + "includeAll": false, + "label": "Zabbix host", + "multi": false, + "name": "host", + "options": [], + "query": { + "application": "", + "group": "$group", + "host": "/.*/", + "item": "", + "itemTag": "", + "queryType": "host" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "Zabbix", + "value": "zabbix" + }, + "description": "Zabbix data source.\nSupported plugin: https://grafana.com/grafana/plugins/alexanderzobnin-zabbix-app", + "hide": 0, + "includeAll": false, + "label": "Data source", + "multi": false, + "name": "ds", + "options": [], + "query": "alexanderzobnin-zabbix-datasource", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": {}, + "datasource": { + "type": "alexanderzobnin-zabbix-datasource", + "uid": "${DS_ZABBIX}" + }, + "definition": "Zabbix - item", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "database", + "options": [], + "query": { + "application": "", + "group": "$group", + "host": "$host", + "item": "/^PostgreSQL Databases: (.+) size$/", + "itemTag": "", + "queryType": "item" + }, + "refresh": 1, + "regex": "/^PostgreSQL Databases: (?.+) size$/", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "auto": true, + "auto_count": 100, + "auto_min": "1m", + "current": { + "selected": false, + "text": "auto", + "value": "$__auto_interval_interval" + }, + "hide": 0, + "name": "interval", + "options": [ + { + "selected": true, + "text": "auto", + "value": "$__auto_interval_interval" + }, + { + "selected": false, + "text": "1m", + "value": "1m" + }, + { + "selected": false, + "text": "5m", + "value": "5m" + }, + { + "selected": false, + "text": "10m", + "value": "10m" + }, + { + "selected": false, + "text": "15m", + "value": "15m" + }, + { + "selected": false, + "text": "30m", + "value": "30m" + }, + { + "selected": false, + "text": "1h", + "value": "1h" + }, + { + "selected": false, + "text": "6h", + "value": "6h" + }, + { + "selected": false, + "text": "12h", + "value": "12h" + }, + { + "selected": false, + "text": "1d", + "value": "1d" + }, + { + "selected": false, + "text": "7d", + "value": "7d" + } + ], + "query": "1m,5m,10m,15m,30m,1h,6h,12h,1d,7d", + "queryValue": "", + "refresh": 2, + "skipUrlSync": false, + "type": "interval" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timeRangeUpdatedDuringEditOrView": false, + "timepicker": {}, + "timezone": "browser", + "title": "Postgres Pro | Postgres metrics by Mamonsu", + "uid": "bdpqi1jk82l8gf", + "version": 1, + "weekStart": "" +} From 3419758739872509632590cbd866e3f3257b6c91 Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Tue, 9 Jul 2024 14:43:50 +0400 Subject: [PATCH 02/28] cicd: fix centos7 repo urls --- github-actions-tests/tests.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/github-actions-tests/tests.sh b/github-actions-tests/tests.sh index 8374448..36e3e71 100644 --- a/github-actions-tests/tests.sh +++ b/github-actions-tests/tests.sh @@ -36,6 +36,32 @@ REPO="sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms if [ "${OS}" = "centos:7" ]; then # install and set up components missing in docker image (sudo, wget, bc, unzip) yum clean all + cat << REPO > /etc/yum.repos.d/CentOS-Base.repo +[base] +name=CentOS-\$releasever - Base +baseurl=http://vault.centos.org/7.9.2009/os/\$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +[updates] +name=CentOS-\$releasever - Updates +baseurl=http://vault.centos.org/7.9.2009/updates/\$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +[extras] +name=CentOS-\$releasever - Extras +baseurl=http://vault.centos.org/7.9.2009/extras/\$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +[centosplus] +name=CentOS-\$releasever - Plus +baseurl=http://vault.centos.org/7.9.2009/centosplus/\$basearch/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 +REPO yum update -y yum install -y sudo PACKAGE_MANAGER_INSTALL="sudo yum -y install" From 1e54c5998d19d1804aace3f80c2529087624e832 Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Fri, 16 Aug 2024 18:48:53 +0400 Subject: [PATCH 03/28] fix: run on systems with newer setuptools - Don't use pkg_resources.packaging if installed version of setuptools doesn't support it --- mamonsu/plugins/pgsql/driver/pg8000/core.py | 6 +++++- mamonsu/plugins/pgsql/driver/pool.py | 5 ++++- mamonsu/plugins/pgsql/memory_leak_diagnostic.py | 5 ++++- mamonsu/plugins/pgsql/replication.py | 6 +++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/mamonsu/plugins/pgsql/driver/pg8000/core.py b/mamonsu/plugins/pgsql/driver/pg8000/core.py index 7816bff..26db69a 100755 --- a/mamonsu/plugins/pgsql/driver/pg8000/core.py +++ b/mamonsu/plugins/pgsql/driver/pg8000/core.py @@ -2,12 +2,16 @@ from collections import defaultdict, deque from datetime import datetime as Datetime from decimal import Decimal -from pkg_resources import packaging from hashlib import md5 from itertools import count, islice from struct import Struct from warnings import warn +try: + from pkg_resources import packaging +except ImportError: + import packaging.version + from mamonsu.plugins.pgsql.driver.pg8000 import converters from .exceptions import ( ArrayContentNotSupportedError, DatabaseError, Error, IntegrityError, diff --git a/mamonsu/plugins/pgsql/driver/pool.py b/mamonsu/plugins/pgsql/driver/pool.py index b7ca620..bfd4749 100644 --- a/mamonsu/plugins/pgsql/driver/pool.py +++ b/mamonsu/plugins/pgsql/driver/pool.py @@ -1,6 +1,9 @@ -from pkg_resources import packaging from .connection import Connection, ConnectionInfo +try: + from pkg_resources import packaging +except ImportError: + import packaging.version class Pool(object): ExcludeDBs = ["template0", "template1"] diff --git a/mamonsu/plugins/pgsql/memory_leak_diagnostic.py b/mamonsu/plugins/pgsql/memory_leak_diagnostic.py index cb368a9..c22c5f9 100644 --- a/mamonsu/plugins/pgsql/memory_leak_diagnostic.py +++ b/mamonsu/plugins/pgsql/memory_leak_diagnostic.py @@ -4,10 +4,13 @@ import os from .pool import Pooler import re -from pkg_resources import packaging import mamonsu.lib.platform as platform import posix +try: + from pkg_resources import packaging +except ImportError: + import packaging.version class MemoryLeakDiagnostic(Plugin): DEFAULT_CONFIG = { diff --git a/mamonsu/plugins/pgsql/replication.py b/mamonsu/plugins/pgsql/replication.py index 0c53f5b..78d841a 100644 --- a/mamonsu/plugins/pgsql/replication.py +++ b/mamonsu/plugins/pgsql/replication.py @@ -1,10 +1,14 @@ # -*- coding: utf-8 -*- from mamonsu.plugins.pgsql.plugin import PgsqlPlugin as Plugin -from pkg_resources import packaging from .pool import Pooler from mamonsu.lib.zbx_template import ZbxTemplate +try: + from pkg_resources import packaging +except ImportError: + import packaging.version + NUMBER_NON_ACTIVE_SLOTS = 0 From f94a504671be0ce028065556617f6b59b14ee5ad Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Fri, 16 Aug 2024 18:53:59 +0400 Subject: [PATCH 04/28] build: fix RPM buildspec - Stop using old-style user:group specification in chown calls --- packaging/rpm/SPECS/mamonsu.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packaging/rpm/SPECS/mamonsu.spec b/packaging/rpm/SPECS/mamonsu.spec index f35fbd9..6fc2357 100644 --- a/packaging/rpm/SPECS/mamonsu.spec +++ b/packaging/rpm/SPECS/mamonsu.spec @@ -57,20 +57,20 @@ getent passwd mamonsu > /dev/null || \ -c "mamonsu monitoring user" mamonsu mkdir -p /var/run/mamonsu -chown -R mamonsu.mamonsu /var/run/mamonsu +chown -R mamonsu:mamonsu /var/run/mamonsu mkdir -p /etc/mamonsu/plugins touch /etc/mamonsu/plugins/__init__.py mkdir -p /var/log/mamonsu -chown -R mamonsu.mamonsu /var/log/mamonsu +chown -R mamonsu:mamonsu /var/log/mamonsu %preun /sbin/service mamonsu stop >/dev/null 2>&1 /sbin/chkconfig --del mamonsu %post -chown -R mamonsu.mamonsu /etc/mamonsu +chown -R mamonsu:mamonsu /etc/mamonsu %changelog * Thu Apr 18 2024 Maxim Styushin - 3.5.8-1 From 4f1a44c52435ff054c1f5df386f7c7281ec8ddd5 Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Mon, 19 Aug 2024 12:43:49 +0400 Subject: [PATCH 05/28] cicd: fix url for EPEL rpm (moved to archives) --- github-actions-tests/tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github-actions-tests/tests.sh b/github-actions-tests/tests.sh index 36e3e71..5562da6 100644 --- a/github-actions-tests/tests.sh +++ b/github-actions-tests/tests.sh @@ -69,7 +69,7 @@ REPO eval "${PACKAGE_MANAGER_INSTALL} wget" eval "${PACKAGE_MANAGER_INSTALL} bc" eval "${PACKAGE_MANAGER_INSTALL} unzip" - eval "${PACKAGE_MANAGER_INSTALL} https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm" + eval "${PACKAGE_MANAGER_INSTALL} https://archives.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm" REPO=${PACKAGE_MANAGER_INSTALL}" https://download.postgresql.org/pub/repos/yum/reporpms/EL-"$(echo ${OS} | sed -r 's/^[^0-9]*([0-9]+).*/\1/')"-x86_64/pgdg-redhat-repo-latest.noarch.rpm"\ # run tests From 29961c24bc3cbb100025902433990d2b88e346ad Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Mon, 19 Aug 2024 12:58:17 +0400 Subject: [PATCH 06/28] build: upgrade to 3.5.9 --- .github/workflows/mamonsu-tests-dev.yml | 2 +- .github/workflows/mamonsu-tests-master.yml | 2 +- github-actions-tests/mamonsu_build.sh | 4 ++-- .../sources/{agent_3.5.8.conf => agent_3.5.9.conf} | 0 mamonsu/__init__.py | 2 +- packaging/debian/changelog | 4 ++++ packaging/rpm/SPECS/mamonsu.spec | 6 +++++- packaging/win/mamonsu.def.nsh | 2 +- 8 files changed, 15 insertions(+), 7 deletions(-) rename github-actions-tests/sources/{agent_3.5.8.conf => agent_3.5.9.conf} (100%) diff --git a/.github/workflows/mamonsu-tests-dev.yml b/.github/workflows/mamonsu-tests-dev.yml index 22386fb..0162db9 100644 --- a/.github/workflows/mamonsu-tests-dev.yml +++ b/.github/workflows/mamonsu-tests-dev.yml @@ -80,7 +80,7 @@ jobs: echo "zabbix_address=$(hostname -I | awk '{print $1}')" >> $GITHUB_OUTPUT id: zabbix_address - name: Edit Zabbix address in agent.conf - run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.8.conf + run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.9.conf - name: Copy test scripts to container run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) mkdir -p -m 755 /mamonsu/ diff --git a/.github/workflows/mamonsu-tests-master.yml b/.github/workflows/mamonsu-tests-master.yml index 2cdde54..0d895af 100644 --- a/.github/workflows/mamonsu-tests-master.yml +++ b/.github/workflows/mamonsu-tests-master.yml @@ -91,7 +91,7 @@ jobs: echo "zabbix_address=$(hostname -I | awk '{print $1}')" >> $GITHUB_OUTPUT id: zabbix_address - name: Edit Zabbix address in agent.conf - run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.8.conf + run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.9.conf - name: Copy test scripts to container run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) mkdir -p -m 755 /mamonsu/ diff --git a/github-actions-tests/mamonsu_build.sh b/github-actions-tests/mamonsu_build.sh index bc7d5e4..137e072 100644 --- a/github-actions-tests/mamonsu_build.sh +++ b/github-actions-tests/mamonsu_build.sh @@ -41,7 +41,7 @@ if [ "${OS%:*}" = "centos" ]; then python3 setup.py build && python3 setup.py install make rpm sudo rpm -i ./mamonsu*.rpm - cat /mamonsu/github-actions-tests/sources/agent_3.5.8.conf > /etc/mamonsu/agent.conf + cat /mamonsu/github-actions-tests/sources/agent_3.5.9.conf > /etc/mamonsu/agent.conf systemctl daemon-reload systemctl restart mamonsu sleep 5 @@ -64,7 +64,7 @@ elif [ "${OS%:*}" = "ubuntu" ]; then python3 setup.py build && python3 setup.py install make deb sudo dpkg -i ./mamonsu*.deb - cat /mamonsu/github-actions-tests/sources/agent_3.5.8.conf > /etc/mamonsu/agent.conf + cat /mamonsu/github-actions-tests/sources/agent_3.5.9.conf > /etc/mamonsu/agent.conf service mamonsu restart sleep 5 echo && echo && echo "mamonsu version:" diff --git a/github-actions-tests/sources/agent_3.5.8.conf b/github-actions-tests/sources/agent_3.5.9.conf similarity index 100% rename from github-actions-tests/sources/agent_3.5.8.conf rename to github-actions-tests/sources/agent_3.5.9.conf diff --git a/mamonsu/__init__.py b/mamonsu/__init__.py index 0a9cadd..634d8d3 100644 --- a/mamonsu/__init__.py +++ b/mamonsu/__init__.py @@ -1,7 +1,7 @@ __author__ = 'Dmitry Vasilyev' __author_email__ = 'info@postgrespro.ru' __description__ = 'Monitoring agent for PostgreSQL' -__version__ = '3.5.8' +__version__ = '3.5.9' __licence__ = 'BSD' __url__ = 'https://github.com/postgrespro/mamonsu' diff --git a/packaging/debian/changelog b/packaging/debian/changelog index 0a0c778..dd77d37 100644 --- a/packaging/debian/changelog +++ b/packaging/debian/changelog @@ -1,3 +1,7 @@ +mamonsu (3.5.9-1) stable; urgency=low + * Run on systems with latest setuptools installed (>67.7.2); + * Drop using dotted user:group specification in RPM pre-install stage; + mamonsu (3.5.8-1) stable; urgency=low * Prepare for python 3.12: remove deprecated distutils imports; diff --git a/packaging/rpm/SPECS/mamonsu.spec b/packaging/rpm/SPECS/mamonsu.spec index 6fc2357..f9e19b1 100644 --- a/packaging/rpm/SPECS/mamonsu.spec +++ b/packaging/rpm/SPECS/mamonsu.spec @@ -1,5 +1,5 @@ Name: mamonsu -Version: 3.5.8 +Version: 3.5.9 Release: 1%{?dist} Summary: Monitoring agent for PostgreSQL Group: Applications/Internet @@ -73,6 +73,10 @@ chown -R mamonsu:mamonsu /var/log/mamonsu chown -R mamonsu:mamonsu /etc/mamonsu %changelog +* Mon Aug 19 2024 Maxim Styushin - 3.5.9-1 + - Run on systems with latest setuptools installed (>67.7.2); + - Drop using dotted user:group specification in RPM pre-install stage; + * Thu Apr 18 2024 Maxim Styushin - 3.5.8-1 - Prepare for python 3.12: remove deprecated distutils imports; diff --git a/packaging/win/mamonsu.def.nsh b/packaging/win/mamonsu.def.nsh index 1e32c88..5ca5afc 100644 --- a/packaging/win/mamonsu.def.nsh +++ b/packaging/win/mamonsu.def.nsh @@ -1,5 +1,5 @@ !define NAME Mamonsu -!define VERSION 3.5.8 +!define VERSION 3.5.9 !define MAMONSU_REG_PATH "Software\PostgresPro\Mamonsu" !define MAMONSU_REG_UNINSTALLER_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall" !define EDB_REG "SOFTWARE\Postgresql" From 775d8aa997f5940f0c1e69ef624dd2794a56a338 Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Mon, 14 Oct 2024 18:08:53 +0400 Subject: [PATCH 07/28] cicd: add Postgres 17 to test matrix --- .github/workflows/mamonsu-tests-dev.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/mamonsu-tests-dev.yml b/.github/workflows/mamonsu-tests-dev.yml index 0162db9..a7a3885 100644 --- a/.github/workflows/mamonsu-tests-dev.yml +++ b/.github/workflows/mamonsu-tests-dev.yml @@ -36,6 +36,12 @@ jobs: - docker_os: 'centos:8' pg_version: '16' zabbix_version: '6.4.13' + - docker_os: 'centos:8' + pg_version: '17' + zabbix_version: '6.4.13' + - docker_os: 'ubuntu:22.04' + pg_version: '17' + zabbix_version: '6.4.13' - docker_os: 'ubuntu:24.04' pg_version: '16' zabbix_version: '6.4.13' From ea9ceb44a8ce61cbf08a30bdc5094947a3b66428 Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Fri, 13 Dec 2024 16:52:58 +0400 Subject: [PATCH 08/28] fix: run zabbix cli tools with newer setuptools --- mamonsu/tools/zabbix_cli/operations.py | 7 ++++++- mamonsu/tools/zabbix_cli/request.py | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mamonsu/tools/zabbix_cli/operations.py b/mamonsu/tools/zabbix_cli/operations.py index d3b25e4..984f96f 100644 --- a/mamonsu/tools/zabbix_cli/operations.py +++ b/mamonsu/tools/zabbix_cli/operations.py @@ -5,7 +5,12 @@ import json from mamonsu.tools.zabbix_cli.request import Request from mamonsu.lib.parser import zabbix_msg -from pkg_resources import packaging + +try: + from pkg_resources import packaging +except ImportError: + import packaging.version + from mamonsu.tools.zabbix_cli.dashboard import generate_dashboard diff --git a/mamonsu/tools/zabbix_cli/request.py b/mamonsu/tools/zabbix_cli/request.py index 566868f..f0cee27 100644 --- a/mamonsu/tools/zabbix_cli/request.py +++ b/mamonsu/tools/zabbix_cli/request.py @@ -4,8 +4,11 @@ import logging from collections import OrderedDict +try: + from pkg_resources import packaging +except ImportError: + import packaging.version -from pkg_resources import packaging import urllib.request as urllib2 From a1b0f512e428ca9e5b49660d97bd121ad2586dc1 Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Fri, 13 Dec 2024 17:11:42 +0400 Subject: [PATCH 09/28] fix: updates for postgres 17 - updated checkpoint plugin: added support for new view pg_stat_checkpointer - updated bgwriter plugin: consider updated view pg_stat_bgwriter in postgres 17 --- README.md | 3 +- documentation/metrics.md | 42 ++++++++++-- mamonsu/plugins/pgsql/bgwriter.py | 92 +++++++++++++++---------- mamonsu/plugins/pgsql/checkpoint.py | 102 ++++++++++++++++++---------- 4 files changed, 166 insertions(+), 73 deletions(-) diff --git a/README.md b/README.md index df7611c..a4f3076 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ Supported platforms: - Windows; Supported Zabbix server versions: 4.0.44 - 6.4.13 -Supported PostgreSQL versions: 12 - 16 + +Supported PostgreSQL versions: 12 - 17 *** ***Table of Contents*** diff --git a/documentation/metrics.md b/documentation/metrics.md index a157eab..15ef4a1 100644 --- a/documentation/metrics.md +++ b/documentation/metrics.md @@ -1997,7 +1997,7 @@ Default config: Supported Version - 9.5+ + 9.5 - 16 @@ -2030,7 +2030,7 @@ Default config: Supported Version - 9.5+ + 9.5 - 16 @@ -2096,7 +2096,7 @@ Default config: Supported Version - 9.5+ + 9.5 - 16 @@ -2208,7 +2208,7 @@ Default config: ### Items -*Checkpoints metrics* use information from `pg_stat_bgwriter`. +*Checkpoints metrics* use information from `pg_stat_bgwriter`. Starting from Postgres 17 this information is pulled from view `pg_stat_checkpointer`. - **Checkpoints Sync Time** @@ -2341,6 +2341,40 @@ Default config: *Requested Checkpoints* maps `checkpoints_req`. + +- **Buffers Written During Checkpoints** + + Zabbix item: + + + + + + + + + + + + + + + + + + + + + + + + + +
NamePostgreSQL bgwriter: Buffers Written During Checkpoints
Keypgsql.checkpoint[buffers_written]
TypeNumeric (float)
Units
DeltaSimple Change
Supported Version17+
+ + *Buffers Written During Checkpoints* maps `buffers_written`. + + ### Graphs diff --git a/mamonsu/plugins/pgsql/bgwriter.py b/mamonsu/plugins/pgsql/bgwriter.py index 6d95013..2ca2d70 100644 --- a/mamonsu/plugins/pgsql/bgwriter.py +++ b/mamonsu/plugins/pgsql/bgwriter.py @@ -12,44 +12,68 @@ class BgWriter(Plugin): SELECT {0} FROM pg_catalog.pg_stat_bgwriter; """ - Items = [ - # key, zbx_key, description, - # ('graph name', color, side), units, delta - - ("buffers_checkpoint", "bgwriter[buffers_checkpoint]", - "Buffers Written During Checkpoints", - ("PostgreSQL bgwriter", "006AAE", 1), - Plugin.DELTA.simple_change), - - ("buffers_clean", "bgwriter[buffers_clean]", - "Buffers Written", - ("PostgreSQL bgwriter", "00CC00", 1), - Plugin.DELTA.simple_change), - - ("maxwritten_clean", "bgwriter[maxwritten_clean]", - "Number of bgwriter Stopped by Max Write Count", - ("PostgreSQL bgwriter", "FF5656", 0), - Plugin.DELTA.simple_change), - - ("buffers_backend", "bgwriter[buffers_backend]", - "Buffers Written Directly by a Backend", - ("PostgreSQL bgwriter", "9C8A4E", 1), - Plugin.DELTA.simple_change), - - ("buffers_backend_fsync", "bgwriter[buffers_backend_fsync]", - "Times a Backend Execute Its Own Fsync", - ("PostgreSQL bgwriter", "00CC00", 0), - Plugin.DELTA.simple_change), - - ("buffers_alloc", "bgwriter[buffers_alloc]", - "Buffers Allocated", - ("PostgreSQL bgwriter", "FF5656", 1), - Plugin.DELTA.simple_change) - ] graph_name_buffers = "PostgreSQL bgwriter: Buffers" graph_name_ws = "PostgreSQL bgwriter: Write/Sync" + def __init__(self, config): + super(BgWriter, self).__init__(config) + if Pooler.server_version_less("17"): + self.Items = [ + # key, zbx_key, description, + # ('graph name', color, side), units, delta + + ("buffers_checkpoint", "bgwriter[buffers_checkpoint]", + "Buffers Written During Checkpoints", + ("PostgreSQL bgwriter", "006AAE", 1), + Plugin.DELTA.simple_change), + + ("buffers_clean", "bgwriter[buffers_clean]", + "Buffers Written", + ("PostgreSQL bgwriter", "00CC00", 1), + Plugin.DELTA.simple_change), + + ("maxwritten_clean", "bgwriter[maxwritten_clean]", + "Number of bgwriter Stopped by Max Write Count", + ("PostgreSQL bgwriter", "FF5656", 0), + Plugin.DELTA.simple_change), + + ("buffers_backend", "bgwriter[buffers_backend]", + "Buffers Written Directly by a Backend", + ("PostgreSQL bgwriter", "9C8A4E", 1), + Plugin.DELTA.simple_change), + + ("buffers_backend_fsync", "bgwriter[buffers_backend_fsync]", + "Times a Backend Execute Its Own Fsync", + ("PostgreSQL bgwriter", "00CC00", 0), + Plugin.DELTA.simple_change), + + ("buffers_alloc", "bgwriter[buffers_alloc]", + "Buffers Allocated", + ("PostgreSQL bgwriter", "FF5656", 1), + Plugin.DELTA.simple_change) + ] + else: + self.Items = [ + # key, zbx_key, description, + # ('graph name', color, side), units, delta + + ("buffers_clean", "bgwriter[buffers_clean]", + "Buffers Written", + ("PostgreSQL bgwriter", "00CC00", 1), + Plugin.DELTA.simple_change), + + ("maxwritten_clean", "bgwriter[maxwritten_clean]", + "Number of bgwriter Stopped by Max Write Count", + ("PostgreSQL bgwriter", "FF5656", 0), + Plugin.DELTA.simple_change), + + ("buffers_alloc", "bgwriter[buffers_alloc]", + "Buffers Allocated", + ("PostgreSQL bgwriter", "FF5656", 1), + Plugin.DELTA.simple_change) + ] + def run(self, zbx): columns = [x[0] for x in self.Items] result = Pooler.query(self.query.format(", ".join(columns))) diff --git a/mamonsu/plugins/pgsql/checkpoint.py b/mamonsu/plugins/pgsql/checkpoint.py index f4a5324..80eff40 100644 --- a/mamonsu/plugins/pgsql/checkpoint.py +++ b/mamonsu/plugins/pgsql/checkpoint.py @@ -9,14 +9,6 @@ class Checkpoint(Plugin): AgentPluginType = "pg" Interval = 60 * 5 - query = """ - SELECT {0} - FROM pg_catalog.pg_stat_bgwriter; - """ # for mamonsu and agent - query_interval = """ - SELECT {0}*3600 - FROM pg_catalog.pg_stat_bgwriter; - """ # for mamonsu and agent checkpoints in hour key = "pgsql.checkpoint{0}" # key: (macro, value) @@ -24,34 +16,76 @@ class Checkpoint(Plugin): "max_checkpoint_by_wal_in_hour": [("macro", "{$MAX_CHECKPOINT_BY_WAL_IN_HOUR}"), ("value", 12)] } - Items = [ - # key, zbx_key, description, - # ('graph name', color, side), units, delta, factor - - ("checkpoints_timed", "count_timed", - "by Timeout (in hour)", - ("PostgreSQL Checkpoints: Count (in hour)", "00CC00", 0), - Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60), - - ("checkpoints_req", "count_wal", - "by WAL (in hour)", - ("PostgreSQL Checkpoints: Count (in hour)", "FF5656", 0), - Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60), - - ("checkpoint_write_time", "write_time", - "Write Time", - ("PostgreSQL Checkpoints: Write/Sync", "00CC00", 1), - Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1), - - ("checkpoint_sync_time", "checkpoint_sync_time", - "Sync Time", - ("PostgreSQL Checkpoints: Write/Sync", "FF5656", 1), - Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1) - ] - graph_name_count = "PostgreSQL Checkpoints: Count (in hour)" graph_name_ws = "PostgreSQL Checkpoints: Write/Sync" + def __init__(self, config): + super(Checkpoint, self).__init__(config) + if Pooler.server_version_less("17"): + self.query = """ + SELECT {0} + FROM pg_catalog.pg_stat_bgwriter; + """ # for mamonsu and agent + self.query_interval = """ + SELECT {0}*3600 + FROM pg_catalog.pg_stat_bgwriter; + """ # for mamonsu and agent checkpoints in hour + self.Items = [ + # key, zbx_key, description, + # ('graph name', color, side), units, delta, factor + ("checkpoints_timed", "count_timed", + "by Timeout (in hour)", + ("PostgreSQL Checkpoints: Count (in hour)", "00CC00", 0), + Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60), + + ("checkpoints_req", "count_wal", + "by WAL (in hour)", + ("PostgreSQL Checkpoints: Count (in hour)", "FF5656", 0), + Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60), + + ("checkpoint_write_time", "write_time", + "Write Time", + ("PostgreSQL Checkpoints: Write/Sync", "00CC00", 1), + Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1), + + ("checkpoint_sync_time", "checkpoint_sync_time", + "Sync Time", + ("PostgreSQL Checkpoints: Write/Sync", "FF5656", 1), + Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1) + ] + else: + self.query = """ + SELECT {0} + FROM pg_catalog.pg_stat_checkpointer; + """ # for mamonsu and agent + self.query_interval = """ + SELECT {0}*3600 + FROM pg_catalog.pg_stat_checkpointer; + """ # for mamonsu and agent checkpoints in hour + self.Items = [ + # key, zbx_key, description, + # ('graph name', color, side), units, delta, factor + ("num_timed", "count_timed", + "by Timeout (in hour)", + ("PostgreSQL Checkpoints: Count (in hour)", "00CC00", 0), + Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60), + + ("num_requested", "count_wal", + "by WAL (in hour)", + ("PostgreSQL Checkpoints: Count (in hour)", "FF5656", 0), + Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60), + + ("write_time", "write_time", + "Write Time", + ("PostgreSQL Checkpoints: Write/Sync", "00CC00", 1), + Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1), + + ("sync_time", "checkpoint_sync_time", + "Sync Time", + ("PostgreSQL Checkpoints: Write/Sync", "FF5656", 1), + Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1) + ] + def run(self, zbx): columns = [x[0] for x in self.Items] result = Pooler.query(self.query.format(", ".join(columns))) @@ -146,5 +180,5 @@ def keys_and_queries(self, template_zabbix): else: result.append( "{0}[*],$2 $1 -c \"{1}\"".format(self.key.format("." + item[1]), - self.query_interval.format(item[0]))) + self.query_interval.format(item[0]))) return template_zabbix.key_and_query(result) From 9cafa8991c0ce8b913f48d3f155d3dd7b9c544db Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Fri, 13 Dec 2024 18:48:11 +0400 Subject: [PATCH 10/28] cicd: fixed failing pipelines - workaround possible /sys/fs/cgroup issue - add test mertric files for Postgres 16 and 17 - install pg_buffercache extension in test DB - fix system.uptime expected metric name --- github-actions-tests/mamonsu_build.sh | 7 +- github-actions-tests/metrics.sh | 4 +- .../sources/metrics-linux-10.txt | 2 +- .../sources/metrics-linux-11.txt | 2 +- .../sources/metrics-linux-12.txt | 2 +- .../sources/metrics-linux-13.txt | 2 +- .../sources/metrics-linux-14.txt | 2 +- .../sources/metrics-linux-16.txt | 130 ++++++++++++++++++ .../sources/metrics-linux-17.txt | 116 ++++++++++++++++ .../sources/metrics-linux-9.6.txt | 2 +- .../sources/metrics-linux-full-list.txt | 2 +- 11 files changed, 260 insertions(+), 11 deletions(-) create mode 100644 github-actions-tests/sources/metrics-linux-16.txt create mode 100644 github-actions-tests/sources/metrics-linux-17.txt diff --git a/github-actions-tests/mamonsu_build.sh b/github-actions-tests/mamonsu_build.sh index 137e072..6fbb92d 100644 --- a/github-actions-tests/mamonsu_build.sh +++ b/github-actions-tests/mamonsu_build.sh @@ -42,8 +42,9 @@ if [ "${OS%:*}" = "centos" ]; then make rpm sudo rpm -i ./mamonsu*.rpm cat /mamonsu/github-actions-tests/sources/agent_3.5.9.conf > /etc/mamonsu/agent.conf - systemctl daemon-reload - systemctl restart mamonsu + # ensuring mamonsu can actually start + sudo su -s /bin/bash -c "mamonsu bootstrap -x --user postgres -d mamonsu_test_db" mamonsu + /etc/init.d/mamonsu restart sleep 5 echo && echo && echo "mamonsu version:" mamonsu --version @@ -65,6 +66,8 @@ elif [ "${OS%:*}" = "ubuntu" ]; then make deb sudo dpkg -i ./mamonsu*.deb cat /mamonsu/github-actions-tests/sources/agent_3.5.9.conf > /etc/mamonsu/agent.conf + # ensuring mamonsu can actually start + sudo su -s /bin/bash -c "mamonsu bootstrap -x --user postgres -d mamonsu_test_db" mamonsu service mamonsu restart sleep 5 echo && echo && echo "mamonsu version:" diff --git a/github-actions-tests/metrics.sh b/github-actions-tests/metrics.sh index a4ebf63..5ea6694 100644 --- a/github-actions-tests/metrics.sh +++ b/github-actions-tests/metrics.sh @@ -60,12 +60,12 @@ END sleep 120 # read metric for specific version -while read metric; do +for metric in $(cat ${METRICS_FILE}); do GREP=$( mamonsu agent metric-get ${metric} | grep "pgsql\|sys\|mamonsu" ) if [ -z "$GREP" ]; then echo "---> ERROR: Cannot found metric $metric" exit 11 fi -done <"${METRICS_FILE}" +done echo && echo diff --git a/github-actions-tests/sources/metrics-linux-10.txt b/github-actions-tests/sources/metrics-linux-10.txt index f62a60f..c2d044c 100644 --- a/github-actions-tests/sources/metrics-linux-10.txt +++ b/github-actions-tests/sources/metrics-linux-10.txt @@ -120,4 +120,4 @@ system.vfs.free[/] system.vfs.percent_free[/] system.vfs.percent_inode_free[/] system.vfs.used[/] -system.up_time[] \ No newline at end of file +system.uptime[] diff --git a/github-actions-tests/sources/metrics-linux-11.txt b/github-actions-tests/sources/metrics-linux-11.txt index f62a60f..c2d044c 100644 --- a/github-actions-tests/sources/metrics-linux-11.txt +++ b/github-actions-tests/sources/metrics-linux-11.txt @@ -120,4 +120,4 @@ system.vfs.free[/] system.vfs.percent_free[/] system.vfs.percent_inode_free[/] system.vfs.used[/] -system.up_time[] \ No newline at end of file +system.uptime[] diff --git a/github-actions-tests/sources/metrics-linux-12.txt b/github-actions-tests/sources/metrics-linux-12.txt index 94ffe7e..1c09797 100644 --- a/github-actions-tests/sources/metrics-linux-12.txt +++ b/github-actions-tests/sources/metrics-linux-12.txt @@ -121,4 +121,4 @@ system.vfs.free[/] system.vfs.percent_free[/] system.vfs.percent_inode_free[/] system.vfs.used[/] -system.up_time[] \ No newline at end of file +system.uptime[] diff --git a/github-actions-tests/sources/metrics-linux-13.txt b/github-actions-tests/sources/metrics-linux-13.txt index c847ac5..b6a0d1c 100644 --- a/github-actions-tests/sources/metrics-linux-13.txt +++ b/github-actions-tests/sources/metrics-linux-13.txt @@ -125,4 +125,4 @@ system.vfs.free[/] system.vfs.percent_free[/] system.vfs.percent_inode_free[/] system.vfs.used[/] -system.up_time[] \ No newline at end of file +system.uptime[] diff --git a/github-actions-tests/sources/metrics-linux-14.txt b/github-actions-tests/sources/metrics-linux-14.txt index fcc168b..71f2684 100644 --- a/github-actions-tests/sources/metrics-linux-14.txt +++ b/github-actions-tests/sources/metrics-linux-14.txt @@ -132,4 +132,4 @@ system.vfs.free[/] system.vfs.percent_free[/] system.vfs.percent_inode_free[/] system.vfs.used[/] -system.up_time[] \ No newline at end of file +system.uptime[] diff --git a/github-actions-tests/sources/metrics-linux-16.txt b/github-actions-tests/sources/metrics-linux-16.txt new file mode 100644 index 0000000..cfe646d --- /dev/null +++ b/github-actions-tests/sources/metrics-linux-16.txt @@ -0,0 +1,130 @@ +mamonsu.memory.rss[max] +mamonsu.plugin.errors[] +mamonsu.plugin.keepalive[] +pgsql.archive_command[archived_files] +pgsql.archive_command[count_files_to_archive] +pgsql.archive_command[failed_trying_to_archive] +pgsql.archive_command[size_files_to_archive] +pgsql.autovacuum.count[] +pgsql.autovacuum.utilization[] +pgsql.bgwriter[buffers_alloc] +pgsql.bgwriter[buffers_backend] +pgsql.bgwriter[buffers_backend_fsync] +pgsql.bgwriter[buffers_checkpoint] +pgsql.bgwriter[buffers_clean] +pgsql.bgwriter[maxwritten_clean] +pgsql.blocks[hit] +pgsql.blocks[read] +pgsql.checkpoint[checkpoint_sync_time] +pgsql.checkpoint[count_timed] +pgsql.checkpoint[count_wal] +pgsql.checkpoint[write_time] +pgsql.connections[active] +pgsql.connections[disabled] +pgsql.connections[fastpath_function_call] +pgsql.connections[idle] +pgsql.connections[idle_in_transaction] +pgsql.connections[idle_in_transaction_aborted] +pgsql.connections[max_connections] +pgsql.connections[other] +pgsql.connections[total] +pgsql.connections[waiting] +pgsql.database.discovery[] +pgsql.database.bloating_tables[mamonsu_test_db] +pgsql.database.bloating_tables[postgres] +pgsql.database.invalid_indexes[mamonsu_test_db] +pgsql.database.invalid_indexes[postgres] +pgsql.database.max_age[mamonsu_test_db] +pgsql.database.max_age[postgres] +pgsql.database.size[mamonsu_test_db] +pgsql.database.size[postgres] +pgsql.events[checksum_failures] +pgsql.events[conflicts] +pgsql.events[deadlocks] +pgsql.events[xact_rollback] +pgsql.oldest[transaction_time] +pgsql.oldest[xid_age] +pgsql.ping[] +pgsql.pg_locks[accessexclusive] +pgsql.pg_locks[accessshare] +pgsql.pg_locks[exclusive] +pgsql.pg_locks[rowexclusive] +pgsql.pg_locks[rowshare] +pgsql.pg_locks[share] +pgsql.pg_locks[sharerowexclusive] +pgsql.pg_locks[shareupdateexclusive] +pgsql.parallel[queries] +pgsql.prepared.count +pgsql.prepared.oldest +pgsql.relation.size[] +pgsql.relation.size[mamonsu_test_db.mamonsu.config] +pgsql.relation.size[postgres.pg_catalog.pg_class] +pgsql.replication.non_active_slots[] +pgsql.replication_lag[sec] +pgsql.replication_lag[sec] +pgsql.stat[dirty_bytes] +pgsql.stat[other_time] +pgsql.stat[read_bytes] +pgsql.stat[read_time] +pgsql.stat[wal_bytes] +pgsql.stat[wal_fpi] +pgsql.stat[wal_records] +pgsql.stat[write_bytes] +pgsql.stat[write_time] +pgsql.stat_info[dealloc] +pgsql.stat_info[stats_reset] +pgsql.temp[bytes] +pgsql.temp[files] +pgsql.transactions[committed] +pgsql.tuples[deleted] +pgsql.tuples[fetched] +pgsql.tuples[inserted] +pgsql.tuples[returned] +pgsql.tuples[updated] +pgsql.uptime[] +pgsql.wal.buffers_full[] +pgsql.wal.count[] +pgsql.wal.fpi.count[] +pgsql.wal.records.count[] +pgsql.wal.sync_time[] +pgsql.wal.write[] +pgsql.wal.write_time[] +system.cpu[idle] +system.cpu[iowait] +system.cpu[irq] +system.cpu[nice] +system.cpu[softirq] +system.cpu[system] +system.cpu[user] +system.disk.discovery[] +system.disk.all_read[] +system.disk.all_write[] +system.disk.all_read_b[] +system.disk.all_write_b[] +system.la[1] +system.memory[active] +system.memory[available] +system.memory[buffers] +system.memory[cached] +system.memory[committed] +system.memory[inactive] +system.memory[mapped] +system.memory[page_tables] +system.memory[slab] +system.memory[swap] +system.memory[swap_cache] +system.memory[total] +system.memory[vmalloc_used] +system.memory[unused] +system.memory[used] +system.net.discovery[] +system.open_files[] +system.processes[blocked] +system.processes[forkrate] +system.processes[running] +system.vfs.discovery[] +system.vfs.free[/] +system.vfs.percent_free[/] +system.vfs.percent_inode_free[/] +system.vfs.used[/] +system.uptime[] diff --git a/github-actions-tests/sources/metrics-linux-17.txt b/github-actions-tests/sources/metrics-linux-17.txt new file mode 100644 index 0000000..1959c69 --- /dev/null +++ b/github-actions-tests/sources/metrics-linux-17.txt @@ -0,0 +1,116 @@ +mamonsu.memory.rss[max] +mamonsu.plugin.errors[] +mamonsu.plugin.keepalive[] +pgsql.archive_command[archived_files] +pgsql.archive_command[count_files_to_archive] +pgsql.archive_command[failed_trying_to_archive] +pgsql.archive_command[size_files_to_archive] +pgsql.autovacuum.count[] +pgsql.autovacuum.utilization[] +pgsql.bgwriter[buffers_alloc] +pgsql.bgwriter[buffers_clean] +pgsql.bgwriter[maxwritten_clean] +pgsql.blocks[hit] +pgsql.blocks[read] +pgsql.checkpoint[checkpoint_sync_time] +pgsql.checkpoint[count_timed] +pgsql.checkpoint[count_wal] +pgsql.checkpoint[write_time] +pgsql.connections[active] +pgsql.connections[disabled] +pgsql.connections[fastpath_function_call] +pgsql.connections[idle] +pgsql.connections[idle_in_transaction] +pgsql.connections[idle_in_transaction_aborted] +pgsql.connections[max_connections] +pgsql.connections[other] +pgsql.connections[total] +pgsql.connections[waiting] +pgsql.database.discovery[] +pgsql.database.bloating_tables[mamonsu_test_db] +pgsql.database.bloating_tables[postgres] +pgsql.database.invalid_indexes[mamonsu_test_db] +pgsql.database.invalid_indexes[postgres] +pgsql.database.max_age[mamonsu_test_db] +pgsql.database.max_age[postgres] +pgsql.database.size[mamonsu_test_db] +pgsql.database.size[postgres] +pgsql.events[checksum_failures] +pgsql.events[conflicts] +pgsql.events[deadlocks] +pgsql.events[xact_rollback] +pgsql.oldest[transaction_time] +pgsql.oldest[xid_age] +pgsql.ping[] +pgsql.pg_locks[accessexclusive] +pgsql.pg_locks[accessshare] +pgsql.pg_locks[exclusive] +pgsql.pg_locks[rowexclusive] +pgsql.pg_locks[rowshare] +pgsql.pg_locks[share] +pgsql.pg_locks[sharerowexclusive] +pgsql.pg_locks[shareupdateexclusive] +pgsql.parallel[queries] +pgsql.prepared.count +pgsql.prepared.oldest +pgsql.relation.size[] +pgsql.relation.size[mamonsu_test_db.mamonsu.config] +pgsql.relation.size[postgres.pg_catalog.pg_class] +pgsql.replication.non_active_slots[] +pgsql.replication_lag[sec] +pgsql.replication_lag[sec] +pgsql.temp[bytes] +pgsql.temp[files] +pgsql.transactions[committed] +pgsql.tuples[deleted] +pgsql.tuples[fetched] +pgsql.tuples[inserted] +pgsql.tuples[returned] +pgsql.tuples[updated] +pgsql.uptime[] +pgsql.wal.buffers_full[] +pgsql.wal.count[] +pgsql.wal.fpi.count[] +pgsql.wal.records.count[] +pgsql.wal.sync_time[] +pgsql.wal.write[] +pgsql.wal.write_time[] +system.cpu[idle] +system.cpu[iowait] +system.cpu[irq] +system.cpu[nice] +system.cpu[softirq] +system.cpu[system] +system.cpu[user] +system.disk.discovery[] +system.disk.all_read[] +system.disk.all_write[] +system.disk.all_read_b[] +system.disk.all_write_b[] +system.la[1] +system.memory[active] +system.memory[available] +system.memory[buffers] +system.memory[cached] +system.memory[committed] +system.memory[inactive] +system.memory[mapped] +system.memory[page_tables] +system.memory[slab] +system.memory[swap] +system.memory[swap_cache] +system.memory[total] +system.memory[vmalloc_used] +system.memory[unused] +system.memory[used] +system.net.discovery[] +system.open_files[] +system.processes[blocked] +system.processes[forkrate] +system.processes[running] +system.vfs.discovery[] +system.vfs.free[/] +system.vfs.percent_free[/] +system.vfs.percent_inode_free[/] +system.vfs.used[/] +system.uptime[] diff --git a/github-actions-tests/sources/metrics-linux-9.6.txt b/github-actions-tests/sources/metrics-linux-9.6.txt index 3e3b990..1623ddc 100644 --- a/github-actions-tests/sources/metrics-linux-9.6.txt +++ b/github-actions-tests/sources/metrics-linux-9.6.txt @@ -119,4 +119,4 @@ system.vfs.free[/] system.vfs.percent_free[/] system.vfs.percent_inode_free[/] system.vfs.used[/] -system.up_time[] \ No newline at end of file +system.uptime[] diff --git a/github-actions-tests/sources/metrics-linux-full-list.txt b/github-actions-tests/sources/metrics-linux-full-list.txt index a658c9a..798ad2f 100644 --- a/github-actions-tests/sources/metrics-linux-full-list.txt +++ b/github-actions-tests/sources/metrics-linux-full-list.txt @@ -133,4 +133,4 @@ system.vfs.free[/] system.vfs.percent_free[/] system.vfs.percent_inode_free[/] system.vfs.used[/] -system.up_time[] \ No newline at end of file +system.uptime[] From 55bff231983bddfba0109cbd399070a78b9123f3 Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Sat, 14 Dec 2024 01:30:54 +0400 Subject: [PATCH 11/28] build: upgrade to 3.5.10 --- .github/workflows/mamonsu-tests-dev.yml | 2 +- .github/workflows/mamonsu-tests-master.yml | 2 +- github-actions-tests/mamonsu_build.sh | 4 ++-- .../sources/{agent_3.5.9.conf => agent_3.5.10.conf} | 0 mamonsu/__init__.py | 2 +- packaging/debian/changelog | 5 +++++ packaging/rpm/SPECS/mamonsu.spec | 7 ++++++- packaging/win/mamonsu.def.nsh | 2 +- 8 files changed, 17 insertions(+), 7 deletions(-) rename github-actions-tests/sources/{agent_3.5.9.conf => agent_3.5.10.conf} (100%) diff --git a/.github/workflows/mamonsu-tests-dev.yml b/.github/workflows/mamonsu-tests-dev.yml index a7a3885..f32e2ea 100644 --- a/.github/workflows/mamonsu-tests-dev.yml +++ b/.github/workflows/mamonsu-tests-dev.yml @@ -86,7 +86,7 @@ jobs: echo "zabbix_address=$(hostname -I | awk '{print $1}')" >> $GITHUB_OUTPUT id: zabbix_address - name: Edit Zabbix address in agent.conf - run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.9.conf + run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.10.conf - name: Copy test scripts to container run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) mkdir -p -m 755 /mamonsu/ diff --git a/.github/workflows/mamonsu-tests-master.yml b/.github/workflows/mamonsu-tests-master.yml index 0d895af..6c07531 100644 --- a/.github/workflows/mamonsu-tests-master.yml +++ b/.github/workflows/mamonsu-tests-master.yml @@ -91,7 +91,7 @@ jobs: echo "zabbix_address=$(hostname -I | awk '{print $1}')" >> $GITHUB_OUTPUT id: zabbix_address - name: Edit Zabbix address in agent.conf - run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.9.conf + run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.10.conf - name: Copy test scripts to container run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) mkdir -p -m 755 /mamonsu/ diff --git a/github-actions-tests/mamonsu_build.sh b/github-actions-tests/mamonsu_build.sh index 6fbb92d..ac9dfca 100644 --- a/github-actions-tests/mamonsu_build.sh +++ b/github-actions-tests/mamonsu_build.sh @@ -41,7 +41,7 @@ if [ "${OS%:*}" = "centos" ]; then python3 setup.py build && python3 setup.py install make rpm sudo rpm -i ./mamonsu*.rpm - cat /mamonsu/github-actions-tests/sources/agent_3.5.9.conf > /etc/mamonsu/agent.conf + cat /mamonsu/github-actions-tests/sources/agent_3.5.10.conf > /etc/mamonsu/agent.conf # ensuring mamonsu can actually start sudo su -s /bin/bash -c "mamonsu bootstrap -x --user postgres -d mamonsu_test_db" mamonsu /etc/init.d/mamonsu restart @@ -65,7 +65,7 @@ elif [ "${OS%:*}" = "ubuntu" ]; then python3 setup.py build && python3 setup.py install make deb sudo dpkg -i ./mamonsu*.deb - cat /mamonsu/github-actions-tests/sources/agent_3.5.9.conf > /etc/mamonsu/agent.conf + cat /mamonsu/github-actions-tests/sources/agent_3.5.10.conf > /etc/mamonsu/agent.conf # ensuring mamonsu can actually start sudo su -s /bin/bash -c "mamonsu bootstrap -x --user postgres -d mamonsu_test_db" mamonsu service mamonsu restart diff --git a/github-actions-tests/sources/agent_3.5.9.conf b/github-actions-tests/sources/agent_3.5.10.conf similarity index 100% rename from github-actions-tests/sources/agent_3.5.9.conf rename to github-actions-tests/sources/agent_3.5.10.conf diff --git a/mamonsu/__init__.py b/mamonsu/__init__.py index 634d8d3..6ccb3bc 100644 --- a/mamonsu/__init__.py +++ b/mamonsu/__init__.py @@ -1,7 +1,7 @@ __author__ = 'Dmitry Vasilyev' __author_email__ = 'info@postgrespro.ru' __description__ = 'Monitoring agent for PostgreSQL' -__version__ = '3.5.9' +__version__ = '3.5.10' __licence__ = 'BSD' __url__ = 'https://github.com/postgrespro/mamonsu' diff --git a/packaging/debian/changelog b/packaging/debian/changelog index dd77d37..17eb03b 100644 --- a/packaging/debian/changelog +++ b/packaging/debian/changelog @@ -1,3 +1,8 @@ +mamonsu (3.5.10-1) stable; urgency=low + * Updated checkpoint plugin: added support for new view pg_stat_checkpointer; + * Updated bgwriter plugin: consider updated view pg_stat_bgwriter in postgres 17; + * Run zabbix cli tools with latest setuptools installed (>67.7.2); + mamonsu (3.5.9-1) stable; urgency=low * Run on systems with latest setuptools installed (>67.7.2); * Drop using dotted user:group specification in RPM pre-install stage; diff --git a/packaging/rpm/SPECS/mamonsu.spec b/packaging/rpm/SPECS/mamonsu.spec index f9e19b1..7aab82d 100644 --- a/packaging/rpm/SPECS/mamonsu.spec +++ b/packaging/rpm/SPECS/mamonsu.spec @@ -1,5 +1,5 @@ Name: mamonsu -Version: 3.5.9 +Version: 3.5.10 Release: 1%{?dist} Summary: Monitoring agent for PostgreSQL Group: Applications/Internet @@ -73,6 +73,11 @@ chown -R mamonsu:mamonsu /var/log/mamonsu chown -R mamonsu:mamonsu /etc/mamonsu %changelog +* Sat Dec 14 2024 Maxim Styushin - 3.5.10-1 + - Updated checkpoint plugin: added support for new view pg_stat_checkpointer; + - Updated bgwriter plugin: consider updated view pg_stat_bgwriter in postgres 17; + - Run zabbix cli tools with latest setuptools installed (>67.7.2); + * Mon Aug 19 2024 Maxim Styushin - 3.5.9-1 - Run on systems with latest setuptools installed (>67.7.2); - Drop using dotted user:group specification in RPM pre-install stage; diff --git a/packaging/win/mamonsu.def.nsh b/packaging/win/mamonsu.def.nsh index 5ca5afc..3ebffda 100644 --- a/packaging/win/mamonsu.def.nsh +++ b/packaging/win/mamonsu.def.nsh @@ -1,5 +1,5 @@ !define NAME Mamonsu -!define VERSION 3.5.9 +!define VERSION 3.5.10 !define MAMONSU_REG_PATH "Software\PostgresPro\Mamonsu" !define MAMONSU_REG_UNINSTALLER_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall" !define EDB_REG "SOFTWARE\Postgresql" From 3465255b2978d8adbbcf06dcb5fce3195b3abc55 Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Tue, 14 Jan 2025 18:22:18 +0400 Subject: [PATCH 12/28] fix: count_wal_lag_lsn return type to bigint --- mamonsu/tools/bootstrap/sql.py | 38 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/mamonsu/tools/bootstrap/sql.py b/mamonsu/tools/bootstrap/sql.py index fb56a9d..f37be0f 100644 --- a/mamonsu/tools/bootstrap/sql.py +++ b/mamonsu/tools/bootstrap/sql.py @@ -7,7 +7,7 @@ $do$ BEGIN IF NOT EXISTS ( - SELECT FROM pg_catalog.pg_roles + SELECT FROM pg_catalog.pg_roles WHERE rolname = '{0}') THEN CREATE ROLE {0} LOGIN PASSWORD '{0}'; IF EXISTS ( @@ -166,15 +166,15 @@ DROP FUNCTION IF EXISTS mamonsu.get_oldest_transaction(); CREATE or REPLACE FUNCTION mamonsu.get_oldest_transaction() RETURNS DOUBLE PRECISION AS $$ - SELECT - CASE WHEN extract(epoch from max(now() - xact_start)) IS NOT null + SELECT + CASE WHEN extract(epoch from max(now() - xact_start)) IS NOT null AND extract(epoch from max(now() - xact_start))>0 - THEN extract(epoch from max(now() - xact_start)) - ELSE 0 - END - FROM pg_catalog.pg_stat_activity - WHERE - pid NOT IN(select pid from pg_stat_replication) AND + THEN extract(epoch from max(now() - xact_start)) + ELSE 0 + END + FROM pg_catalog.pg_stat_activity + WHERE + pid NOT IN(select pid from pg_stat_replication) AND pid <> pg_backend_pid() $$ LANGUAGE SQL SECURITY DEFINER; @@ -225,15 +225,15 @@ CREATE OR REPLACE FUNCTION mamonsu.prepared_transaction() RETURNS TABLE(count_prepared BIGINT, oldest_prepared BIGINT) AS $$ SELECT COUNT(*) AS count_prepared, -coalesce (ROUND(MAX(EXTRACT (EPOCH FROM (now() - prepared)))),0)::bigint AS oldest_prepared +coalesce (ROUND(MAX(EXTRACT (EPOCH FROM (now() - prepared)))),0)::bigint AS oldest_prepared FROM pg_catalog.pg_prepared_xacts$$ LANGUAGE SQL SECURITY DEFINER; DROP FUNCTION IF EXISTS mamonsu.count_{3}_lag_lsn(); CREATE OR REPLACE FUNCTION mamonsu.count_{3}_lag_lsn() -RETURNS TABLE(application_name TEXT, {8} total_lag INTEGER) AS $$ +RETURNS TABLE(application_name TEXT, {8} total_lag BIGINT) AS $$ SELECT application_name, - {6} - coalesce((pg_{7}_diff(pg_current_{7}(), replay_{9}))::int, 0) AS total_lag + {6} + coalesce((pg_{7}_diff(pg_current_{7}(), replay_{9}))::bigint, 0) AS total_lag FROM pg_stat_replication $$ LANGUAGE SQL SECURITY DEFINER; """ @@ -287,7 +287,7 @@ FROM pg_extension e JOIN pg_namespace n ON e.extnamespace = n.oid - WHERE e.extname = 'pgpro_stats'; + WHERE e.extname = 'pgpro_stats'; EXECUTE 'DROP FUNCTION IF EXISTS mamonsu.wait_sampling_all_locks(); CREATE OR REPLACE FUNCTION mamonsu.wait_sampling_all_locks() RETURNS TABLE(lock_type text, count bigint) AS $$ @@ -298,7 +298,7 @@ FROM (SELECT key, value AS locktuple FROM jsonb_each((SELECT wait_stats FROM ' || extension_schema || '.pgpro_stats_totals() - WHERE object_type = ''cluster''))) setoflocks, + WHERE object_type = ''cluster''))) setoflocks, jsonb_each(setoflocks.locktuple) AS json_data) SELECT CASE @@ -327,7 +327,7 @@ FROM (SELECT key, value AS locktuple FROM jsonb_each((SELECT wait_stats FROM ' || extension_schema || '.pgpro_stats_totals() - WHERE object_type = ''cluster''))) setoflocks, + WHERE object_type = ''cluster''))) setoflocks, jsonb_each(setoflocks.locktuple) AS json_data) SELECT lock_type, @@ -347,7 +347,7 @@ FROM (SELECT key, value AS locktuple FROM jsonb_each((SELECT wait_stats FROM ' || extension_schema || '.pgpro_stats_totals() - WHERE object_type = ''cluster''))) setoflocks, + WHERE object_type = ''cluster''))) setoflocks, jsonb_each(setoflocks.locktuple) AS json_data WHERE setoflocks.key IN (''Lock'', ''LWLock'', ''LWLockTranche'', ''LWLockNamed'')) SELECT @@ -415,13 +415,13 @@ FROM pg_extension e JOIN pg_namespace n ON e.extnamespace = n.oid - WHERE e.extname = 'pgpro_stats'; + WHERE e.extname = 'pgpro_stats'; EXECUTE 'DROP FUNCTION IF EXISTS mamonsu.statements_pro(); CREATE OR REPLACE FUNCTION mamonsu.statements_pro() RETURNS TABLE({columns}) AS $$ SELECT {metrics} FROM ' || extension_schema || '.pgpro_stats_totals() - WHERE object_type = ''cluster''; + WHERE object_type = ''cluster''; $$ LANGUAGE SQL SECURITY DEFINER;'; ELSE EXIT functions_creation; From f9e862382896911a1771de614ec02abda516f7f8 Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Tue, 14 Jan 2025 18:24:12 +0400 Subject: [PATCH 13/28] feat: add support for pgpro_stats 1.8 --- mamonsu/plugins/pgsql/driver/pool.py | 22 +++++++++ mamonsu/plugins/pgsql/statements.py | 70 ++++++++++++++++++++++++---- mamonsu/tools/bootstrap/start.py | 8 +++- 3 files changed, 89 insertions(+), 11 deletions(-) diff --git a/mamonsu/plugins/pgsql/driver/pool.py b/mamonsu/plugins/pgsql/driver/pool.py index bfd4749..dae2a59 100644 --- a/mamonsu/plugins/pgsql/driver/pool.py +++ b/mamonsu/plugins/pgsql/driver/pool.py @@ -110,6 +110,7 @@ def __init__(self, params=None): "bootstrap": {"storage": {}, "counter": 0, "cache": 10, "version": False}, "recovery": {"storage": {}, "counter": 0, "cache": 10}, "extension_schema": {"pg_buffercache": {}, "pg_stat_statements": {}, "pg_wait_sampling": {}, "pgpro_stats": {}}, + "extension_versions" : {}, "pgpro": {"storage": {}}, "pgproee": {"storage": {}} } @@ -135,6 +136,19 @@ def server_version(self, db=None): result.decode("ascii")) return self._cache["server_version"]["storage"][db] + def extension_version(self, extension, db=None): + db = self._normalize_db(db) + if extension in self._cache["extension_versions"] and db in self._cache["extension_versions"][extension][db]: + return self._cache["extension_versions"][extension][db] + + version_string = self.query("select extversion from pg_catalog.pg_extension where lower(extname) = lower('{0}');".format(extension), db)[0][0] + result = bytes( + version_string.split(" ")[0], "utf-8") + self._cache["extension_versions"][extension] = {} + self._cache["extension_versions"][extension][db] = "{0}".format( + result.decode("ascii")) + return self._cache["extension_versions"][extension][db] + def server_version_greater(self, version, db=None): db = self._normalize_db(db) return packaging.version.parse(self.server_version(db)) >= packaging.version.parse(version) @@ -229,6 +243,14 @@ def is_pgpro_ee(self, db=None): self._cache["pgproee"][db] = False return self._cache["pgproee"][db] + def extension_version_greater(self, extension, version, db=None): + db = self._normalize_db(db) + return packaging.version.parse(self.extension_version(extension, db)) >= packaging.version.parse(version) + + def extension_version_less(self, extension, version, db=None): + db = self._normalize_db(db) + return packaging.version.parse(self.extension_version(extension, db)) <= packaging.version.parse(version) + def extension_installed(self, ext, db=None): db = self._normalize_db(db) result = self.query(""" diff --git a/mamonsu/plugins/pgsql/statements.py b/mamonsu/plugins/pgsql/statements.py index 4cebcd6..e294f03 100644 --- a/mamonsu/plugins/pgsql/statements.py +++ b/mamonsu/plugins/pgsql/statements.py @@ -27,7 +27,7 @@ class Statements(Plugin): query_info = """ SELECT {metrics} - FROM {extension_schema}.pg_stat_statements_info; + FROM {extension_schema}.{info_view_name}; """ key = "pgsql." # zbx_key, sql, desc, unit, delta, (Graph, color, side) @@ -88,6 +88,32 @@ class Statements(Plugin): ("PostgreSQL Statements Info: Last Statistics Reset Time", "9C8A4E", 0)) ] + Items_pgpro_stats_1_8 = [ + ("stat[read_bytes]", + "(sum(shared_blks_read+local_blks_read+temp_blks_read)*8*1024)::bigint", + "Read bytes/s", Plugin.UNITS.bytes_per_second, Plugin.DELTA.speed_per_second, + ("PostgreSQL Statements: Bytes", "87C2B9", 0)), + ("stat[write_bytes]", + "(sum(shared_blks_written+local_blks_written+temp_blks_written)*8*1024)::bigint", + "Write bytes/s", Plugin.UNITS.bytes_per_second, Plugin.DELTA.speed_per_second, + ("PostgreSQL Statements: Bytes", "793F5D", 0)), + ("stat[dirty_bytes]", + "(sum(shared_blks_dirtied+local_blks_dirtied)*8*1024)::bigint", + "Dirty bytes/s", Plugin.UNITS.bytes_per_second, Plugin.DELTA.speed_per_second, + ("PostgreSQL Statements: Bytes", "9C8A4E", 0)), + ("stat[read_time]", + "(sum(shared_blk_read_time+local_blk_read_time+temp_blk_read_time)/float4(100))::bigint", + "Read IO Time", Plugin.UNITS.s, Plugin.DELTA.speed_per_second, + ("PostgreSQL Statements: Spent Time", "87C2B9", 0)), + ("stat[write_time]", + "(sum(shared_blk_write_time+local_blk_write_time+temp_blk_write_time)/float4(100))::bigint", + "Write IO Time", Plugin.UNITS.s, Plugin.DELTA.speed_per_second, + ("PostgreSQL Statements: Spent Time", "793F5D", 0)), + ["stat[other_time]", + "(sum(total_exec_time+total_plan_time-shared_blk_read_time-local_blk_read_time-temp_blk_read_time-shared_blk_write_time-local_blk_write_time-temp_blk_write_time)/float4(100))::bigint", + "Other (mostly CPU) Time", Plugin.UNITS.s, Plugin.DELTA.speed_per_second, + ("PostgreSQL Statements: Spent Time", "9C8A4E", 0)]] + all_graphs = [ ("PostgreSQL Statements: Bytes", None), ("PostgreSQL Statements: Spent Time", 1), @@ -115,21 +141,45 @@ def run(self, zbx): # TODO: add 13 and 14 items when pgpro_stats added new WAL metrics all_items = self.Items.copy() - if Pooler.server_version_greater("14"): + + if Pooler.extension_version_greater("pgpro_stats", "1.8"): + info_view = 'pg_stat_statements_info' + if self.extension == "pgpro_stats": + info_view = 'pgpro_stats_info' + + info_items = self.Items_pg_14 + info_params = [x[1] for x in info_items] + info_result = Pooler.query( + self.query_info.format(metrics=(", ".join(info_params)), extension_schema=extension_schema, info_view_name=info_view)) + for key, value in enumerate(info_result[0]): + zbx_key, value = "pgsql.{0}".format( + info_items[key][0]), int(value) + zbx.send(zbx_key, value, info_items[key][4]) + + all_items = self.Items_pgpro_stats_1_8.copy() + all_items += self.Items_pg_13 + + elif Pooler.server_version_greater("14"): self.Items[5][1] = self.Items[5][1].format("total_exec_time+total_plan_time") all_items += self.Items_pg_13 + info_view = 'pgpro_stats_info' if self.extension == "pg_stat_statements": - info_items = self.Items_pg_14 - info_params = [x[1] for x in info_items] - info_result = Pooler.query( - self.query_info.format(metrics=(", ".join(info_params)), extension_schema=extension_schema)) - for key, value in enumerate(info_result[0]): - zbx_key, value = "pgsql.{0}".format( - info_items[key][0]), int(value) - zbx.send(zbx_key, value, info_items[key][4]) + info_view = 'pg_stat_statements_info' + info_items = self.Items_pg_14 + info_params = [x[1] for x in info_items] + info_result = Pooler.query( + self.query_info.format(metrics=(", ".join(info_params)), + extension_schema=extension_schema, + info_view_name=info_view)) + for key, value in enumerate(info_result[0]): + zbx_key, value = "pgsql.{0}".format( + info_items[key][0]), int(value) + zbx.send(zbx_key, value, info_items[key][4]) + elif Pooler.server_version_greater("13"): self.Items[5][1] = self.Items[5][1].format("total_exec_time+total_plan_time") all_items += self.Items_pg_13 + else: self.Items[5][1] = self.Items[5][1].format("total_time") columns = [x[1] for x in all_items] diff --git a/mamonsu/tools/bootstrap/start.py b/mamonsu/tools/bootstrap/start.py index 3976de1..c35e63a 100644 --- a/mamonsu/tools/bootstrap/start.py +++ b/mamonsu/tools/bootstrap/start.py @@ -237,7 +237,13 @@ def run_deploy(): if Pooler.is_pgpro() or Pooler.is_pgpro_ee(): bootstrap_extension_queries = fill_query_params(CreateWaitSamplingFunctionsSQL) Pooler.query(bootstrap_extension_queries) - if Pooler.server_version_greater("12"): + if Pooler.extension_version_greater("pgpro_stats", "1.8"): + statements_items = [x[1] for x in Statements.Items_pgpro_stats_1_8] + [x[1] for x in Statements.Items_pg_13] + statements_columns = [x[0][x[0].find("[")+1:x[0].find("]")] for x in Statements.Items_pgpro_stats_1_8] + [x[0][x[0].find("[")+1:x[0].find("]")] for x in Statements.Items_pg_13] + bootstrap_extension_queries = CreateStatementsFunctionsSQL.format( + columns=" bigint, ".join(statements_columns) + " bigint", metrics=(", ".join(statements_items))) + Pooler.query(bootstrap_extension_queries) + elif Pooler.server_version_greater("12"): statements_items = [x[1] for x in Statements.Items] + ([x[1] for x in Statements.Items_pg_13] if Pooler.server_version_greater("13") else []) statements_items[5] = statements_items[5].format("total_exec_time+total_plan_time") statements_columns = [x[0][x[0].find("[")+1:x[0].find("]")] for x in Statements.Items] + ([x[0][x[0].find("[")+1:x[0].find("]")] for x in Statements.Items_pg_13] if Pooler.server_version_greater("13") else []) From 63d7e4a3a15789cf0cd58b544f006bb20efed6ea Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Wed, 15 Jan 2025 00:50:38 +0400 Subject: [PATCH 14/28] fix: check if pgpro_stats was installed --- mamonsu/plugins/pgsql/statements.py | 2 +- mamonsu/tools/bootstrap/start.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mamonsu/plugins/pgsql/statements.py b/mamonsu/plugins/pgsql/statements.py index e294f03..784f226 100644 --- a/mamonsu/plugins/pgsql/statements.py +++ b/mamonsu/plugins/pgsql/statements.py @@ -142,7 +142,7 @@ def run(self, zbx): # TODO: add 13 and 14 items when pgpro_stats added new WAL metrics all_items = self.Items.copy() - if Pooler.extension_version_greater("pgpro_stats", "1.8"): + if Pooler.extension_installed("pgpro_stats") and Pooler.extension_version_greater("pgpro_stats", "1.8"): info_view = 'pg_stat_statements_info' if self.extension == "pgpro_stats": info_view = 'pgpro_stats_info' diff --git a/mamonsu/tools/bootstrap/start.py b/mamonsu/tools/bootstrap/start.py index c35e63a..6fbc582 100644 --- a/mamonsu/tools/bootstrap/start.py +++ b/mamonsu/tools/bootstrap/start.py @@ -237,7 +237,7 @@ def run_deploy(): if Pooler.is_pgpro() or Pooler.is_pgpro_ee(): bootstrap_extension_queries = fill_query_params(CreateWaitSamplingFunctionsSQL) Pooler.query(bootstrap_extension_queries) - if Pooler.extension_version_greater("pgpro_stats", "1.8"): + if Pooler.extension_installed("pgpro_stats") and Pooler.extension_version_greater("pgpro_stats", "1.8"): statements_items = [x[1] for x in Statements.Items_pgpro_stats_1_8] + [x[1] for x in Statements.Items_pg_13] statements_columns = [x[0][x[0].find("[")+1:x[0].find("]")] for x in Statements.Items_pgpro_stats_1_8] + [x[0][x[0].find("[")+1:x[0].find("]")] for x in Statements.Items_pg_13] bootstrap_extension_queries = CreateStatementsFunctionsSQL.format( From 1319701dc02ea37050b11dab95a0f332b68fa5e0 Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Wed, 15 Jan 2025 01:14:05 +0400 Subject: [PATCH 15/28] build: upgrade to 3.5.11 --- .github/workflows/mamonsu-tests-dev.yml | 2 +- .github/workflows/mamonsu-tests-master.yml | 2 +- github-actions-tests/mamonsu_build.sh | 4 ++-- .../sources/{agent_3.5.10.conf => agent_3.5.11.conf} | 0 mamonsu/__init__.py | 2 +- packaging/debian/changelog | 4 ++++ packaging/rpm/SPECS/mamonsu.spec | 6 +++++- packaging/win/mamonsu.def.nsh | 2 +- 8 files changed, 15 insertions(+), 7 deletions(-) rename github-actions-tests/sources/{agent_3.5.10.conf => agent_3.5.11.conf} (100%) diff --git a/.github/workflows/mamonsu-tests-dev.yml b/.github/workflows/mamonsu-tests-dev.yml index f32e2ea..6e3bf27 100644 --- a/.github/workflows/mamonsu-tests-dev.yml +++ b/.github/workflows/mamonsu-tests-dev.yml @@ -86,7 +86,7 @@ jobs: echo "zabbix_address=$(hostname -I | awk '{print $1}')" >> $GITHUB_OUTPUT id: zabbix_address - name: Edit Zabbix address in agent.conf - run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.10.conf + run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.11.conf - name: Copy test scripts to container run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) mkdir -p -m 755 /mamonsu/ diff --git a/.github/workflows/mamonsu-tests-master.yml b/.github/workflows/mamonsu-tests-master.yml index 6c07531..312134a 100644 --- a/.github/workflows/mamonsu-tests-master.yml +++ b/.github/workflows/mamonsu-tests-master.yml @@ -91,7 +91,7 @@ jobs: echo "zabbix_address=$(hostname -I | awk '{print $1}')" >> $GITHUB_OUTPUT id: zabbix_address - name: Edit Zabbix address in agent.conf - run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.10.conf + run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.11.conf - name: Copy test scripts to container run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) mkdir -p -m 755 /mamonsu/ diff --git a/github-actions-tests/mamonsu_build.sh b/github-actions-tests/mamonsu_build.sh index ac9dfca..def1505 100644 --- a/github-actions-tests/mamonsu_build.sh +++ b/github-actions-tests/mamonsu_build.sh @@ -41,7 +41,7 @@ if [ "${OS%:*}" = "centos" ]; then python3 setup.py build && python3 setup.py install make rpm sudo rpm -i ./mamonsu*.rpm - cat /mamonsu/github-actions-tests/sources/agent_3.5.10.conf > /etc/mamonsu/agent.conf + cat /mamonsu/github-actions-tests/sources/agent_3.5.11.conf > /etc/mamonsu/agent.conf # ensuring mamonsu can actually start sudo su -s /bin/bash -c "mamonsu bootstrap -x --user postgres -d mamonsu_test_db" mamonsu /etc/init.d/mamonsu restart @@ -65,7 +65,7 @@ elif [ "${OS%:*}" = "ubuntu" ]; then python3 setup.py build && python3 setup.py install make deb sudo dpkg -i ./mamonsu*.deb - cat /mamonsu/github-actions-tests/sources/agent_3.5.10.conf > /etc/mamonsu/agent.conf + cat /mamonsu/github-actions-tests/sources/agent_3.5.11.conf > /etc/mamonsu/agent.conf # ensuring mamonsu can actually start sudo su -s /bin/bash -c "mamonsu bootstrap -x --user postgres -d mamonsu_test_db" mamonsu service mamonsu restart diff --git a/github-actions-tests/sources/agent_3.5.10.conf b/github-actions-tests/sources/agent_3.5.11.conf similarity index 100% rename from github-actions-tests/sources/agent_3.5.10.conf rename to github-actions-tests/sources/agent_3.5.11.conf diff --git a/mamonsu/__init__.py b/mamonsu/__init__.py index 6ccb3bc..0265a12 100644 --- a/mamonsu/__init__.py +++ b/mamonsu/__init__.py @@ -1,7 +1,7 @@ __author__ = 'Dmitry Vasilyev' __author_email__ = 'info@postgrespro.ru' __description__ = 'Monitoring agent for PostgreSQL' -__version__ = '3.5.10' +__version__ = '3.5.11' __licence__ = 'BSD' __url__ = 'https://github.com/postgrespro/mamonsu' diff --git a/packaging/debian/changelog b/packaging/debian/changelog index 17eb03b..ab3c0ff 100644 --- a/packaging/debian/changelog +++ b/packaging/debian/changelog @@ -1,3 +1,7 @@ +mamonsu (3.5.11-1) stable; urgency=low + * Updated statements plugin: added support for pgpro_stats 1.8; + * Fixed types for count_wal_lag_lsn() function (int to bigint); + mamonsu (3.5.10-1) stable; urgency=low * Updated checkpoint plugin: added support for new view pg_stat_checkpointer; * Updated bgwriter plugin: consider updated view pg_stat_bgwriter in postgres 17; diff --git a/packaging/rpm/SPECS/mamonsu.spec b/packaging/rpm/SPECS/mamonsu.spec index 7aab82d..7c44f1d 100644 --- a/packaging/rpm/SPECS/mamonsu.spec +++ b/packaging/rpm/SPECS/mamonsu.spec @@ -1,5 +1,5 @@ Name: mamonsu -Version: 3.5.10 +Version: 3.5.11 Release: 1%{?dist} Summary: Monitoring agent for PostgreSQL Group: Applications/Internet @@ -73,6 +73,10 @@ chown -R mamonsu:mamonsu /var/log/mamonsu chown -R mamonsu:mamonsu /etc/mamonsu %changelog +* Wed Jan 15 2025 Maxim Styushin - 3.5.11-1 + - Updated statements plugin: added support for pgpro_stats 1.8; + - Fixed types for count_wal_lag_lsn() function (int to bigint); + * Sat Dec 14 2024 Maxim Styushin - 3.5.10-1 - Updated checkpoint plugin: added support for new view pg_stat_checkpointer; - Updated bgwriter plugin: consider updated view pg_stat_bgwriter in postgres 17; diff --git a/packaging/win/mamonsu.def.nsh b/packaging/win/mamonsu.def.nsh index 3ebffda..8138fe3 100644 --- a/packaging/win/mamonsu.def.nsh +++ b/packaging/win/mamonsu.def.nsh @@ -1,5 +1,5 @@ !define NAME Mamonsu -!define VERSION 3.5.10 +!define VERSION 3.5.11 !define MAMONSU_REG_PATH "Software\PostgresPro\Mamonsu" !define MAMONSU_REG_UNINSTALLER_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall" !define EDB_REG "SOFTWARE\Postgresql" From 3ab4aed65b4888798992644a58ec7a96fc1bc23b Mon Sep 17 00:00:00 2001 From: Maxim Styushin Date: Sat, 22 Feb 2025 23:20:19 +0400 Subject: [PATCH 16/28] feat: add version parser code - port version parser code from public archive of pypa/pkg_resources --- mamonsu/lib/version.py | 576 ++++++++++++++++++ mamonsu/plugins/pgsql/driver/pg8000/core.py | 12 +- mamonsu/plugins/pgsql/driver/pool.py | 19 +- .../plugins/pgsql/memory_leak_diagnostic.py | 8 +- mamonsu/plugins/pgsql/replication.py | 7 +- mamonsu/tools/zabbix_cli/operations.py | 12 +- mamonsu/tools/zabbix_cli/request.py | 7 +- 7 files changed, 598 insertions(+), 43 deletions(-) create mode 100644 mamonsu/lib/version.py diff --git a/mamonsu/lib/version.py b/mamonsu/lib/version.py new file mode 100644 index 0000000..711e933 --- /dev/null +++ b/mamonsu/lib/version.py @@ -0,0 +1,576 @@ +# Copyright (c) Jason R. Coombs +# +# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, +# modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software +# is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +import collections +import itertools +import re +import warnings +from typing import Callable, Iterator, List, Optional, SupportsInt, Tuple, Union + + +class InfinityType: + def __repr__(self) -> str: + return "Infinity" + + def __hash__(self) -> int: + return hash(repr(self)) + + def __lt__(self, other: object) -> bool: + return False + + def __le__(self, other: object) -> bool: + return False + + def __eq__(self, other: object) -> bool: + return isinstance(other, self.__class__) + + def __ne__(self, other: object) -> bool: + return not isinstance(other, self.__class__) + + def __gt__(self, other: object) -> bool: + return True + + def __ge__(self, other: object) -> bool: + return True + + def __neg__(self: object) -> "NegativeInfinityType": + return NegativeInfinity + + +Infinity = InfinityType() + + +class NegativeInfinityType: + def __repr__(self) -> str: + return "-Infinity" + + def __hash__(self) -> int: + return hash(repr(self)) + + def __lt__(self, other: object) -> bool: + return True + + def __le__(self, other: object) -> bool: + return True + + def __eq__(self, other: object) -> bool: + return isinstance(other, self.__class__) + + def __ne__(self, other: object) -> bool: + return not isinstance(other, self.__class__) + + def __gt__(self, other: object) -> bool: + return False + + def __ge__(self, other: object) -> bool: + return False + + def __neg__(self: object) -> InfinityType: + return Infinity + + +NegativeInfinity = NegativeInfinityType() + +__all__ = ["parse", "Version", "LegacyVersion", "InvalidVersion", "VERSION_PATTERN"] + +InfiniteTypes = Union[InfinityType, NegativeInfinityType] +PrePostDevType = Union[InfiniteTypes, Tuple[str, int]] +SubLocalType = Union[InfiniteTypes, int, str] +LocalType = Union[ + NegativeInfinityType, + Tuple[ + Union[ + SubLocalType, + Tuple[SubLocalType, str], + Tuple[NegativeInfinityType, SubLocalType], + ], + ..., + ], +] +CmpKey = Tuple[ + int, Tuple[int, ...], PrePostDevType, PrePostDevType, PrePostDevType, LocalType +] +LegacyCmpKey = Tuple[int, Tuple[str, ...]] +VersionComparisonMethod = Callable[ + [Union[CmpKey, LegacyCmpKey], Union[CmpKey, LegacyCmpKey]], bool +] + +_Version = collections.namedtuple( + "_Version", ["epoch", "release", "dev", "pre", "post", "local"] +) + + +def parse(version: str) -> Union["LegacyVersion", "Version"]: + """ + Parse the given version string and return either a :class:`Version` object + or a :class:`LegacyVersion` object depending on if the given version is + a valid PEP 440 version or a legacy version. + """ + try: + return Version(version) + except InvalidVersion: + return LegacyVersion(version) + + +class InvalidVersion(ValueError): + """ + An invalid version was found, users should refer to PEP 440. + """ + + +class _BaseVersion: + _key: Union[CmpKey, LegacyCmpKey] + + def __hash__(self) -> int: + return hash(self._key) + + # Please keep the duplicated `isinstance` check + # in the six comparisons hereunder + # unless you find a way to avoid adding overhead function calls. + def __lt__(self, other: "_BaseVersion") -> bool: + if not isinstance(other, _BaseVersion): + return NotImplemented + + return self._key < other._key + + def __le__(self, other: "_BaseVersion") -> bool: + if not isinstance(other, _BaseVersion): + return NotImplemented + + return self._key <= other._key + + def __eq__(self, other: object) -> bool: + if not isinstance(other, _BaseVersion): + return NotImplemented + + return self._key == other._key + + def __ge__(self, other: "_BaseVersion") -> bool: + if not isinstance(other, _BaseVersion): + return NotImplemented + + return self._key >= other._key + + def __gt__(self, other: "_BaseVersion") -> bool: + if not isinstance(other, _BaseVersion): + return NotImplemented + + return self._key > other._key + + def __ne__(self, other: object) -> bool: + if not isinstance(other, _BaseVersion): + return NotImplemented + + return self._key != other._key + + +class LegacyVersion(_BaseVersion): + def __init__(self, version: str) -> None: + self._version = str(version) + self._key = _legacy_cmpkey(self._version) + + warnings.warn( + "Creating a LegacyVersion has been deprecated and will be " + "removed in the next major release", + DeprecationWarning, + ) + + def __str__(self) -> str: + return self._version + + def __repr__(self) -> str: + return f"" + + @property + def public(self) -> str: + return self._version + + @property + def base_version(self) -> str: + return self._version + + @property + def epoch(self) -> int: + return -1 + + @property + def release(self) -> None: + return None + + @property + def pre(self) -> None: + return None + + @property + def post(self) -> None: + return None + + @property + def dev(self) -> None: + return None + + @property + def local(self) -> None: + return None + + @property + def is_prerelease(self) -> bool: + return False + + @property + def is_postrelease(self) -> bool: + return False + + @property + def is_devrelease(self) -> bool: + return False + + +_legacy_version_component_re = re.compile(r"(\d+ | [a-z]+ | \.| -)", re.VERBOSE) + +_legacy_version_replacement_map = { + "pre": "c", + "preview": "c", + "-": "final-", + "rc": "c", + "dev": "@", +} + + +def _parse_version_parts(s: str) -> Iterator[str]: + for part in _legacy_version_component_re.split(s): + part = _legacy_version_replacement_map.get(part, part) + + if not part or part == ".": + continue + + if part[:1] in "0123456789": + # pad for numeric comparison + yield part.zfill(8) + else: + yield "*" + part + + # ensure that alpha/beta/candidate are before final + yield "*final" + + +def _legacy_cmpkey(version: str) -> LegacyCmpKey: + + # We hardcode an epoch of -1 here. A PEP 440 version can only have a epoch + # greater than or equal to 0. This will effectively put the LegacyVersion, + # which uses the defacto standard originally implemented by setuptools, + # as before all PEP 440 versions. + epoch = -1 + + # This scheme is taken from pkg_resources.parse_version setuptools prior to + # it's adoption of the packaging library. + parts: List[str] = [] + for part in _parse_version_parts(version.lower()): + if part.startswith("*"): + # remove "-" before a prerelease tag + if part < "*final": + while parts and parts[-1] == "*final-": + parts.pop() + + # remove trailing zeros from each series of numeric parts + while parts and parts[-1] == "00000000": + parts.pop() + + parts.append(part) + + return epoch, tuple(parts) + + +# Deliberately not anchored to the start and end of the string, to make it +# easier for 3rd party code to reuse +VERSION_PATTERN = r""" + v? + (?: + (?:(?P[0-9]+)!)? # epoch + (?P[0-9]+(?:\.[0-9]+)*) # release segment + (?P
                                          # pre-release
+            [-_\.]?
+            (?P(a|b|c|rc|alpha|beta|pre|preview))
+            [-_\.]?
+            (?P[0-9]+)?
+        )?
+        (?P                                         # post release
+            (?:-(?P[0-9]+))
+            |
+            (?:
+                [-_\.]?
+                (?Ppost|rev|r)
+                [-_\.]?
+                (?P[0-9]+)?
+            )
+        )?
+        (?P                                          # dev release
+            [-_\.]?
+            (?Pdev)
+            [-_\.]?
+            (?P[0-9]+)?
+        )?
+    )
+    (?:\+(?P[a-z0-9]+(?:[-_\.][a-z0-9]+)*))?       # local version
+"""
+
+
+class Version(_BaseVersion):
+
+    _regex = re.compile(r"^\s*" + VERSION_PATTERN + r"\s*$", re.VERBOSE | re.IGNORECASE)
+
+    def __init__(self, version: str) -> None:
+
+        # Validate the version and parse it into pieces
+        match = self._regex.search(version)
+        if not match:
+            raise InvalidVersion(f"Invalid version: '{version}'")
+
+        # Store the parsed out pieces of the version
+        self._version = _Version(
+            epoch=int(match.group("epoch")) if match.group("epoch") else 0,
+            release=tuple(int(i) for i in match.group("release").split(".")),
+            pre=_parse_letter_version(match.group("pre_l"), match.group("pre_n")),
+            post=_parse_letter_version(
+                match.group("post_l"), match.group("post_n1") or match.group("post_n2")
+            ),
+            dev=_parse_letter_version(match.group("dev_l"), match.group("dev_n")),
+            local=_parse_local_version(match.group("local")),
+        )
+
+        # Generate a key which will be used for sorting
+        self._key = _cmpkey(
+            self._version.epoch,
+            self._version.release,
+            self._version.pre,
+            self._version.post,
+            self._version.dev,
+            self._version.local,
+        )
+
+    def __repr__(self) -> str:
+        return f""
+
+    def __str__(self) -> str:
+        parts = []
+
+        # Epoch
+        if self.epoch != 0:
+            parts.append(f"{self.epoch}!")
+
+        # Release segment
+        parts.append(".".join(str(x) for x in self.release))
+
+        # Pre-release
+        if self.pre is not None:
+            parts.append("".join(str(x) for x in self.pre))
+
+        # Post-release
+        if self.post is not None:
+            parts.append(f".post{self.post}")
+
+        # Development release
+        if self.dev is not None:
+            parts.append(f".dev{self.dev}")
+
+        # Local version segment
+        if self.local is not None:
+            parts.append(f"+{self.local}")
+
+        return "".join(parts)
+
+    @property
+    def epoch(self) -> int:
+        _epoch: int = self._version.epoch
+        return _epoch
+
+    @property
+    def release(self) -> Tuple[int, ...]:
+        _release: Tuple[int, ...] = self._version.release
+        return _release
+
+    @property
+    def pre(self) -> Optional[Tuple[str, int]]:
+        _pre: Optional[Tuple[str, int]] = self._version.pre
+        return _pre
+
+    @property
+    def post(self) -> Optional[int]:
+        return self._version.post[1] if self._version.post else None
+
+    @property
+    def dev(self) -> Optional[int]:
+        return self._version.dev[1] if self._version.dev else None
+
+    @property
+    def local(self) -> Optional[str]:
+        if self._version.local:
+            return ".".join(str(x) for x in self._version.local)
+        else:
+            return None
+
+    @property
+    def public(self) -> str:
+        return str(self).split("+", 1)[0]
+
+    @property
+    def base_version(self) -> str:
+        parts = []
+
+        # Epoch
+        if self.epoch != 0:
+            parts.append(f"{self.epoch}!")
+
+        # Release segment
+        parts.append(".".join(str(x) for x in self.release))
+
+        return "".join(parts)
+
+    @property
+    def is_prerelease(self) -> bool:
+        return self.dev is not None or self.pre is not None
+
+    @property
+    def is_postrelease(self) -> bool:
+        return self.post is not None
+
+    @property
+    def is_devrelease(self) -> bool:
+        return self.dev is not None
+
+    @property
+    def major(self) -> int:
+        return self.release[0] if len(self.release) >= 1 else 0
+
+    @property
+    def minor(self) -> int:
+        return self.release[1] if len(self.release) >= 2 else 0
+
+    @property
+    def micro(self) -> int:
+        return self.release[2] if len(self.release) >= 3 else 0
+
+
+def _parse_letter_version(
+    letter: str, number: Union[str, bytes, SupportsInt]
+) -> Optional[Tuple[str, int]]:
+
+    if letter:
+        # We consider there to be an implicit 0 in a pre-release if there is
+        # not a numeral associated with it.
+        if number is None:
+            number = 0
+
+        # We normalize any letters to their lower case form
+        letter = letter.lower()
+
+        # We consider some words to be alternate spellings of other words and
+        # in those cases we want to normalize the spellings to our preferred
+        # spelling.
+        if letter == "alpha":
+            letter = "a"
+        elif letter == "beta":
+            letter = "b"
+        elif letter in ["c", "pre", "preview"]:
+            letter = "rc"
+        elif letter in ["rev", "r"]:
+            letter = "post"
+
+        return letter, int(number)
+    if not letter and number:
+        # We assume if we are given a number, but we are not given a letter
+        # then this is using the implicit post release syntax (e.g. 1.0-1)
+        letter = "post"
+
+        return letter, int(number)
+
+    return None
+
+
+_local_version_separators = re.compile(r"[\._-]")
+
+
+def _parse_local_version(local: str) -> Optional[LocalType]:
+    """
+    Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
+    """
+    if local is not None:
+        return tuple(
+            part.lower() if not part.isdigit() else int(part)
+            for part in _local_version_separators.split(local)
+        )
+    return None
+
+
+def _cmpkey(
+    epoch: int,
+    release: Tuple[int, ...],
+    pre: Optional[Tuple[str, int]],
+    post: Optional[Tuple[str, int]],
+    dev: Optional[Tuple[str, int]],
+    local: Optional[Tuple[SubLocalType]],
+) -> CmpKey:
+
+    # When we compare a release version, we want to compare it with all of the
+    # trailing zeros removed. So we'll use a reverse the list, drop all the now
+    # leading zeros until we come to something non zero, then take the rest
+    # re-reverse it back into the correct order and make it a tuple and use
+    # that for our sorting key.
+    _release = tuple(
+        reversed(list(itertools.dropwhile(lambda x: x == 0, reversed(release))))
+    )
+
+    # We need to "trick" the sorting algorithm to put 1.0.dev0 before 1.0a0.
+    # We'll do this by abusing the pre segment, but we _only_ want to do this
+    # if there is not a pre or a post segment. If we have one of those then
+    # the normal sorting rules will handle this case correctly.
+    if pre is None and post is None and dev is not None:
+        _pre: PrePostDevType = NegativeInfinity
+    # Versions without a pre-release (except as noted above) should sort after
+    # those with one.
+    elif pre is None:
+        _pre = Infinity
+    else:
+        _pre = pre
+
+    # Versions without a post segment should sort before those with one.
+    if post is None:
+        _post: PrePostDevType = NegativeInfinity
+
+    else:
+        _post = post
+
+    # Versions without a development segment should sort after those with one.
+    if dev is None:
+        _dev: PrePostDevType = Infinity
+
+    else:
+        _dev = dev
+
+    if local is None:
+        # Versions without a local segment should sort before those with one.
+        _local: LocalType = NegativeInfinity
+    else:
+        # Versions with a local segment need that segment parsed to implement
+        # the sorting rules in PEP440.
+        # - Alpha numeric segments sort before numeric segments
+        # - Alpha numeric segments sort lexicographically
+        # - Numeric segments sort numerically
+        # - Shorter versions sort before longer versions when the prefixes
+        #   match exactly
+        _local = tuple(
+            (i, "") if isinstance(i, int) else (NegativeInfinity, i) for i in local
+        )
+
+    return epoch, _release, _pre, _post, _dev, _local
diff --git a/mamonsu/plugins/pgsql/driver/pg8000/core.py b/mamonsu/plugins/pgsql/driver/pg8000/core.py
index 26db69a..b050af6 100755
--- a/mamonsu/plugins/pgsql/driver/pg8000/core.py
+++ b/mamonsu/plugins/pgsql/driver/pg8000/core.py
@@ -7,11 +7,7 @@
 from struct import Struct
 from warnings import warn
 
-try:
-    from pkg_resources import packaging
-except ImportError:
-    import packaging.version
-
+import mamonsu.lib.version as version
 from mamonsu.plugins.pgsql.driver.pg8000 import converters
 from .exceptions import (
     ArrayContentNotSupportedError, DatabaseError, Error, IntegrityError,
@@ -1425,11 +1421,11 @@ def handle_PARAMETER_STATUS(self, data, ps):
             # since distutils became deprecated we need this hack hoping that
             # postgres package maintainers won't come up with something more exotic
             string_version = value.decode('ascii').split(' ')[0]
-            self._server_version = packaging.version.parse(string_version)
-            if self._server_version < packaging.version.parse('8.2.0'):
+            self._server_version = version.parse(string_version)
+            if self._server_version < version.parse('8.2.0'):
                 self._commands_with_count = (
                     b"INSERT", b"DELETE", b"UPDATE", b"MOVE")
-            elif self._server_version < packaging.version.parse('9.0.0'):
+            elif self._server_version < version.parse('9.0.0'):
                 self._commands_with_count = (
                     b"INSERT", b"DELETE", b"UPDATE", b"MOVE", b"FETCH",
                     b"COPY")
diff --git a/mamonsu/plugins/pgsql/driver/pool.py b/mamonsu/plugins/pgsql/driver/pool.py
index dae2a59..3850b75 100644
--- a/mamonsu/plugins/pgsql/driver/pool.py
+++ b/mamonsu/plugins/pgsql/driver/pool.py
@@ -1,9 +1,6 @@
 from .connection import Connection, ConnectionInfo
 
-try:
-    from pkg_resources import packaging
-except ImportError:
-    import packaging.version
+from mamonsu.lib.version import parse
 
 class Pool(object):
     ExcludeDBs = ["template0", "template1"]
@@ -151,19 +148,17 @@ def extension_version(self, extension, db=None):
 
     def server_version_greater(self, version, db=None):
         db = self._normalize_db(db)
-        return packaging.version.parse(self.server_version(db)) >= packaging.version.parse(version)
+        return parse(self.server_version(db)) >= parse(version)
 
     def server_version_less(self, version, db=None):
         db = self._normalize_db(db)
-        return packaging.version.parse(self.server_version(db)) <= packaging.version.parse(version)
+        return parse(self.server_version(db)) <= parse(version)
 
     def bootstrap_version_greater(self, version):
-        return packaging.version.parse(
-                str(self._cache["bootstrap"]["version"])) >= packaging.version.parse(version)
+        return parse(str(self._cache["bootstrap"]["version"])) >= parse(version)
 
     def bootstrap_version_less(self, version):
-        return packaging.version.parse(
-                str(self._cache["bootstrap"]["version"])) <= packaging.version.parse(version)
+        return parse(str(self._cache["bootstrap"]["version"])) <= parse(version)
 
     def in_recovery(self, db=None):
         db = self._normalize_db(db)
@@ -245,11 +240,11 @@ def is_pgpro_ee(self, db=None):
 
     def extension_version_greater(self, extension, version, db=None):
         db = self._normalize_db(db)
-        return packaging.version.parse(self.extension_version(extension, db)) >= packaging.version.parse(version)
+        return parse(self.extension_version(extension, db)) >= parse(version)
 
     def extension_version_less(self, extension, version, db=None):
         db = self._normalize_db(db)
-        return packaging.version.parse(self.extension_version(extension, db)) <= packaging.version.parse(version)
+        return parse(self.extension_version(extension, db)) <= parse(version)
 
     def extension_installed(self, ext, db=None):
         db = self._normalize_db(db)
diff --git a/mamonsu/plugins/pgsql/memory_leak_diagnostic.py b/mamonsu/plugins/pgsql/memory_leak_diagnostic.py
index c22c5f9..14c0749 100644
--- a/mamonsu/plugins/pgsql/memory_leak_diagnostic.py
+++ b/mamonsu/plugins/pgsql/memory_leak_diagnostic.py
@@ -7,10 +7,8 @@
 import mamonsu.lib.platform as platform
 import posix
 
-try:
-    from pkg_resources import packaging
-except ImportError:
-    import packaging.version
+import mamonsu.lib.version as version
+
 
 class MemoryLeakDiagnostic(Plugin):
     DEFAULT_CONFIG = {
@@ -94,7 +92,7 @@ def run(self, zbx):
         for row in Pooler.query(query=self.query):
             pids.append(row[0])
 
-        if (packaging.version.parse(self.os_release) < packaging.version.parse("4.5")
+        if (version.parse(self.os_release) < version.parse("4.5")
             and not (self.os_name == "centos" and self.os_version == "7")) \
                 or (not self.os_name and not self.os_version):
             for pid in pids:
diff --git a/mamonsu/plugins/pgsql/replication.py b/mamonsu/plugins/pgsql/replication.py
index 78d841a..8a51889 100644
--- a/mamonsu/plugins/pgsql/replication.py
+++ b/mamonsu/plugins/pgsql/replication.py
@@ -4,10 +4,7 @@
 from .pool import Pooler
 from mamonsu.lib.zbx_template import ZbxTemplate
 
-try:
-    from pkg_resources import packaging
-except ImportError:
-    import packaging.version
+import mamonsu.lib.version as version
 
 NUMBER_NON_ACTIVE_SLOTS = 0
 
@@ -205,7 +202,7 @@ def discovery_rules(self, template, dashboard=False):
 
     def keys_and_queries(self, template_zabbix):
         result = []
-        if packaging.version.parse(self.VersionPG) < packaging.version.parse("10"):
+        if version.parse(self.VersionPG) < version.parse("10"):
             result.append("{0},$2 $1 -c \"{1}\"".format("pgsql.replication_lag.sec[*]",
                                                            self.query_agent_replication_lag.format(
                                                                self.plugin_config("interval"), "xlog_receive_location",
diff --git a/mamonsu/tools/zabbix_cli/operations.py b/mamonsu/tools/zabbix_cli/operations.py
index 984f96f..811ab0b 100644
--- a/mamonsu/tools/zabbix_cli/operations.py
+++ b/mamonsu/tools/zabbix_cli/operations.py
@@ -3,14 +3,10 @@
 from __future__ import print_function
 import sys
 import json
+import mamonsu.lib.version as version
 from mamonsu.tools.zabbix_cli.request import Request
 from mamonsu.lib.parser import zabbix_msg
 
-try:
-    from pkg_resources import packaging
-except ImportError:
-    import packaging.version
-
 from mamonsu.tools.zabbix_cli.dashboard import generate_dashboard
 
 
@@ -176,10 +172,10 @@ def template(self, args):
                     }
                 },
                 'source': open(file).read()}
-            if packaging.version.parse(zabbix_version) < packaging.version.parse('5.4'):
+            if version.parse(zabbix_version) < version.parse('5.4'):
                 params['rules']['applications'] = {'createMissing': True,
                                                    'deleteMissing': True}
-            if packaging.version.parse(zabbix_version) < packaging.version.parse('5.2'):
+            if version.parse(zabbix_version) < version.parse('5.2'):
                 params['rules']['templateScreens'] = {'createMissing': True,
                                                       'updateExisting': False,
                                                       'deleteMissing': True}
@@ -334,7 +330,7 @@ def dashboard(self, args):
             if not len(args) == 2:
                 return self._print_help()
             zabbix_version = str(self.req.post(method='apiinfo.version', params=[]))
-            if packaging.version.parse(zabbix_version) < packaging.version.parse('6.0'):
+            if version.parse(zabbix_version) < version.parse('6.0'):
                 print("You can import Mamonsu dashboard only on Zabbix 6.0+.")
                 return
             else:
diff --git a/mamonsu/tools/zabbix_cli/request.py b/mamonsu/tools/zabbix_cli/request.py
index f0cee27..0ccd78c 100644
--- a/mamonsu/tools/zabbix_cli/request.py
+++ b/mamonsu/tools/zabbix_cli/request.py
@@ -4,10 +4,7 @@
 import logging
 from collections import OrderedDict
 
-try:
-    from pkg_resources import packaging
-except ImportError:
-    import packaging.version
+import mamonsu.lib.version as version
 
 import urllib.request as urllib2
 
@@ -29,7 +26,7 @@ def _auth(self):
         if self._auth_tocken is None:
             if not self._user:
                 return None
-            user_field = 'user' if packaging.version.parse(self._api_version) < packaging.version.parse('6.4') else 'username'
+            user_field = 'user' if version.parse(self._api_version) < version.parse('6.4') else 'username'
             self._auth_tocken = self.post(
                 'user.login',
                 {user_field: self._user, 'password': self._passwd})

From 1002c67a6923e6447c57d7b7dd3c418c386c8c98 Mon Sep 17 00:00:00 2001
From: Maxim Styushin 
Date: Wed, 26 Feb 2025 01:07:44 +0400
Subject: [PATCH 17/28] fix: plugin threads synchronization

- use reentrant lock to synchronize access to Pool singletone.
- make concurrent modifications of _cache structure thread-safe.
---
 mamonsu/plugins/pgsql/driver/pool.py | 196 ++++++++++++++-------------
 1 file changed, 104 insertions(+), 92 deletions(-)

diff --git a/mamonsu/plugins/pgsql/driver/pool.py b/mamonsu/plugins/pgsql/driver/pool.py
index 3850b75..6576f92 100644
--- a/mamonsu/plugins/pgsql/driver/pool.py
+++ b/mamonsu/plugins/pgsql/driver/pool.py
@@ -1,6 +1,8 @@
 from .connection import Connection, ConnectionInfo
 
 from mamonsu.lib.version import parse
+import threading
+
 
 class Pool(object):
     ExcludeDBs = ["template0", "template1"]
@@ -107,10 +109,11 @@ def __init__(self, params=None):
             "bootstrap": {"storage": {}, "counter": 0, "cache": 10, "version": False},
             "recovery": {"storage": {}, "counter": 0, "cache": 10},
             "extension_schema": {"pg_buffercache": {}, "pg_stat_statements": {}, "pg_wait_sampling": {}, "pgpro_stats": {}},
-            "extension_versions" : {},
+            "extension_versions": {},
             "pgpro": {"storage": {}},
             "pgproee": {"storage": {}}
         }
+        self._lock = threading.RLock()
 
     def connection_string(self, db=None):
         db = self._normalize_db(db)
@@ -122,30 +125,32 @@ def query(self, query, db=None):
         return self._connections[db].query(query)
 
     def server_version(self, db=None):
-        db = self._normalize_db(db)
-        if db in self._cache["server_version"]["storage"]:
+        with self._lock:
+            db = self._normalize_db(db)
+            if db in self._cache["server_version"]["storage"]:
+                return self._cache["server_version"]["storage"][db]
+
+            version_string = self.query("show server_version", db)[0][0]
+            result = bytes(
+                version_string.split(" ")[0], "utf-8")
+            self._cache["server_version"]["storage"][db] = "{0}".format(
+                result.decode("ascii"))
             return self._cache["server_version"]["storage"][db]
 
-        version_string = self.query("show server_version", db)[0][0]
-        result = bytes(
-            version_string.split(" ")[0], "utf-8")
-        self._cache["server_version"]["storage"][db] = "{0}".format(
-            result.decode("ascii"))
-        return self._cache["server_version"]["storage"][db]
-
     def extension_version(self, extension, db=None):
-        db = self._normalize_db(db)
-        if extension in self._cache["extension_versions"] and db in self._cache["extension_versions"][extension][db]:
+        with self._lock:
+            db = self._normalize_db(db)
+            if extension in self._cache["extension_versions"] and db in self._cache["extension_versions"][extension][db]:
+                return self._cache["extension_versions"][extension][db]
+
+            version_string = self.query("select extversion from pg_catalog.pg_extension where lower(extname) = lower('{0}');".format(extension), db)[0][0]
+            result = bytes(
+                version_string.split(" ")[0], "utf-8")
+            self._cache["extension_versions"][extension] = {}
+            self._cache["extension_versions"][extension][db] = "{0}".format(
+                result.decode("ascii"))
             return self._cache["extension_versions"][extension][db]
 
-        version_string = self.query("select extversion from pg_catalog.pg_extension where lower(extname) = lower('{0}');".format(extension), db)[0][0]
-        result = bytes(
-            version_string.split(" ")[0], "utf-8")
-        self._cache["extension_versions"][extension] = {}
-        self._cache["extension_versions"][extension][db] = "{0}".format(
-            result.decode("ascii"))
-        return self._cache["extension_versions"][extension][db]
-
     def server_version_greater(self, version, db=None):
         db = self._normalize_db(db)
         return parse(self.server_version(db)) >= parse(version)
@@ -155,49 +160,53 @@ def server_version_less(self, version, db=None):
         return parse(self.server_version(db)) <= parse(version)
 
     def bootstrap_version_greater(self, version):
-        return parse(str(self._cache["bootstrap"]["version"])) >= parse(version)
+        with self._lock:
+            return parse(str(self._cache["bootstrap"]["version"])) >= parse(version)
 
     def bootstrap_version_less(self, version):
-        return parse(str(self._cache["bootstrap"]["version"])) <= parse(version)
+        with self._lock:
+            return parse(str(self._cache["bootstrap"]["version"])) <= parse(version)
 
     def in_recovery(self, db=None):
-        db = self._normalize_db(db)
-        if db in self._cache["recovery"]["storage"]:
-            if self._cache["recovery"]["counter"] < self._cache["recovery"]["cache"]:
-                self._cache["recovery"]["counter"] += 1
-                return self._cache["recovery"]["storage"][db]
-        self._cache["recovery"]["counter"] = 0
-        self._cache["recovery"]["storage"][db] = self.query(
-            "select pg_catalog.pg_is_in_recovery()", db)[0][0]
-        return self._cache["recovery"]["storage"][db]
+        with self._lock:
+            db = self._normalize_db(db)
+            if db in self._cache["recovery"]["storage"]:
+                if self._cache["recovery"]["counter"] < self._cache["recovery"]["cache"]:
+                    self._cache["recovery"]["counter"] += 1
+                    return self._cache["recovery"]["storage"][db]
+            self._cache["recovery"]["counter"] = 0
+            self._cache["recovery"]["storage"][db] = self.query(
+                "select pg_catalog.pg_is_in_recovery()", db)[0][0]
+            return self._cache["recovery"]["storage"][db]
 
     def is_bootstraped(self, db=None):
-        db = self._normalize_db(db)
-        if db in self._cache["bootstrap"]["storage"]:
-            if self._cache["bootstrap"]["counter"] < self._cache["bootstrap"]["cache"]:
-                self._cache["bootstrap"]["counter"] += 1
-                return self._cache["bootstrap"]["storage"][db]
-        self._cache["bootstrap"]["counter"] = 0
-        # TODO: изменить на нормальное название, 'config' слишком общее
-        sql = """
-        SELECT count(*)
-        FROM pg_catalog.pg_class
-        WHERE relname = 'config';
-        """
-        result = int(self.query(sql, db)[0][0])
-        self._cache["bootstrap"]["storage"][db] = (result == 1)
-        if self._cache["bootstrap"]["storage"][db]:
-            self._connections[db].log.info("Found mamonsu bootstrap")
+        with self._lock:
+            db = self._normalize_db(db)
+            if db in self._cache["bootstrap"]["storage"]:
+                if self._cache["bootstrap"]["counter"] < self._cache["bootstrap"]["cache"]:
+                    self._cache["bootstrap"]["counter"] += 1
+                    return self._cache["bootstrap"]["storage"][db]
+            self._cache["bootstrap"]["counter"] = 0
+            # TODO: изменить на нормальное название, 'config' слишком общее
             sql = """
-            SELECT max(version)
-            FROM mamonsu.config;
+            SELECT count(*)
+            FROM pg_catalog.pg_class
+            WHERE relname = 'config';
             """
-            self._cache["bootstrap"]["version"] = self.query(sql, db)[0][0]
-        else:
-            self._connections[db].log.info("Mamonsu bootstrap is not found")
-            self._connections[db].log.info(
-                "hint: run `mamonsu bootstrap` if you want to run without superuser rights")
-        return self._cache["bootstrap"]["storage"][db]
+            result = int(self.query(sql, db)[0][0])
+            self._cache["bootstrap"]["storage"][db] = (result == 1)
+            if self._cache["bootstrap"]["storage"][db]:
+                self._connections[db].log.info("Found mamonsu bootstrap")
+                sql = """
+                SELECT max(version)
+                FROM mamonsu.config;
+                """
+                self._cache["bootstrap"]["version"] = self.query(sql, db)[0][0]
+            else:
+                self._connections[db].log.info("Mamonsu bootstrap is not found")
+                self._connections[db].log.info(
+                    "hint: run `mamonsu bootstrap` if you want to run without superuser rights")
+            return self._cache["bootstrap"]["storage"][db]
 
     def is_superuser(self, db=None):
         _ = self._normalize_db(db)
@@ -209,34 +218,36 @@ def is_superuser(self, db=None):
             return False
 
     def is_pgpro(self, db=None):
-        db = self._normalize_db(db)
-        if db in self._cache["pgpro"]:
+        with self._lock:
+            db = self._normalize_db(db)
+            if db in self._cache["pgpro"]:
+                return self._cache["pgpro"][db]
+            try:
+                self.query("""
+                SELECT pgpro_version();
+                """)
+                self._cache["pgpro"][db] = True
+            except:
+                self._cache["pgpro"][db] = False
             return self._cache["pgpro"][db]
-        try:
-            self.query("""
-            SELECT pgpro_version();
-            """)
-            self._cache["pgpro"][db] = True
-        except:
-            self._cache["pgpro"][db] = False
-        return self._cache["pgpro"][db]
 
     def is_pgpro_ee(self, db=None):
-        db = self._normalize_db(db)
-        if not self.is_pgpro(db):
-            return False
-        if db in self._cache["pgproee"]:
+        with self._lock:
+            db = self._normalize_db(db)
+            if not self.is_pgpro(db):
+                return False
+            if db in self._cache["pgproee"]:
+                return self._cache["pgproee"][db]
+            try:
+                ed = self.query("""
+                SELECT pgpro_edition();
+                """)[0][0]
+                self._connections[db].log.info("pgpro_edition is {}".format(ed))
+                self._cache["pgproee"][db] = (ed.lower() == "enterprise")
+            except:
+                self._connections[db].log.info("pgpro_edition() is not defined")
+                self._cache["pgproee"][db] = False
             return self._cache["pgproee"][db]
-        try:
-            ed = self.query("""
-            SELECT pgpro_edition();
-            """)[0][0]
-            self._connections[db].log.info("pgpro_edition is {}".format(ed))
-            self._cache["pgproee"][db] = (ed.lower() == "enterprise")
-        except:
-            self._connections[db].log.info("pgpro_edition() is not defined")
-            self._cache["pgproee"][db] = False
-        return self._cache["pgproee"][db]
 
     def extension_version_greater(self, extension, version, db=None):
         db = self._normalize_db(db)
@@ -256,19 +267,20 @@ def extension_installed(self, ext, db=None):
         return (int(result[0][0])) == 1
 
     def extension_schema(self, extension, db=None):
-        db = self._normalize_db(db)
-        if db in self._cache["extension_schema"][extension]:
-            return self._cache["extension_schema"][extension][db]
-        try:
-            self._cache["extension_schema"][extension][db] = self.query("""
-            SELECT n.nspname
-            FROM pg_extension e
-            JOIN pg_namespace n ON e.extnamespace = n.oid
-            WHERE e.extname = '{0}'
-            """.format(extension), db)[0][0]
-            return self._cache["extension_schema"][extension][db]
-        except:
-            self._connections[db].log.info("{0} is not installed".format(extension))
+        with self._lock:
+            db = self._normalize_db(db)
+            if db in self._cache["extension_schema"][extension]:
+                return self._cache["extension_schema"][extension][db]
+            try:
+                self._cache["extension_schema"][extension][db] = self.query("""
+                SELECT n.nspname
+                FROM pg_extension e
+                JOIN pg_namespace n ON e.extnamespace = n.oid
+                WHERE e.extname = '{0}'
+                """.format(extension), db)[0][0]
+                return self._cache["extension_schema"][extension][db]
+            except:
+                self._connections[db].log.info("{0} is not installed".format(extension))
 
     def databases(self):
         result, databases = self.query("""

From 3a9e43140a5f94a787be2134c1182ef04c835016 Mon Sep 17 00:00:00 2001
From: Maxim Styushin 
Date: Wed, 26 Feb 2025 20:33:34 +0400
Subject: [PATCH 18/28] cicd: update actions runner to ubuntu 22.04

---
 .github/workflows/mamonsu-tests-dev.yml    | 2 +-
 .github/workflows/mamonsu-tests-master.yml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/mamonsu-tests-dev.yml b/.github/workflows/mamonsu-tests-dev.yml
index 6e3bf27..368d655 100644
--- a/.github/workflows/mamonsu-tests-dev.yml
+++ b/.github/workflows/mamonsu-tests-dev.yml
@@ -20,7 +20,7 @@ on:
 
 jobs:
   mamonsu-tests:
-    runs-on: ubuntu-20.04
+    runs-on: ubuntu-22.04
     env:
       DOCKER_COMPOSE_VERSION: '1.29.2'
       MAMONSU_PATH: '/home/runner/work/mamonsu/mamonsu/'
diff --git a/.github/workflows/mamonsu-tests-master.yml b/.github/workflows/mamonsu-tests-master.yml
index 312134a..d7072ba 100644
--- a/.github/workflows/mamonsu-tests-master.yml
+++ b/.github/workflows/mamonsu-tests-master.yml
@@ -20,7 +20,7 @@ on:
 
 jobs:
   mamonsu-tests:
-    runs-on: ubuntu-20.04
+    runs-on: ubuntu-22.04
     env:
       DOCKER_COMPOSE_VERSION: '1.29.2'
       MAMONSU_PATH: '/home/runner/work/mamonsu/mamonsu/'

From d321cc8e9c981cfef723be9328c9a46b9f570df3 Mon Sep 17 00:00:00 2001
From: Maxim Styushin 
Date: Sat, 1 Mar 2025 17:40:48 +0400
Subject: [PATCH 19/28] fix: remove type hints from version parser

- falling back to a way older code to support python3.3
---
 mamonsu/lib/version.py | 376 +++++++++++++++--------------------------
 1 file changed, 134 insertions(+), 242 deletions(-)

diff --git a/mamonsu/lib/version.py b/mamonsu/lib/version.py
index 711e933..821b67b 100644
--- a/mamonsu/lib/version.py
+++ b/mamonsu/lib/version.py
@@ -12,106 +12,90 @@
 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
+from __future__ import absolute_import, division, print_function
+
 import collections
 import itertools
 import re
-import warnings
-from typing import Callable, Iterator, List, Optional, SupportsInt, Tuple, Union
+
+__all__ = [
+    "parse", "Version", "LegacyVersion", "InvalidVersion", "VERSION_PATTERN"
+]
 
 
-class InfinityType:
-    def __repr__(self) -> str:
+class Infinity(object):
+
+    def __repr__(self):
         return "Infinity"
 
-    def __hash__(self) -> int:
+    def __hash__(self):
         return hash(repr(self))
 
-    def __lt__(self, other: object) -> bool:
+    def __lt__(self, other):
         return False
 
-    def __le__(self, other: object) -> bool:
+    def __le__(self, other):
         return False
 
-    def __eq__(self, other: object) -> bool:
+    def __eq__(self, other):
         return isinstance(other, self.__class__)
 
-    def __ne__(self, other: object) -> bool:
+    def __ne__(self, other):
         return not isinstance(other, self.__class__)
 
-    def __gt__(self, other: object) -> bool:
+    def __gt__(self, other):
         return True
 
-    def __ge__(self, other: object) -> bool:
+    def __ge__(self, other):
         return True
 
-    def __neg__(self: object) -> "NegativeInfinityType":
+    def __neg__(self):
         return NegativeInfinity
 
 
-Infinity = InfinityType()
+Infinity = Infinity()
+
 
+class NegativeInfinity(object):
 
-class NegativeInfinityType:
-    def __repr__(self) -> str:
+    def __repr__(self):
         return "-Infinity"
 
-    def __hash__(self) -> int:
+    def __hash__(self):
         return hash(repr(self))
 
-    def __lt__(self, other: object) -> bool:
+    def __lt__(self, other):
         return True
 
-    def __le__(self, other: object) -> bool:
+    def __le__(self, other):
         return True
 
-    def __eq__(self, other: object) -> bool:
+    def __eq__(self, other):
         return isinstance(other, self.__class__)
 
-    def __ne__(self, other: object) -> bool:
+    def __ne__(self, other):
         return not isinstance(other, self.__class__)
 
-    def __gt__(self, other: object) -> bool:
+    def __gt__(self, other):
         return False
 
-    def __ge__(self, other: object) -> bool:
+    def __ge__(self, other):
         return False
 
-    def __neg__(self: object) -> InfinityType:
+    def __neg__(self):
         return Infinity
 
 
-NegativeInfinity = NegativeInfinityType()
+NegativeInfinity = NegativeInfinity()
 
-__all__ = ["parse", "Version", "LegacyVersion", "InvalidVersion", "VERSION_PATTERN"]
-
-InfiniteTypes = Union[InfinityType, NegativeInfinityType]
-PrePostDevType = Union[InfiniteTypes, Tuple[str, int]]
-SubLocalType = Union[InfiniteTypes, int, str]
-LocalType = Union[
-    NegativeInfinityType,
-    Tuple[
-        Union[
-            SubLocalType,
-            Tuple[SubLocalType, str],
-            Tuple[NegativeInfinityType, SubLocalType],
-        ],
-        ...,
-    ],
-]
-CmpKey = Tuple[
-    int, Tuple[int, ...], PrePostDevType, PrePostDevType, PrePostDevType, LocalType
-]
-LegacyCmpKey = Tuple[int, Tuple[str, ...]]
-VersionComparisonMethod = Callable[
-    [Union[CmpKey, LegacyCmpKey], Union[CmpKey, LegacyCmpKey]], bool
-]
 
 _Version = collections.namedtuple(
-    "_Version", ["epoch", "release", "dev", "pre", "post", "local"]
+    "_Version",
+    ["epoch", "release", "dev", "pre", "post", "local"],
 )
 
 
-def parse(version: str) -> Union["LegacyVersion", "Version"]:
+def parse(version):
     """
     Parse the given version string and return either a :class:`Version` object
     or a :class:`LegacyVersion` object depending on if the given version is
@@ -129,126 +113,79 @@ class InvalidVersion(ValueError):
     """
 
 
-class _BaseVersion:
-    _key: Union[CmpKey, LegacyCmpKey]
+class _BaseVersion(object):
 
-    def __hash__(self) -> int:
+    def __hash__(self):
         return hash(self._key)
 
-    # Please keep the duplicated `isinstance` check
-    # in the six comparisons hereunder
-    # unless you find a way to avoid adding overhead function calls.
-    def __lt__(self, other: "_BaseVersion") -> bool:
-        if not isinstance(other, _BaseVersion):
-            return NotImplemented
+    def __lt__(self, other):
+        return self._compare(other, lambda s, o: s < o)
 
-        return self._key < other._key
+    def __le__(self, other):
+        return self._compare(other, lambda s, o: s <= o)
 
-    def __le__(self, other: "_BaseVersion") -> bool:
-        if not isinstance(other, _BaseVersion):
-            return NotImplemented
+    def __eq__(self, other):
+        return self._compare(other, lambda s, o: s == o)
 
-        return self._key <= other._key
+    def __ge__(self, other):
+        return self._compare(other, lambda s, o: s >= o)
 
-    def __eq__(self, other: object) -> bool:
-        if not isinstance(other, _BaseVersion):
-            return NotImplemented
+    def __gt__(self, other):
+        return self._compare(other, lambda s, o: s > o)
 
-        return self._key == other._key
+    def __ne__(self, other):
+        return self._compare(other, lambda s, o: s != o)
 
-    def __ge__(self, other: "_BaseVersion") -> bool:
+    def _compare(self, other, method):
         if not isinstance(other, _BaseVersion):
             return NotImplemented
 
-        return self._key >= other._key
-
-    def __gt__(self, other: "_BaseVersion") -> bool:
-        if not isinstance(other, _BaseVersion):
-            return NotImplemented
-
-        return self._key > other._key
-
-    def __ne__(self, other: object) -> bool:
-        if not isinstance(other, _BaseVersion):
-            return NotImplemented
-
-        return self._key != other._key
+        return method(self._key, other._key)
 
 
 class LegacyVersion(_BaseVersion):
-    def __init__(self, version: str) -> None:
+
+    def __init__(self, version):
         self._version = str(version)
         self._key = _legacy_cmpkey(self._version)
 
-        warnings.warn(
-            "Creating a LegacyVersion has been deprecated and will be "
-            "removed in the next major release",
-            DeprecationWarning,
-        )
-
-    def __str__(self) -> str:
+    def __str__(self):
         return self._version
 
-    def __repr__(self) -> str:
-        return f""
+    def __repr__(self):
+        return "".format(repr(str(self)))
 
     @property
-    def public(self) -> str:
+    def public(self):
         return self._version
 
     @property
-    def base_version(self) -> str:
+    def base_version(self):
         return self._version
 
     @property
-    def epoch(self) -> int:
-        return -1
-
-    @property
-    def release(self) -> None:
-        return None
-
-    @property
-    def pre(self) -> None:
-        return None
-
-    @property
-    def post(self) -> None:
-        return None
-
-    @property
-    def dev(self) -> None:
-        return None
-
-    @property
-    def local(self) -> None:
+    def local(self):
         return None
 
     @property
-    def is_prerelease(self) -> bool:
+    def is_prerelease(self):
         return False
 
     @property
-    def is_postrelease(self) -> bool:
+    def is_postrelease(self):
         return False
 
-    @property
-    def is_devrelease(self) -> bool:
-        return False
 
-
-_legacy_version_component_re = re.compile(r"(\d+ | [a-z]+ | \.| -)", re.VERBOSE)
+_legacy_version_component_re = re.compile(
+    r"(\d+ | [a-z]+ | \.| -)", re.VERBOSE,
+)
 
 _legacy_version_replacement_map = {
-    "pre": "c",
-    "preview": "c",
-    "-": "final-",
-    "rc": "c",
-    "dev": "@",
+    "pre": "c", "preview": "c", "-": "final-", "rc": "c", "dev": "@",
 }
 
 
-def _parse_version_parts(s: str) -> Iterator[str]:
+def _parse_version_parts(s):
     for part in _legacy_version_component_re.split(s):
         part = _legacy_version_replacement_map.get(part, part)
 
@@ -265,8 +202,7 @@ def _parse_version_parts(s: str) -> Iterator[str]:
     yield "*final"
 
 
-def _legacy_cmpkey(version: str) -> LegacyCmpKey:
-
+def _legacy_cmpkey(version):
     # We hardcode an epoch of -1 here. A PEP 440 version can only have a epoch
     # greater than or equal to 0. This will effectively put the LegacyVersion,
     # which uses the defacto standard originally implemented by setuptools,
@@ -275,7 +211,7 @@ def _legacy_cmpkey(version: str) -> LegacyCmpKey:
 
     # This scheme is taken from pkg_resources.parse_version setuptools prior to
     # it's adoption of the packaging library.
-    parts: List[str] = []
+    parts = []
     for part in _parse_version_parts(version.lower()):
         if part.startswith("*"):
             # remove "-" before a prerelease tag
@@ -288,8 +224,9 @@ def _legacy_cmpkey(version: str) -> LegacyCmpKey:
                 parts.pop()
 
         parts.append(part)
+    parts = tuple(parts)
 
-    return epoch, tuple(parts)
+    return epoch, parts
 
 
 # Deliberately not anchored to the start and end of the string, to make it
@@ -328,24 +265,33 @@ def _legacy_cmpkey(version: str) -> LegacyCmpKey:
 
 class Version(_BaseVersion):
 
-    _regex = re.compile(r"^\s*" + VERSION_PATTERN + r"\s*$", re.VERBOSE | re.IGNORECASE)
-
-    def __init__(self, version: str) -> None:
+    _regex = re.compile(
+        r"^\s*" + VERSION_PATTERN + r"\s*$",
+        re.VERBOSE | re.IGNORECASE,
+    )
 
+    def __init__(self, version):
         # Validate the version and parse it into pieces
         match = self._regex.search(version)
         if not match:
-            raise InvalidVersion(f"Invalid version: '{version}'")
+            raise InvalidVersion("Invalid version: '{0}'".format(version))
 
         # Store the parsed out pieces of the version
         self._version = _Version(
             epoch=int(match.group("epoch")) if match.group("epoch") else 0,
             release=tuple(int(i) for i in match.group("release").split(".")),
-            pre=_parse_letter_version(match.group("pre_l"), match.group("pre_n")),
+            pre=_parse_letter_version(
+                match.group("pre_l"),
+                match.group("pre_n"),
+            ),
             post=_parse_letter_version(
-                match.group("post_l"), match.group("post_n1") or match.group("post_n2")
+                match.group("post_l"),
+                match.group("post_n1") or match.group("post_n2"),
+            ),
+            dev=_parse_letter_version(
+                match.group("dev_l"),
+                match.group("dev_n"),
             ),
-            dev=_parse_letter_version(match.group("dev_l"), match.group("dev_n")),
             local=_parse_local_version(match.group("local")),
         )
 
@@ -359,113 +305,72 @@ def __init__(self, version: str) -> None:
             self._version.local,
         )
 
-    def __repr__(self) -> str:
-        return f""
+    def __repr__(self):
+        return "".format(repr(str(self)))
 
-    def __str__(self) -> str:
+    def __str__(self):
         parts = []
 
         # Epoch
-        if self.epoch != 0:
-            parts.append(f"{self.epoch}!")
+        if self._version.epoch != 0:
+            parts.append("{0}!".format(self._version.epoch))
 
         # Release segment
-        parts.append(".".join(str(x) for x in self.release))
+        parts.append(".".join(str(x) for x in self._version.release))
 
         # Pre-release
-        if self.pre is not None:
-            parts.append("".join(str(x) for x in self.pre))
+        if self._version.pre is not None:
+            parts.append("".join(str(x) for x in self._version.pre))
 
         # Post-release
-        if self.post is not None:
-            parts.append(f".post{self.post}")
+        if self._version.post is not None:
+            parts.append(".post{0}".format(self._version.post[1]))
 
         # Development release
-        if self.dev is not None:
-            parts.append(f".dev{self.dev}")
+        if self._version.dev is not None:
+            parts.append(".dev{0}".format(self._version.dev[1]))
 
         # Local version segment
-        if self.local is not None:
-            parts.append(f"+{self.local}")
+        if self._version.local is not None:
+            parts.append(
+                "+{0}".format(".".join(str(x) for x in self._version.local))
+            )
 
         return "".join(parts)
 
     @property
-    def epoch(self) -> int:
-        _epoch: int = self._version.epoch
-        return _epoch
-
-    @property
-    def release(self) -> Tuple[int, ...]:
-        _release: Tuple[int, ...] = self._version.release
-        return _release
-
-    @property
-    def pre(self) -> Optional[Tuple[str, int]]:
-        _pre: Optional[Tuple[str, int]] = self._version.pre
-        return _pre
-
-    @property
-    def post(self) -> Optional[int]:
-        return self._version.post[1] if self._version.post else None
-
-    @property
-    def dev(self) -> Optional[int]:
-        return self._version.dev[1] if self._version.dev else None
-
-    @property
-    def local(self) -> Optional[str]:
-        if self._version.local:
-            return ".".join(str(x) for x in self._version.local)
-        else:
-            return None
-
-    @property
-    def public(self) -> str:
+    def public(self):
         return str(self).split("+", 1)[0]
 
     @property
-    def base_version(self) -> str:
+    def base_version(self):
         parts = []
 
         # Epoch
-        if self.epoch != 0:
-            parts.append(f"{self.epoch}!")
+        if self._version.epoch != 0:
+            parts.append("{0}!".format(self._version.epoch))
 
         # Release segment
-        parts.append(".".join(str(x) for x in self.release))
+        parts.append(".".join(str(x) for x in self._version.release))
 
         return "".join(parts)
 
     @property
-    def is_prerelease(self) -> bool:
-        return self.dev is not None or self.pre is not None
-
-    @property
-    def is_postrelease(self) -> bool:
-        return self.post is not None
-
-    @property
-    def is_devrelease(self) -> bool:
-        return self.dev is not None
-
-    @property
-    def major(self) -> int:
-        return self.release[0] if len(self.release) >= 1 else 0
+    def local(self):
+        version_string = str(self)
+        if "+" in version_string:
+            return version_string.split("+", 1)[1]
 
     @property
-    def minor(self) -> int:
-        return self.release[1] if len(self.release) >= 2 else 0
+    def is_prerelease(self):
+        return bool(self._version.dev or self._version.pre)
 
     @property
-    def micro(self) -> int:
-        return self.release[2] if len(self.release) >= 3 else 0
+    def is_postrelease(self):
+        return bool(self._version.post)
 
 
-def _parse_letter_version(
-    letter: str, number: Union[str, bytes, SupportsInt]
-) -> Optional[Tuple[str, int]]:
-
+def _parse_letter_version(letter, number):
     if letter:
         # We consider there to be an implicit 0 in a pre-release if there is
         # not a numeral associated with it.
@@ -495,40 +400,34 @@ def _parse_letter_version(
 
         return letter, int(number)
 
-    return None
-
 
-_local_version_separators = re.compile(r"[\._-]")
+_local_version_seperators = re.compile(r"[\._-]")
 
 
-def _parse_local_version(local: str) -> Optional[LocalType]:
+def _parse_local_version(local):
     """
     Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
     """
     if local is not None:
         return tuple(
             part.lower() if not part.isdigit() else int(part)
-            for part in _local_version_separators.split(local)
+            for part in _local_version_seperators.split(local)
         )
-    return None
-
 
-def _cmpkey(
-    epoch: int,
-    release: Tuple[int, ...],
-    pre: Optional[Tuple[str, int]],
-    post: Optional[Tuple[str, int]],
-    dev: Optional[Tuple[str, int]],
-    local: Optional[Tuple[SubLocalType]],
-) -> CmpKey:
 
+def _cmpkey(epoch, release, pre, post, dev, local):
     # When we compare a release version, we want to compare it with all of the
     # trailing zeros removed. So we'll use a reverse the list, drop all the now
     # leading zeros until we come to something non zero, then take the rest
     # re-reverse it back into the correct order and make it a tuple and use
     # that for our sorting key.
-    _release = tuple(
-        reversed(list(itertools.dropwhile(lambda x: x == 0, reversed(release))))
+    release = tuple(
+        reversed(list(
+            itertools.dropwhile(
+                lambda x: x == 0,
+                reversed(release),
+            )
+        ))
     )
 
     # We need to "trick" the sorting algorithm to put 1.0.dev0 before 1.0a0.
@@ -536,31 +435,23 @@ def _cmpkey(
     # if there is not a pre or a post segment. If we have one of those then
     # the normal sorting rules will handle this case correctly.
     if pre is None and post is None and dev is not None:
-        _pre: PrePostDevType = NegativeInfinity
+        pre = -Infinity
     # Versions without a pre-release (except as noted above) should sort after
     # those with one.
     elif pre is None:
-        _pre = Infinity
-    else:
-        _pre = pre
+        pre = Infinity
 
     # Versions without a post segment should sort before those with one.
     if post is None:
-        _post: PrePostDevType = NegativeInfinity
-
-    else:
-        _post = post
+        post = -Infinity
 
     # Versions without a development segment should sort after those with one.
     if dev is None:
-        _dev: PrePostDevType = Infinity
-
-    else:
-        _dev = dev
+        dev = Infinity
 
     if local is None:
         # Versions without a local segment should sort before those with one.
-        _local: LocalType = NegativeInfinity
+        local = -Infinity
     else:
         # Versions with a local segment need that segment parsed to implement
         # the sorting rules in PEP440.
@@ -569,8 +460,9 @@ def _cmpkey(
         # - Numeric segments sort numerically
         # - Shorter versions sort before longer versions when the prefixes
         #   match exactly
-        _local = tuple(
-            (i, "") if isinstance(i, int) else (NegativeInfinity, i) for i in local
+        local = tuple(
+            (i, "") if isinstance(i, int) else (-Infinity, i)
+            for i in local
         )
 
-    return epoch, _release, _pre, _post, _dev, _local
+    return epoch, release, pre, post, dev, local

From 1ad3419100f7212a24868b750d8e1645757bb6b8 Mon Sep 17 00:00:00 2001
From: Maxim Styushin 
Date: Mon, 3 Mar 2025 20:28:13 +0400
Subject: [PATCH 20/28] fix: skip plugin initialization

- don't initialize BGWriter and Checkpoint plugins if PG metrics collecton was disabled
---
 mamonsu/plugins/pgsql/bgwriter.py   | 111 ++++++++++++------------
 mamonsu/plugins/pgsql/checkpoint.py | 129 ++++++++++++++--------------
 2 files changed, 121 insertions(+), 119 deletions(-)

diff --git a/mamonsu/plugins/pgsql/bgwriter.py b/mamonsu/plugins/pgsql/bgwriter.py
index 2ca2d70..9615b70 100644
--- a/mamonsu/plugins/pgsql/bgwriter.py
+++ b/mamonsu/plugins/pgsql/bgwriter.py
@@ -18,61 +18,62 @@ class BgWriter(Plugin):
 
     def __init__(self, config):
         super(BgWriter, self).__init__(config)
-        if Pooler.server_version_less("17"):
-            self.Items = [
-                # key, zbx_key, description,
-                #    ('graph name', color, side), units, delta
-
-                ("buffers_checkpoint", "bgwriter[buffers_checkpoint]",
-                 "Buffers Written During Checkpoints",
-                 ("PostgreSQL bgwriter", "006AAE", 1),
-                 Plugin.DELTA.simple_change),
-
-                ("buffers_clean", "bgwriter[buffers_clean]",
-                 "Buffers Written",
-                 ("PostgreSQL bgwriter", "00CC00", 1),
-                 Plugin.DELTA.simple_change),
-
-                ("maxwritten_clean", "bgwriter[maxwritten_clean]",
-                 "Number of bgwriter Stopped by Max Write Count",
-                 ("PostgreSQL bgwriter", "FF5656", 0),
-                 Plugin.DELTA.simple_change),
-
-                ("buffers_backend", "bgwriter[buffers_backend]",
-                 "Buffers Written Directly by a Backend",
-                 ("PostgreSQL bgwriter", "9C8A4E", 1),
-                 Plugin.DELTA.simple_change),
-
-                ("buffers_backend_fsync", "bgwriter[buffers_backend_fsync]",
-                 "Times a Backend Execute Its Own Fsync",
-                 ("PostgreSQL bgwriter", "00CC00", 0),
-                 Plugin.DELTA.simple_change),
-
-                ("buffers_alloc", "bgwriter[buffers_alloc]",
-                 "Buffers Allocated",
-                 ("PostgreSQL bgwriter", "FF5656", 1),
-                 Plugin.DELTA.simple_change)
-            ]
-        else:
-            self.Items = [
-                # key, zbx_key, description,
-                #    ('graph name', color, side), units, delta
-
-                ("buffers_clean", "bgwriter[buffers_clean]",
-                 "Buffers Written",
-                 ("PostgreSQL bgwriter", "00CC00", 1),
-                 Plugin.DELTA.simple_change),
-
-                ("maxwritten_clean", "bgwriter[maxwritten_clean]",
-                 "Number of bgwriter Stopped by Max Write Count",
-                 ("PostgreSQL bgwriter", "FF5656", 0),
-                 Plugin.DELTA.simple_change),
-
-                ("buffers_alloc", "bgwriter[buffers_alloc]",
-                 "Buffers Allocated",
-                 ("PostgreSQL bgwriter", "FF5656", 1),
-                 Plugin.DELTA.simple_change)
-            ]
+        if self.is_enabled():
+            if Pooler.server_version_less("17"):
+                self.Items = [
+                    # key, zbx_key, description,
+                    #    ('graph name', color, side), units, delta
+
+                    ("buffers_checkpoint", "bgwriter[buffers_checkpoint]",
+                     "Buffers Written During Checkpoints",
+                     ("PostgreSQL bgwriter", "006AAE", 1),
+                     Plugin.DELTA.simple_change),
+
+                    ("buffers_clean", "bgwriter[buffers_clean]",
+                     "Buffers Written",
+                     ("PostgreSQL bgwriter", "00CC00", 1),
+                     Plugin.DELTA.simple_change),
+
+                    ("maxwritten_clean", "bgwriter[maxwritten_clean]",
+                     "Number of bgwriter Stopped by Max Write Count",
+                     ("PostgreSQL bgwriter", "FF5656", 0),
+                     Plugin.DELTA.simple_change),
+
+                    ("buffers_backend", "bgwriter[buffers_backend]",
+                     "Buffers Written Directly by a Backend",
+                     ("PostgreSQL bgwriter", "9C8A4E", 1),
+                     Plugin.DELTA.simple_change),
+
+                    ("buffers_backend_fsync", "bgwriter[buffers_backend_fsync]",
+                     "Times a Backend Execute Its Own Fsync",
+                     ("PostgreSQL bgwriter", "00CC00", 0),
+                     Plugin.DELTA.simple_change),
+
+                    ("buffers_alloc", "bgwriter[buffers_alloc]",
+                     "Buffers Allocated",
+                     ("PostgreSQL bgwriter", "FF5656", 1),
+                     Plugin.DELTA.simple_change)
+                ]
+            else:
+                self.Items = [
+                    # key, zbx_key, description,
+                    #    ('graph name', color, side), units, delta
+
+                    ("buffers_clean", "bgwriter[buffers_clean]",
+                     "Buffers Written",
+                     ("PostgreSQL bgwriter", "00CC00", 1),
+                     Plugin.DELTA.simple_change),
+
+                    ("maxwritten_clean", "bgwriter[maxwritten_clean]",
+                     "Number of bgwriter Stopped by Max Write Count",
+                     ("PostgreSQL bgwriter", "FF5656", 0),
+                     Plugin.DELTA.simple_change),
+
+                    ("buffers_alloc", "bgwriter[buffers_alloc]",
+                     "Buffers Allocated",
+                     ("PostgreSQL bgwriter", "FF5656", 1),
+                     Plugin.DELTA.simple_change)
+                ]
 
     def run(self, zbx):
         columns = [x[0] for x in self.Items]
diff --git a/mamonsu/plugins/pgsql/checkpoint.py b/mamonsu/plugins/pgsql/checkpoint.py
index 80eff40..c1ca9ac 100644
--- a/mamonsu/plugins/pgsql/checkpoint.py
+++ b/mamonsu/plugins/pgsql/checkpoint.py
@@ -21,70 +21,71 @@ class Checkpoint(Plugin):
 
     def __init__(self, config):
         super(Checkpoint, self).__init__(config)
-        if Pooler.server_version_less("17"):
-            self.query = """
-            SELECT {0}
-            FROM pg_catalog.pg_stat_bgwriter;
-            """  # for mamonsu and agent
-            self.query_interval = """
-            SELECT {0}*3600
-            FROM pg_catalog.pg_stat_bgwriter;
-            """  # for mamonsu and agent checkpoints in hour
-            self.Items = [
-                # key, zbx_key, description,
-                #    ('graph name', color, side), units, delta, factor
-                ("checkpoints_timed", "count_timed",
-                 "by Timeout (in hour)",
-                 ("PostgreSQL Checkpoints: Count (in hour)", "00CC00", 0),
-                 Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60),
-
-                ("checkpoints_req", "count_wal",
-                 "by WAL (in hour)",
-                 ("PostgreSQL Checkpoints: Count (in hour)", "FF5656", 0),
-                 Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60),
-
-                ("checkpoint_write_time", "write_time",
-                 "Write Time",
-                 ("PostgreSQL Checkpoints: Write/Sync", "00CC00", 1),
-                 Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1),
-
-                ("checkpoint_sync_time", "checkpoint_sync_time",
-                 "Sync Time",
-                 ("PostgreSQL Checkpoints: Write/Sync", "FF5656", 1),
-                 Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1)
-            ]
-        else:
-            self.query = """
-            SELECT {0}
-            FROM pg_catalog.pg_stat_checkpointer;
-            """  # for mamonsu and agent
-            self.query_interval = """
-            SELECT {0}*3600
-            FROM pg_catalog.pg_stat_checkpointer;
-            """  # for mamonsu and agent checkpoints in hour
-            self.Items = [
-                # key, zbx_key, description,
-                #    ('graph name', color, side), units, delta, factor
-                ("num_timed", "count_timed",
-                 "by Timeout (in hour)",
-                 ("PostgreSQL Checkpoints: Count (in hour)", "00CC00", 0),
-                 Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60),
-
-                ("num_requested", "count_wal",
-                 "by WAL (in hour)",
-                 ("PostgreSQL Checkpoints: Count (in hour)", "FF5656", 0),
-                 Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60),
-
-                ("write_time", "write_time",
-                 "Write Time",
-                 ("PostgreSQL Checkpoints: Write/Sync", "00CC00", 1),
-                 Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1),
-
-                ("sync_time", "checkpoint_sync_time",
-                 "Sync Time",
-                 ("PostgreSQL Checkpoints: Write/Sync", "FF5656", 1),
-                 Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1)
-            ]
+        if self.is_enabled():
+            if Pooler.server_version_less("17"):
+                self.query = """
+                SELECT {0}
+                FROM pg_catalog.pg_stat_bgwriter;
+                """  # for mamonsu and agent
+                self.query_interval = """
+                SELECT {0}*3600
+                FROM pg_catalog.pg_stat_bgwriter;
+                """  # for mamonsu and agent checkpoints in hour
+                self.Items = [
+                    # key, zbx_key, description,
+                    #    ('graph name', color, side), units, delta, factor
+                    ("checkpoints_timed", "count_timed",
+                     "by Timeout (in hour)",
+                     ("PostgreSQL Checkpoints: Count (in hour)", "00CC00", 0),
+                     Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60),
+
+                    ("checkpoints_req", "count_wal",
+                     "by WAL (in hour)",
+                     ("PostgreSQL Checkpoints: Count (in hour)", "FF5656", 0),
+                     Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60),
+
+                    ("checkpoint_write_time", "write_time",
+                     "Write Time",
+                     ("PostgreSQL Checkpoints: Write/Sync", "00CC00", 1),
+                     Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1),
+
+                    ("checkpoint_sync_time", "checkpoint_sync_time",
+                     "Sync Time",
+                     ("PostgreSQL Checkpoints: Write/Sync", "FF5656", 1),
+                     Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1)
+                ]
+            else:
+                self.query = """
+                SELECT {0}
+                FROM pg_catalog.pg_stat_checkpointer;
+                """  # for mamonsu and agent
+                self.query_interval = """
+                SELECT {0}*3600
+                FROM pg_catalog.pg_stat_checkpointer;
+                """  # for mamonsu and agent checkpoints in hour
+                self.Items = [
+                    # key, zbx_key, description,
+                    #    ('graph name', color, side), units, delta, factor
+                    ("num_timed", "count_timed",
+                     "by Timeout (in hour)",
+                     ("PostgreSQL Checkpoints: Count (in hour)", "00CC00", 0),
+                     Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60),
+
+                    ("num_requested", "count_wal",
+                     "by WAL (in hour)",
+                     ("PostgreSQL Checkpoints: Count (in hour)", "FF5656", 0),
+                     Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60),
+
+                    ("write_time", "write_time",
+                     "Write Time",
+                     ("PostgreSQL Checkpoints: Write/Sync", "00CC00", 1),
+                     Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1),
+
+                    ("sync_time", "checkpoint_sync_time",
+                     "Sync Time",
+                     ("PostgreSQL Checkpoints: Write/Sync", "FF5656", 1),
+                     Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1)
+                ]
 
     def run(self, zbx):
         columns = [x[0] for x in self.Items]

From 973a30f447bed9ec1c071534074318b430e00ae2 Mon Sep 17 00:00:00 2001
From: Maxim Styushin 
Date: Mon, 3 Mar 2025 20:45:33 +0400
Subject: [PATCH 21/28] doc: string interpolation feature in agent.conf

---
 documentation/configuration_file.md | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/documentation/configuration_file.md b/documentation/configuration_file.md
index 940102c..0cabd35 100644
--- a/documentation/configuration_file.md
+++ b/documentation/configuration_file.md
@@ -10,6 +10,8 @@ All parameters must be specified in the `parameter = value` format.
 
 > **_NOTE:_**  It is necessary to check permissions to the _mamonsu_ user to directories/files for correct interaction of agent with them. By default configuration file _agent.conf_ should have read/write permissions for _mamonsu_ user only.
 
+> **_NOTE:_**  Config file supports string interpolation via _%()s_ syntax in parameter values. please see “[Parameter Values Interpolation](#parameter-values-interpolation)” below.
+
 ***
 
 ### Connection Parameters
@@ -237,3 +239,22 @@ By default this plugin is disabled. To enable it set the enabled parameter to Tr
 This plugin collects two metrics: *pg_probackup.dir.size[#backup_directory]* (the size of the target directory) and *pg_probackup.dir.error[#backup_directory]* (backup errors) for each specified *backup_directory*.
 
 If any generated backup has bad status, like ERROR, CORRUPT, ORPHAN, а trigger is fired.
+
+### Parameter Values Interpolation
+
+Mamonsu uses python3 built-in configparser library which allows defining arbitary variables in any config section and then reuse it within the same config section.
+
+Example:
+```editorconfig
+[postgres]
+pg = postgres
+enabled = True
+user = %(pg)s
+password = %(pg)s
+database = %(pg)s
+port = 5432
+application_name = %(pg)s
+query_timeout = 10
+```
+
+What is important to note here is that you cannot use symbol _%_ in any parameter's value since it will be treated as an interolation syntax.

From 81de16451ee162fa647852e629eb7d83023ea635 Mon Sep 17 00:00:00 2001
From: Maxim Styushin 
Date: Wed, 5 Mar 2025 18:47:46 +0400
Subject: [PATCH 22/28] build: upgrade to 3.5.12

---
 .github/workflows/mamonsu-tests-dev.yml                    | 2 +-
 .github/workflows/mamonsu-tests-master.yml                 | 2 +-
 github-actions-tests/mamonsu_build.sh                      | 4 ++--
 .../sources/{agent_3.5.11.conf => agent_3.5.12.conf}       | 0
 mamonsu/__init__.py                                        | 2 +-
 packaging/debian/changelog                                 | 5 +++++
 packaging/rpm/SPECS/mamonsu.spec                           | 7 ++++++-
 packaging/win/mamonsu.def.nsh                              | 2 +-
 8 files changed, 17 insertions(+), 7 deletions(-)
 rename github-actions-tests/sources/{agent_3.5.11.conf => agent_3.5.12.conf} (100%)

diff --git a/.github/workflows/mamonsu-tests-dev.yml b/.github/workflows/mamonsu-tests-dev.yml
index 368d655..0336b7c 100644
--- a/.github/workflows/mamonsu-tests-dev.yml
+++ b/.github/workflows/mamonsu-tests-dev.yml
@@ -86,7 +86,7 @@ jobs:
           echo "zabbix_address=$(hostname -I | awk '{print $1}')" >> $GITHUB_OUTPUT
         id: zabbix_address
       - name: Edit Zabbix address in agent.conf
-        run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.11.conf
+        run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.12.conf
 
       - name: Copy test scripts to container
         run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) mkdir -p -m 755 /mamonsu/
diff --git a/.github/workflows/mamonsu-tests-master.yml b/.github/workflows/mamonsu-tests-master.yml
index d7072ba..6dfb86d 100644
--- a/.github/workflows/mamonsu-tests-master.yml
+++ b/.github/workflows/mamonsu-tests-master.yml
@@ -91,7 +91,7 @@ jobs:
           echo "zabbix_address=$(hostname -I | awk '{print $1}')" >> $GITHUB_OUTPUT
         id: zabbix_address
       - name: Edit Zabbix address in agent.conf
-        run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.11.conf
+        run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.12.conf
 
       - name: Copy test scripts to container
         run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) mkdir -p -m 755 /mamonsu/
diff --git a/github-actions-tests/mamonsu_build.sh b/github-actions-tests/mamonsu_build.sh
index def1505..a766806 100644
--- a/github-actions-tests/mamonsu_build.sh
+++ b/github-actions-tests/mamonsu_build.sh
@@ -41,7 +41,7 @@ if [ "${OS%:*}" = "centos" ]; then
     python3 setup.py build && python3 setup.py install
     make rpm
     sudo rpm -i ./mamonsu*.rpm
-    cat /mamonsu/github-actions-tests/sources/agent_3.5.11.conf > /etc/mamonsu/agent.conf
+    cat /mamonsu/github-actions-tests/sources/agent_3.5.12.conf > /etc/mamonsu/agent.conf
     # ensuring mamonsu can actually start
     sudo su -s /bin/bash -c "mamonsu bootstrap -x --user postgres -d mamonsu_test_db" mamonsu
     /etc/init.d/mamonsu restart
@@ -65,7 +65,7 @@ elif [ "${OS%:*}" = "ubuntu" ]; then
     python3 setup.py build && python3 setup.py install
     make deb
     sudo dpkg -i ./mamonsu*.deb
-    cat /mamonsu/github-actions-tests/sources/agent_3.5.11.conf > /etc/mamonsu/agent.conf
+    cat /mamonsu/github-actions-tests/sources/agent_3.5.12.conf > /etc/mamonsu/agent.conf
     # ensuring mamonsu can actually start
     sudo su -s /bin/bash -c "mamonsu bootstrap -x --user postgres -d mamonsu_test_db" mamonsu
     service mamonsu restart
diff --git a/github-actions-tests/sources/agent_3.5.11.conf b/github-actions-tests/sources/agent_3.5.12.conf
similarity index 100%
rename from github-actions-tests/sources/agent_3.5.11.conf
rename to github-actions-tests/sources/agent_3.5.12.conf
diff --git a/mamonsu/__init__.py b/mamonsu/__init__.py
index 0265a12..b43c491 100644
--- a/mamonsu/__init__.py
+++ b/mamonsu/__init__.py
@@ -1,7 +1,7 @@
 __author__ = 'Dmitry Vasilyev'
 __author_email__ = 'info@postgrespro.ru'
 __description__ = 'Monitoring agent for PostgreSQL'
-__version__ = '3.5.11'
+__version__ = '3.5.12'
 __licence__ = 'BSD'
 
 __url__ = 'https://github.com/postgrespro/mamonsu'
diff --git a/packaging/debian/changelog b/packaging/debian/changelog
index ab3c0ff..218931a 100644
--- a/packaging/debian/changelog
+++ b/packaging/debian/changelog
@@ -1,3 +1,8 @@
+mamonsu (3.5.12-1) stable; urgency=low
+  * Port version parser code from public archive of pypa/pkg_resources;
+  * Thread-safe implementation of connection cache;
+  * Skip BGwriter and Checkpoint plugins initialization if Postgres metrics collection was explicitly disabled;
+
 mamonsu (3.5.11-1) stable; urgency=low
   * Updated statements plugin: added support for pgpro_stats 1.8;
   * Fixed types for count_wal_lag_lsn() function (int to bigint);
diff --git a/packaging/rpm/SPECS/mamonsu.spec b/packaging/rpm/SPECS/mamonsu.spec
index 7c44f1d..dcc7c9f 100644
--- a/packaging/rpm/SPECS/mamonsu.spec
+++ b/packaging/rpm/SPECS/mamonsu.spec
@@ -1,5 +1,5 @@
 Name:           mamonsu
-Version:        3.5.11
+Version:        3.5.12
 Release:        1%{?dist}
 Summary:        Monitoring agent for PostgreSQL
 Group:          Applications/Internet
@@ -73,6 +73,11 @@ chown -R mamonsu:mamonsu /var/log/mamonsu
 chown -R mamonsu:mamonsu /etc/mamonsu
 
 %changelog
+* Wed Mar 5 2025 Maxim Styushin   - 3.5.12-1
+  - Port version parser code from public archive of pypa/pkg_resources;
+  - Thread-safe implementation of connection cache;
+  - Skip BGwriter and Checkpoint plugins initialization if Postgres metrics collection was explicitly disabled;
+
 * Wed Jan 15 2025 Maxim Styushin   - 3.5.11-1
   - Updated statements plugin: added support for pgpro_stats 1.8;
   - Fixed types for count_wal_lag_lsn() function (int to bigint);
diff --git a/packaging/win/mamonsu.def.nsh b/packaging/win/mamonsu.def.nsh
index 8138fe3..1b60f1c 100644
--- a/packaging/win/mamonsu.def.nsh
+++ b/packaging/win/mamonsu.def.nsh
@@ -1,5 +1,5 @@
 !define NAME Mamonsu
-!define VERSION 3.5.11
+!define VERSION 3.5.12
 !define MAMONSU_REG_PATH "Software\PostgresPro\Mamonsu"
 !define MAMONSU_REG_UNINSTALLER_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall"
 !define EDB_REG "SOFTWARE\Postgresql"

From 42703d81d618a815a027336de230988d7ec466f4 Mon Sep 17 00:00:00 2001
From: Andrew Papsujko 
Date: Mon, 19 May 2025 17:31:03 +0300
Subject: [PATCH 23/28] fix: deadlock in send queue

---
 mamonsu/lib/queue.py | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/mamonsu/lib/queue.py b/mamonsu/lib/queue.py
index 96ceadf..e348fc4 100644
--- a/mamonsu/lib/queue.py
+++ b/mamonsu/lib/queue.py
@@ -10,25 +10,21 @@ def __init__(self):
         self.lock = threading.Lock()
 
     def add(self, metric):
-        self.lock.acquire()
-        self.queue.insert(0, metric)
-        self.lock.release()
+        with self.lock:
+            self.queue.insert(0, metric)
 
     # replace last metric
     def replace(self, metric):
-        self.lock.acquire()
-        self.queue.pop()
-        self.queue.append(metric)
-        self.lock.release()
+        with self.lock:
+            if self.queue:
+                self.queue.pop()
+            self.queue.append(metric)
 
     def size(self):
-        self.lock.acquire()
-        result = len(self.queue)
-        self.lock.release()
-        return result
+        with self.lock:
+            return len(self.queue)
 
     def flush(self):
-        self.lock.acquire()
-        result, self.queue = self.queue, []
-        self.lock.release()
-        return result
+        with self.lock:
+            result, self.queue = self.queue, []
+            return result

From 8c198ef48118e70a1a0d7b1386068868ff2de6ce Mon Sep 17 00:00:00 2001
From: Andrew Papsujko 
Date: Wed, 21 May 2025 11:04:51 +0300
Subject: [PATCH 24/28] fix: added cgroup2 to excluded fs types

---
 mamonsu/plugins/system/linux/disk_sizes.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mamonsu/plugins/system/linux/disk_sizes.py b/mamonsu/plugins/system/linux/disk_sizes.py
index 898c2c0..d461812 100644
--- a/mamonsu/plugins/system/linux/disk_sizes.py
+++ b/mamonsu/plugins/system/linux/disk_sizes.py
@@ -20,7 +20,7 @@ class DiskSizes(Plugin):
 
     ExcludeFsTypes = [
         "none", "unknown", "rootfs", "iso9660", "squashfs", "udf", "romfs", "ramfs", "debugfs", "cgroup", "cgroup_root",
-        "pstore", "devtmpfs", "autofs", "cgroup", "configfs", "devpts", "efivarfs", "fusectl", "fuse.gvfsd-fuse",
+        "pstore", "devtmpfs", "autofs", "cgroup2", "configfs", "devpts", "efivarfs", "fusectl", "fuse.gvfsd-fuse",
         "hugetlbfs", "mqueue", "binfmt_misc", "nfsd", "proc", "pstore", "selinuxfs", "rpc_pipefs", "securityfs",
         "sysfs", "nsfs", "tmpfs", "tracefs"
     ]

From 5299263670f22cf5682076e5f601427a30bb90f6 Mon Sep 17 00:00:00 2001
From: Andrew Papsujko 
Date: Fri, 16 May 2025 12:32:51 +0300
Subject: [PATCH 25/28] feat: added metric that shows bytes held by non-active
 replication slot and according trigger

---
 documentation/metrics.md             | 64 +++++++++++++++++++++++++-
 mamonsu/lib/default_config.py        |  2 +
 mamonsu/lib/platform.py              |  1 +
 mamonsu/plugins/pgsql/driver/pool.py | 26 ++++++++++-
 mamonsu/plugins/pgsql/replication.py | 69 ++++++++++++++++++++++++++--
 mamonsu/tools/bootstrap/sql.py       | 17 +++++++
 6 files changed, 172 insertions(+), 7 deletions(-)

diff --git a/documentation/metrics.md b/documentation/metrics.md
index 15ef4a1..d507a8e 100644
--- a/documentation/metrics.md
+++ b/documentation/metrics.md
@@ -3691,7 +3691,8 @@ Default config:
 ### Replication
 
 Default config:  
-        lag_more_than_in_sec = 300
+        lag_more_than_in_sec = 300\
+        critical_bytes_held_by_non_active_slot = 1073741824 bytes
 
 ### Items
 
@@ -3763,6 +3764,37 @@ Default config:
    
     *Non-active Replication Slots* calculates as count of slots with `false` active status.
 
+- **Bytes Held By Non-active Replication Slots**  
+   
+    Zabbix item:  
+    
+ + + + + + + + + + + + + + + + + + + + + + + + +
NamePostgreSQL Replication: Bytes held by non-active slot {#NON_ACTIVE_SLOT_NAME}
Keypgsql.replication.non_active_slots_discovery[]
TypeNumeric (float)
UnitsBytes
DeltaAs Is
Supported Version10+
+ + *Non-active Replication Slots* calculates as count of slots with `false` active status. - **Streaming Replication Lag** @@ -3861,12 +3893,40 @@ Default config: +- **PostgreSQL Replication: Non-active Slots Discovery** + + Items: + + + + + + + + + + + + + + + + + + + + + +
NamePostgreSQL Replication: Bytes held by non-active slot {#NON_ACTIVE_SLOT_NAME}
Keypgsql.replication.non_active_slots_discovery[]
TypeNumeric (float)
UnitsBytes
DeltaAs Is
+ ### Triggers - **PostgreSQL Instance: server mode has been changed on {HOSTNAME} to {ITEM.LASTVALUE}** - **PostgreSQL number of non-active replication slots on {HOSTNAME} (value={ITEM.LASTVALUE})** - + Disabled by default +- **PostgreSQL Replication: bytes held by slot {#NON_ACTIVE_SLOT_NAME} is too high (value={ITEM.LASTVALUE})** + Triggers if *PostgreSQL Replication: Bytes held by non-active slot {#NON_ACTIVE_SLOT_NAME}* exceeds `critical_bytes_held_by_non_active_slot`. - **PostgreSQL streaming lag too high on {HOSTNAME} (value={ITEM.LASTVALUE})** Triggers if *PostgreSQL Replication: Streaming Replication Lag* exceeds `lag_more_than_in_sec`. diff --git a/mamonsu/lib/default_config.py b/mamonsu/lib/default_config.py index c7f2d98..12791a1 100644 --- a/mamonsu/lib/default_config.py +++ b/mamonsu/lib/default_config.py @@ -35,6 +35,8 @@ def default_host(): host = os.environ.get('PGHOST') or 'auto' if platform.FREEBSD: host = os.environ.get('PGHOST') or 'auto' + if platform.DARWIN: + host = os.environ.get('PGHOST') or 'auto' return host @staticmethod diff --git a/mamonsu/lib/platform.py b/mamonsu/lib/platform.py index 5ea5faa..279200d 100644 --- a/mamonsu/lib/platform.py +++ b/mamonsu/lib/platform.py @@ -3,5 +3,6 @@ LINUX = (sys.platform == 'linux' or sys.platform == 'linux2') WINDOWS = (sys.platform == 'win32' or sys.platform == 'win64') FREEBSD = ('freebsd' in sys.platform) +DARWIN = sys.platform == 'darwin' UNIX = LINUX or FREEBSD INTEGER_TYPES = int, diff --git a/mamonsu/plugins/pgsql/driver/pool.py b/mamonsu/plugins/pgsql/driver/pool.py index 6576f92..a8433d9 100644 --- a/mamonsu/plugins/pgsql/driver/pool.py +++ b/mamonsu/plugins/pgsql/driver/pool.py @@ -86,7 +86,7 @@ class Pool(object): """ SELECT application_name, {0} - coalesce((pg_{1}_{2}_diff(pg_current_{1}_{2}(), replay_lsn))::int, 0) AS total_lag + coalesce((pg_{1}_{2}_diff(pg_current_{1}_{2}(), replay_{2}))::int, 0) AS total_lag FROM pg_stat_replication; """, """ @@ -95,6 +95,30 @@ class Pool(object): total_lag FROM mamonsu.count_{1}_lag_lsn(); """ + ), + "wal_held_bytes_master": ( + """ + SELECT slot_name, + coalesce((pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn))::int, 0) AS wal_held_bytes + FROM pg_replication_slots; + """, + """ + SELECT slot_name, + wal_held_bytes + FROM mamonsu.bytes_held_by_inactive_slot_on_master(); + """ + ), + "wal_held_bytes_replica": ( + """ + SELECT slot_name, + coalesce((pg_wal_lsn_diff(pg_last_wal_replay_lsn(), restart_lsn))::int, 0) AS wal_held_bytes + FROM pg_replication_slots; + """, + """ + SELECT slot_name, + wal_held_bytes + FROM mamonsu.bytes_held_by_inactive_slot_on_replica(); + """ ) } diff --git a/mamonsu/plugins/pgsql/replication.py b/mamonsu/plugins/pgsql/replication.py index 8a51889..7ed701c 100644 --- a/mamonsu/plugins/pgsql/replication.py +++ b/mamonsu/plugins/pgsql/replication.py @@ -13,7 +13,8 @@ class Replication(Plugin): AgentPluginType = "pg" # key: (macro, value) plugin_macros = { - "critical_lag_seconds": [("macro", "{$CRITICAL_LAG_SECONDS}"), ("value", 60 * 5)] + "critical_lag_seconds": [("macro", "{$CRITICAL_LAG_SECONDS}"), ("value", 60 * 5)], + "critical_bytes_held_by_none_active_slot": [("macro", "{$CRITICAL_BYTES_HELD_BY_NON_ACTIVE_SLOT}"), ("value", 1024 * 1024 * 1024)] } # get time of replication lag @@ -30,8 +31,15 @@ class Replication(Plugin): WHERE active = 'false'; """ + query_bytes_held_by_non_active_slot = """ + SELECT slot_name, coalesce(pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)::bigint, 0) AS wal_size_bytes + FROM pg_replication_slots + WHERE active = 'false'; + """ + # for discovery rule for name of each replica key_lsn_replication_discovery = "pgsql.replication.discovery{0}" + key_replication_non_active_slots_discovery = "pgsql.replication.non_active_slots_discovery{0}" key_total_lag = "pgsql.replication.total_lag{0}" # for PG 10 and higher key_flush = "pgsql.replication.flush_lag{0}" @@ -42,6 +50,7 @@ class Replication(Plugin): key_replication = "pgsql.replication_lag{0}" key_non_active_slots = "pgsql.replication.non_active_slots{0}" + key_non_active_slots_held_bytes = "pgsql.replication.non_active_slots_held_bytes{0}" def run(self, zbx): @@ -79,6 +88,14 @@ def run(self, zbx): zbx.send("pgsql.replication.replay_lag[{0}]".format(info[0]), float(info[5])) zbx.send("pgsql.replication.discovery[]", zbx.json({"data": lags})) del lags + bytes_held_by_non_active_slot = Pooler.run_sql_type("wal_held_bytes_master", args=[]) + if bytes_held_by_non_active_slot: + discovery = [] + for info in bytes_held_by_non_active_slot: + discovery.append({"{#NON_ACTIVE_SLOT_NAME}": info[0]}) + zbx.send("pgsql.replication.non_active_slots_held_bytes[{0}]".format(info[0]), int(info[1])) + zbx.send("pgsql.replication.non_active_slots_discovery[]", zbx.json({"data": discovery})) + del discovery elif Pooler.is_superuser() or Pooler.is_bootstraped(): result_lags = Pooler.run_sql_type("wal_lag_lsn", args=[" ", "xlog", "location"]) if result_lags: @@ -90,7 +107,15 @@ def run(self, zbx): del lags else: self.disable_and_exit_if_not_superuser() - + else: + bytes_held_by_non_active_slot = Pooler.run_sql_type("wal_held_bytes_replica", args=[]) + if bytes_held_by_non_active_slot: + discovery = [] + for info in bytes_held_by_non_active_slot: + discovery.append({"{#NON_ACTIVE_SLOT_NAME}": info[0]}) + zbx.send("pgsql.replication.non_active_slots_held_bytes[{0}]".format(info[0]), int(info[1])) + zbx.send("pgsql.replication.non_active_slots_discovery[]", zbx.json({"data": discovery})) + del discovery non_active_slots = Pooler.query(self.query_non_active_slots) zbx.send(self.key_non_active_slots.format("[]"), int(non_active_slots[0][0])) @@ -132,7 +157,8 @@ def triggers(self, template, dashboard=False): }) + template.trigger({ "name": "PostgreSQL Replication: number of non-active replication slots on {HOSTNAME} (value={ITEM.LASTVALUE})", "expression": "{#TEMPLATE:" + self.right_type(self.key_non_active_slots) + ".last()}>" + str( - NUMBER_NON_ACTIVE_SLOTS) + NUMBER_NON_ACTIVE_SLOTS), + "status": 1 }) return triggers @@ -198,7 +224,42 @@ def discovery_rules(self, template, dashboard=False): ] } ] - return template.discovery_rule(rule=rule, conditions=conditions, items=items, graphs=graphs) + active_slots_discovery_rule = template.discovery_rule(rule=rule, conditions=conditions, items=items, graphs=graphs) + + rule = { + "name": "PostgreSQL Replication: Non Active Slots Discovery", + "key": self.key_replication_non_active_slots_discovery.format("[{0}]".format(self.Macros[self.Type])) + } + if Plugin.old_zabbix: + conditions = [] + rule["filter"] = "{#NON_ACTIVE_SLOT_NAME}:.*" + else: + conditions = [{ + "condition": [ + {"macro": "{#NON_ACTIVE_SLOT_NAME}", + "value": ".*", + "operator": 8, + "formulaid": "A"} + ] + }] + items = [ + {"key": self.right_type(self.key_non_active_slots_held_bytes, var_discovery="{#NON_ACTIVE_SLOT_NAME},"), + "name": "PostgreSQL Replication: Bytes held by non-active slot {#NON_ACTIVE_SLOT_NAME}", + "value_type": Plugin.VALUE_TYPE.numeric_float, + "delay": self.plugin_config("interval"), + "drawtype": 2} + ] + graphs = [] + triggers = [ + { + "name": "PostgreSQL Replication: bytes held by slot {#NON_ACTIVE_SLOT_NAME} is too high (value={ITEM.LASTVALUE})", + "expression": "{#TEMPLATE:" + self.right_type(self.key_non_active_slots_held_bytes, var_discovery="{#NON_ACTIVE_SLOT_NAME},") + ".last()}>" + + self.plugin_macros["critical_bytes_held_by_none_active_slot"][0][1] + } + ] + non_active_slots_discovery_rule = template.discovery_rule(rule=rule, conditions=conditions, items=items, graphs=graphs, triggers=triggers) + + return active_slots_discovery_rule + non_active_slots_discovery_rule def keys_and_queries(self, template_zabbix): result = [] diff --git a/mamonsu/tools/bootstrap/sql.py b/mamonsu/tools/bootstrap/sql.py index f37be0f..bf99442 100644 --- a/mamonsu/tools/bootstrap/sql.py +++ b/mamonsu/tools/bootstrap/sql.py @@ -236,6 +236,23 @@ coalesce((pg_{7}_diff(pg_current_{7}(), replay_{9}))::bigint, 0) AS total_lag FROM pg_stat_replication $$ LANGUAGE SQL SECURITY DEFINER; + +DROP FUNCTION IF EXISTS mamonsu.bytes_held_by_inactive_slot_on_master(); +CREATE OR REPLACE FUNCTION mamonsu.bytes_held_by_inactive_slot_on_master() +RETURNS TABLE(slot_name TEXT, wal_held_bytes BIGINT) AS $$ +SELECT slot_name::TEXT, coalesce((pg_{7}_diff(pg_current_wal_lsn(), restart_lsn))::bigint, 0) AS wal_held_bytes +FROM pg_replication_slots +WHERE active = 'false' +$$ LANGUAGE SQL SECURITY DEFINER; + +DROP FUNCTION IF EXISTS mamonsu.bytes_held_by_inactive_slot_on_replica(); +CREATE OR REPLACE FUNCTION mamonsu.bytes_held_by_inactive_slot_on_replica() +RETURNS TABLE(slot_name TEXT, wal_held_bytes BIGINT) AS $$ +SELECT slot_name::TEXT, coalesce((pg_{7}_diff(pg_last_wal_replay_lsn(), restart_lsn))::bigint, 0) AS wal_held_bytes +FROM pg_replication_slots +WHERE active = 'false' +$$ LANGUAGE SQL SECURITY DEFINER; + """ CreatePgBuffercacheFunctionsSQL = """ From 671d9a946e97a9831c2bb8cf951ffce693739f6c Mon Sep 17 00:00:00 2001 From: Ytipytiman <61265312+Ytipytiman@users.noreply.github.com> Date: Thu, 12 Sep 2024 11:32:53 +0300 Subject: [PATCH 26/28] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit В процессе установки требуется скачать скрипт: ``` Install from repository using script: wget https://repo.postgrespro.ru/mamonsu/keys/pgpro-repo-add.sh ``` По данному пути скрипта нет, получаешь ошибку 404, скрипт можно скачать по ссылке: `https://repo.postgrespro.ru/mamonsu/mamonsu/keys/pgpro-repo-add.sh` Предлагаю исправить ошибку --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a4f3076..fd6b6bf 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ Pre-built _mamonsu_ packages are provided in official Postgres Pro repository: [ **Install from repository using script:** ```shell -$ wget https://repo.postgrespro.ru/mamonsu/keys/pgpro-repo-add.sh +$ wget https://repo.postgrespro.ru/mamonsu/mamonsu/keys/pgpro-repo-add.sh $ sudo chmod 700 ./pgpro-repo-add.sh $ sudo ./pgpro-repo-add.sh ``` From f218ed4ab5683f04b007b09f9960c481330e8c1a Mon Sep 17 00:00:00 2001 From: Andrew Papsujko Date: Thu, 29 May 2025 16:34:26 +0300 Subject: [PATCH 27/28] build: upgrade to 3.5.13 --- .../sources/agent_3.5.13.conf | 210 ++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 github-actions-tests/sources/agent_3.5.13.conf diff --git a/github-actions-tests/sources/agent_3.5.13.conf b/github-actions-tests/sources/agent_3.5.13.conf new file mode 100644 index 0000000..076419e --- /dev/null +++ b/github-actions-tests/sources/agent_3.5.13.conf @@ -0,0 +1,210 @@ +# This is a configuration file for mamonsu +# To get more information about mamonsu, visit https://postgrespro.ru/docs/postgrespro/12/mamonsu + +######### Connection parameters sections ############## + +# specify connection parameters for the Postgres cluster +# in the user, password, and database fields, you must specify the mamonsu_user, mamonsu_password, +# and the mamonsu_database used for bootstrap, respectively. +# if you skipped the bootstrap, specify a superuser credentials and the database to connect to. + +[postgres] +enabled = True +user = mamonsu +password = mamonsu +database = mamonsu_test_db +host = localhost +port = 5432 +application_name = mamonsu +query_timeout = 10 + +# the address field must point to the running Zabbix server, while the client field must provide the name of +# the Zabbix host. You can find the list of hosts available for your account in the Zabbix web +# interface under Configuration > Hosts. +# re_send - True - in case of transmission error, mamonsu repeats sending metrics one by one to look in log metrics with error + +[zabbix] +enabled = True +client = pg-master +address = 127.0.0.1 +port = 10051 +timeout = 15 +re_send = False + +######### General parameters sections ############ + +# enable or disable collection of system metrics. + +[system] +enabled = True + +# control the queue size of the data to be sent to the Zabbix server + +[sender] +queue = 2048 + +# specify the location of mamonsu and whether it is allowed to access metrics from the command line + +[agent] +enabled = True +host = 127.0.0.1 +port = 10052 + +# specify custom plugins to be added for metrics collection + +[plugins] +enabled = False +directory = /etc/mamonsu/plugins + +# enable storing the collected metric data in text files locally. + +[metric_log] +enabled = False +directory = /var/log/mamonsu +max_size_mb = 1024 + +# specify logging settings for mamonsu + +[log] +file = /var/log/mamonsu/mamonsu.log +level = DEBUG +format = [%(levelname)s] %(asctime)s - %(name)s - %(message)s + +######### Individual Plugin Sections ############ + +# to disable any plugin set the enabled option to False. +# modify collection interval for each plugin in the interval field. +# set customer parameters for some plugins in the individual section. +# below listed all available parameters for each plugin to modify. + +[health] +interval = 60 + +[archivecommand] +interval = 60 + +# Besides standard autovacuum workers count, mamonsu also counts autovacuum utilization. +# But this metric is instantaneous, so recommended to run this plugin frequently +# to get a complete picture of autovacuum utilization. +[autovacuum] +interval = 30 + +[bgwriter] +interval = 60 + +[cfs] +force_enable = False +interval = 60 + +[checkpoint] +interval = 300 + +[connections] +interval = 60 + +[databases] +interval = 300 + +[pghealth] +interval = 60 + +[instance] +interval = 60 + +# This plugin allows detects possible memory leaks while working with PostgreSQL using /proc/pid/status and /proc/pid/statm +# We use RES and SHR difference to calculate approximate volume of private anonymous backend memory. +# If it exceeds private_anon_mem_threshold then that pid will be added to a message. An example is presented below +# statm - 'pid: {pid}, RES {RES} - SHR {SHR} more then {private_anon_mem_threshold}\n' +# Since Linux 4.5 RssAnon, RssFile and RssShmem have been added. +# They allows to distinguish types of memory such as private anonymous, file-backed, and shared anonymous memory. +# We are interested in RssAnon. If its value exceeds private_anon_mem_threshold then that pid will also be added to a message. +# By default this plugin disabled. To enable this plugin - set bellow "enabled = False" +# #interval - (onitoring frequency in seconds. 60 seconds by default +# private_anon_mem_threshold - memory volume threshold after which we need an investigation about memory leak. 1GB by default. +# Possible values MB, GB, TB. For example 1GB +[memoryleakdiagnostic] +enabled = True +interval = 15 +private_anon_mem_threshold = 1GB + +[oldest] +interval = 60 + +[pgbuffercache] +interval = 60 + +[pglocks] +interval = 60 + +# Get age (in seconds) of the oldest running prepared transaction and number of all prepared transactions for two-phase commit. +# https://www.postgresql.org/docs/current/sql-prepare-transaction.html +# https://www.postgresql.org/docs/12/view-pg-prepared-xacts.html +# max_prepared_transaction_time - age of prepared transaction in seconds. +# If pgsql.prepared.oldest exceeds max_prepared_transaction_time the trigger fires. +[preparedtransaction] +interval = 60 + +# Get size of relations defined in this section +# Relations - comma separated list of objects - tables and endexes (database_name.schema.relation) used to calculate relations size. +# Example: +# relations=postgres.pg_catalog.pg_class,postgres.pg_catalog.pg_user +# If the relation is blocked by some process such as vacuum full or create index, the result will be -1 +# by default this plugin disabled. To enable this plugin - set bellow "enabled = False" and define a list of relations. +[relationssize] +enabled = True +relations=postgres.pg_catalog.pg_class,mamonsu_test_db.mamonsu.config +interval = 15 + +[replication] +interval = 60 + +[statstatements] +interval = 60 + +[waitsampling] +interval = 60 + +[wal] +interval = 60 + +[disksizes] +interval = 60 + +[diskstats] +interval = 60 + +[la] +interval = 60 + +[memory] +interval = 60 + +[net] +interval = 60 + +[openfiles] +interval = 60 + +# Get size of backup catalogs stroring all WAL and backup files using pg_probackup +# (https://github.com/postgrespro/pg_probackup) +# Trigger fires if some backup has bad status e.g. (ERROR,CORRUPT,ORPHAN). +[pgprobackup] +enabled = False +interval = 300 +backup_dirs = /backup_dir1,/backup_dir2 +pg_probackup_path = /usr/bin/pg_probackup-11 + +[procstat] +interval = 60 + +[systemuptime] +interval = 60 + +[agentapi] +interval = 60 + +[logsender] +interval = 2 + +[zbxsender] +interval = 10 From 8f9655668b94d9f58eb7dfb22791c3b7fb5d3418 Mon Sep 17 00:00:00 2001 From: Andrew Papsujko Date: Thu, 29 May 2025 17:00:42 +0300 Subject: [PATCH 28/28] build: fix version --- .github/workflows/mamonsu-tests-dev.yml | 2 +- .github/workflows/mamonsu-tests-master.yml | 2 +- github-actions-tests/mamonsu_build.sh | 4 +- .../sources/agent_3.5.12.conf | 210 ------------------ mamonsu/__init__.py | 2 +- packaging/debian/changelog | 6 + packaging/rpm/SPECS/mamonsu.spec | 8 +- packaging/win/mamonsu.def.nsh | 2 +- 8 files changed, 19 insertions(+), 217 deletions(-) delete mode 100644 github-actions-tests/sources/agent_3.5.12.conf diff --git a/.github/workflows/mamonsu-tests-dev.yml b/.github/workflows/mamonsu-tests-dev.yml index 0336b7c..2427a7d 100644 --- a/.github/workflows/mamonsu-tests-dev.yml +++ b/.github/workflows/mamonsu-tests-dev.yml @@ -86,7 +86,7 @@ jobs: echo "zabbix_address=$(hostname -I | awk '{print $1}')" >> $GITHUB_OUTPUT id: zabbix_address - name: Edit Zabbix address in agent.conf - run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.12.conf + run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.13.conf - name: Copy test scripts to container run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) mkdir -p -m 755 /mamonsu/ diff --git a/.github/workflows/mamonsu-tests-master.yml b/.github/workflows/mamonsu-tests-master.yml index 6dfb86d..e14042c 100644 --- a/.github/workflows/mamonsu-tests-master.yml +++ b/.github/workflows/mamonsu-tests-master.yml @@ -91,7 +91,7 @@ jobs: echo "zabbix_address=$(hostname -I | awk '{print $1}')" >> $GITHUB_OUTPUT id: zabbix_address - name: Edit Zabbix address in agent.conf - run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.12.conf + run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.13.conf - name: Copy test scripts to container run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) mkdir -p -m 755 /mamonsu/ diff --git a/github-actions-tests/mamonsu_build.sh b/github-actions-tests/mamonsu_build.sh index a766806..6c24eb9 100644 --- a/github-actions-tests/mamonsu_build.sh +++ b/github-actions-tests/mamonsu_build.sh @@ -41,7 +41,7 @@ if [ "${OS%:*}" = "centos" ]; then python3 setup.py build && python3 setup.py install make rpm sudo rpm -i ./mamonsu*.rpm - cat /mamonsu/github-actions-tests/sources/agent_3.5.12.conf > /etc/mamonsu/agent.conf + cat /mamonsu/github-actions-tests/sources/agent_3.5.13.conf > /etc/mamonsu/agent.conf # ensuring mamonsu can actually start sudo su -s /bin/bash -c "mamonsu bootstrap -x --user postgres -d mamonsu_test_db" mamonsu /etc/init.d/mamonsu restart @@ -65,7 +65,7 @@ elif [ "${OS%:*}" = "ubuntu" ]; then python3 setup.py build && python3 setup.py install make deb sudo dpkg -i ./mamonsu*.deb - cat /mamonsu/github-actions-tests/sources/agent_3.5.12.conf > /etc/mamonsu/agent.conf + cat /mamonsu/github-actions-tests/sources/agent_3.5.13.conf > /etc/mamonsu/agent.conf # ensuring mamonsu can actually start sudo su -s /bin/bash -c "mamonsu bootstrap -x --user postgres -d mamonsu_test_db" mamonsu service mamonsu restart diff --git a/github-actions-tests/sources/agent_3.5.12.conf b/github-actions-tests/sources/agent_3.5.12.conf deleted file mode 100644 index 076419e..0000000 --- a/github-actions-tests/sources/agent_3.5.12.conf +++ /dev/null @@ -1,210 +0,0 @@ -# This is a configuration file for mamonsu -# To get more information about mamonsu, visit https://postgrespro.ru/docs/postgrespro/12/mamonsu - -######### Connection parameters sections ############## - -# specify connection parameters for the Postgres cluster -# in the user, password, and database fields, you must specify the mamonsu_user, mamonsu_password, -# and the mamonsu_database used for bootstrap, respectively. -# if you skipped the bootstrap, specify a superuser credentials and the database to connect to. - -[postgres] -enabled = True -user = mamonsu -password = mamonsu -database = mamonsu_test_db -host = localhost -port = 5432 -application_name = mamonsu -query_timeout = 10 - -# the address field must point to the running Zabbix server, while the client field must provide the name of -# the Zabbix host. You can find the list of hosts available for your account in the Zabbix web -# interface under Configuration > Hosts. -# re_send - True - in case of transmission error, mamonsu repeats sending metrics one by one to look in log metrics with error - -[zabbix] -enabled = True -client = pg-master -address = 127.0.0.1 -port = 10051 -timeout = 15 -re_send = False - -######### General parameters sections ############ - -# enable or disable collection of system metrics. - -[system] -enabled = True - -# control the queue size of the data to be sent to the Zabbix server - -[sender] -queue = 2048 - -# specify the location of mamonsu and whether it is allowed to access metrics from the command line - -[agent] -enabled = True -host = 127.0.0.1 -port = 10052 - -# specify custom plugins to be added for metrics collection - -[plugins] -enabled = False -directory = /etc/mamonsu/plugins - -# enable storing the collected metric data in text files locally. - -[metric_log] -enabled = False -directory = /var/log/mamonsu -max_size_mb = 1024 - -# specify logging settings for mamonsu - -[log] -file = /var/log/mamonsu/mamonsu.log -level = DEBUG -format = [%(levelname)s] %(asctime)s - %(name)s - %(message)s - -######### Individual Plugin Sections ############ - -# to disable any plugin set the enabled option to False. -# modify collection interval for each plugin in the interval field. -# set customer parameters for some plugins in the individual section. -# below listed all available parameters for each plugin to modify. - -[health] -interval = 60 - -[archivecommand] -interval = 60 - -# Besides standard autovacuum workers count, mamonsu also counts autovacuum utilization. -# But this metric is instantaneous, so recommended to run this plugin frequently -# to get a complete picture of autovacuum utilization. -[autovacuum] -interval = 30 - -[bgwriter] -interval = 60 - -[cfs] -force_enable = False -interval = 60 - -[checkpoint] -interval = 300 - -[connections] -interval = 60 - -[databases] -interval = 300 - -[pghealth] -interval = 60 - -[instance] -interval = 60 - -# This plugin allows detects possible memory leaks while working with PostgreSQL using /proc/pid/status and /proc/pid/statm -# We use RES and SHR difference to calculate approximate volume of private anonymous backend memory. -# If it exceeds private_anon_mem_threshold then that pid will be added to a message. An example is presented below -# statm - 'pid: {pid}, RES {RES} - SHR {SHR} more then {private_anon_mem_threshold}\n' -# Since Linux 4.5 RssAnon, RssFile and RssShmem have been added. -# They allows to distinguish types of memory such as private anonymous, file-backed, and shared anonymous memory. -# We are interested in RssAnon. If its value exceeds private_anon_mem_threshold then that pid will also be added to a message. -# By default this plugin disabled. To enable this plugin - set bellow "enabled = False" -# #interval - (onitoring frequency in seconds. 60 seconds by default -# private_anon_mem_threshold - memory volume threshold after which we need an investigation about memory leak. 1GB by default. -# Possible values MB, GB, TB. For example 1GB -[memoryleakdiagnostic] -enabled = True -interval = 15 -private_anon_mem_threshold = 1GB - -[oldest] -interval = 60 - -[pgbuffercache] -interval = 60 - -[pglocks] -interval = 60 - -# Get age (in seconds) of the oldest running prepared transaction and number of all prepared transactions for two-phase commit. -# https://www.postgresql.org/docs/current/sql-prepare-transaction.html -# https://www.postgresql.org/docs/12/view-pg-prepared-xacts.html -# max_prepared_transaction_time - age of prepared transaction in seconds. -# If pgsql.prepared.oldest exceeds max_prepared_transaction_time the trigger fires. -[preparedtransaction] -interval = 60 - -# Get size of relations defined in this section -# Relations - comma separated list of objects - tables and endexes (database_name.schema.relation) used to calculate relations size. -# Example: -# relations=postgres.pg_catalog.pg_class,postgres.pg_catalog.pg_user -# If the relation is blocked by some process such as vacuum full or create index, the result will be -1 -# by default this plugin disabled. To enable this plugin - set bellow "enabled = False" and define a list of relations. -[relationssize] -enabled = True -relations=postgres.pg_catalog.pg_class,mamonsu_test_db.mamonsu.config -interval = 15 - -[replication] -interval = 60 - -[statstatements] -interval = 60 - -[waitsampling] -interval = 60 - -[wal] -interval = 60 - -[disksizes] -interval = 60 - -[diskstats] -interval = 60 - -[la] -interval = 60 - -[memory] -interval = 60 - -[net] -interval = 60 - -[openfiles] -interval = 60 - -# Get size of backup catalogs stroring all WAL and backup files using pg_probackup -# (https://github.com/postgrespro/pg_probackup) -# Trigger fires if some backup has bad status e.g. (ERROR,CORRUPT,ORPHAN). -[pgprobackup] -enabled = False -interval = 300 -backup_dirs = /backup_dir1,/backup_dir2 -pg_probackup_path = /usr/bin/pg_probackup-11 - -[procstat] -interval = 60 - -[systemuptime] -interval = 60 - -[agentapi] -interval = 60 - -[logsender] -interval = 2 - -[zbxsender] -interval = 10 diff --git a/mamonsu/__init__.py b/mamonsu/__init__.py index b43c491..9264cb8 100644 --- a/mamonsu/__init__.py +++ b/mamonsu/__init__.py @@ -1,7 +1,7 @@ __author__ = 'Dmitry Vasilyev' __author_email__ = 'info@postgrespro.ru' __description__ = 'Monitoring agent for PostgreSQL' -__version__ = '3.5.12' +__version__ = '3.5.13' __licence__ = 'BSD' __url__ = 'https://github.com/postgrespro/mamonsu' diff --git a/packaging/debian/changelog b/packaging/debian/changelog index 218931a..6efa097 100644 --- a/packaging/debian/changelog +++ b/packaging/debian/changelog @@ -1,3 +1,9 @@ +mamonsu (3.5.13-1) stable; urgency=low + * Added a new metric that displays the bytes held by non-active replication slots, along with the corresponding trigger.; + * Set the trigger for 'number of non-active replication slots' to be disabled by default.; + * Fixed the Linux plugin to ensure compatibility with recent Linux versions that use cgroups2.; + * Resolved a deadlock issue in the send queue that caused Mamonsu to hang after network problems.; + mamonsu (3.5.12-1) stable; urgency=low * Port version parser code from public archive of pypa/pkg_resources; * Thread-safe implementation of connection cache; diff --git a/packaging/rpm/SPECS/mamonsu.spec b/packaging/rpm/SPECS/mamonsu.spec index dcc7c9f..dcfd2bd 100644 --- a/packaging/rpm/SPECS/mamonsu.spec +++ b/packaging/rpm/SPECS/mamonsu.spec @@ -1,5 +1,5 @@ Name: mamonsu -Version: 3.5.12 +Version: 3.5.13 Release: 1%{?dist} Summary: Monitoring agent for PostgreSQL Group: Applications/Internet @@ -73,6 +73,12 @@ chown -R mamonsu:mamonsu /var/log/mamonsu chown -R mamonsu:mamonsu /etc/mamonsu %changelog +* Thu May 29 2025 Andrey Papsuyko - 3.5.13-1 + - Added a new metric that displays the bytes held by non-active replication slots, along with the corresponding trigger.; + - Set the trigger for 'number of non-active replication slots' to be disabled by default.; + - Fixed the Linux plugin to ensure compatibility with recent Linux versions that use cgroups2.; + - Resolved a deadlock issue in the send queue that caused Mamonsu to hang after network problems.; + * Wed Mar 5 2025 Maxim Styushin - 3.5.12-1 - Port version parser code from public archive of pypa/pkg_resources; - Thread-safe implementation of connection cache; diff --git a/packaging/win/mamonsu.def.nsh b/packaging/win/mamonsu.def.nsh index 1b60f1c..5afbfdc 100644 --- a/packaging/win/mamonsu.def.nsh +++ b/packaging/win/mamonsu.def.nsh @@ -1,5 +1,5 @@ !define NAME Mamonsu -!define VERSION 3.5.12 +!define VERSION 3.5.13 !define MAMONSU_REG_PATH "Software\PostgresPro\Mamonsu" !define MAMONSU_REG_UNINSTALLER_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall" !define EDB_REG "SOFTWARE\Postgresql"