Files
templates-default/PostgreSQL_by_Zabbix_agent_2_active.yaml
T

2451 lines
100 KiB
YAML

zabbix_export:
version: '7.0'
template_groups:
- uuid: 748ad4d098d447d492bb935c907f652f
name: Templates/Databases
templates:
- uuid: 21cca24cec1d40cdb0c2999aa6ac3037
template: 'PostgreSQL by Zabbix agent 2 active'
name: 'PostgreSQL by Zabbix agent 2 active'
description: |
This template is designed for the deployment of PostgreSQL monitoring by Zabbix via Zabbix agent 2 and uses a loadable plugin to run SQL queries.
Setup:
1. Deploy Zabbix agent 2 with the PostgreSQL plugin. Starting with Zabbix versions 6.0.10 / 6.2.4 / 6.4 PostgreSQL metrics are moved to a loadable plugin and require installation of a separate package or compilation of the plugin from sources (https://www.zabbix.com/documentation/7.0/manual/extensions/plugins/build).
2. Create the PostgreSQL user for monitoring (`<password>` at your discretion) and inherit permissions from the default role `pg_monitor`:
CREATE USER zbx_monitor WITH PASSWORD '<PASSWORD>' INHERIT;
GRANT pg_monitor TO zbx_monitor;
3. Edit the `pg_hba.conf` configuration file to allow connections for the user `zbx_monitor`. You can check the PostgreSQL documentation for examples (https://www.postgresql.org/docs/current/auth-pg-hba-conf.html).
4. Set the connection string for the PostgreSQL instance in the `{$PG.CONNSTRING.AGENT2}` macro as URI, such as `<protocol(host:port)>`, or specify the named session - `<sessionname>`.
Note: if you want to use SSL/TLS encryption to protect communications with the remote PostgreSQL instance, a named session must be used. In that case, the instance URI should be specified in the `Plugins.PostgreSQL.Sessions.*.Uri` parameter in the PostgreSQL plugin configuration files alongside all the encryption parameters (type, certificate/key filepaths if needed etc.).
You can check the PostgreSQL plugin documentation (https://git.zabbix.com/projects/AP/repos/postgresql/browse?at=refs%2Fheads%2Frelease%2F7.0) for details about agent plugin parameters and named sessions.
Also, it is assumed that you set up the PostgreSQL instance to work in the desired encryption mode. Check the PostgreSQL documentation (https://www.postgresql.org/docs/current/ssl-tcp.html) for details.
Note that plugin TLS certificate validation relies on checking the Subject Alternative Names (SAN) instead of the Common Name (CN), check the cryptography package documentation (https://pkg.go.dev/crypto/x509) for details.
For example, to enable required encryption in transport mode without identity checks you could create the file `/etc/zabbix/zabbix_agent2.d/postgresql_myconn.conf` with the following configuration for the named session `myconn` (replace `<instanceip>` with the address of the PostgreSQL instance):
Plugins.PostgreSQL.Sessions.myconn.Uri=tcp://<instanceip>:5432
Plugins.PostgreSQL.Sessions.myconn.TLSConnect=required
Then set the `{$PG.CONNSTRING.AGENT2}` macro to `myconn` to use this named session.
5. Set the password that you specified in step 2 in the macro `{$PG.PASSWORD}`.
You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384190-%C2%A0discussion-thread-for-official-zabbix-template-db-postgresql
Generated by official Zabbix template tool "Templator"
vendor:
name: Zabbix
version: 7.0-3
groups:
- name: Templates/Databases
items:
- uuid: b760f7ff059e40d7ab9d26fe5cc3fa2d
name: 'Archive: Count of archived files'
type: DEPENDENT
key: pgsql.archive.count_archived_files
delay: '0'
value_type: FLOAT
description: 'Count of archived files.'
preprocessing:
- type: JSONPATH
parameters:
- $.archived_count
master_item:
key: 'pgsql.archive["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: archive
- uuid: 8d7aee551783484d9a321a5e7d57c417
name: 'Archive: Count of files in archive_status need to archive'
type: DEPENDENT
key: pgsql.archive.count_files_to_archive
delay: '0'
value_type: FLOAT
description: 'Count of files to archive.'
preprocessing:
- type: JSONPATH
parameters:
- $.count_files
master_item:
key: 'pgsql.archive["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: archive
- uuid: 99ada32d0c2f4241bc81a09b0226b661
name: 'Archive: Count of failed attempts to archive files'
type: DEPENDENT
key: pgsql.archive.failed_trying_to_archive
delay: '0'
value_type: FLOAT
description: 'Count of failed attempts to archive files.'
preprocessing:
- type: JSONPATH
parameters:
- $.failed_count
master_item:
key: 'pgsql.archive["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: archive
- uuid: 842a4e56976a4dcbb41b388bfb3798ea
name: 'Archive: Size of files need to archive'
type: DEPENDENT
key: pgsql.archive.size_files_to_archive
delay: '0'
value_type: FLOAT
description: 'Size of files to archive.'
preprocessing:
- type: JSONPATH
parameters:
- $.size_files
master_item:
key: 'pgsql.archive["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: archive
- uuid: 218b03c8bfb84b07ae0ec9ba0932fff3
name: 'Get archive'
type: ZABBIX_ACTIVE
key: 'pgsql.archive["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
history: '0'
value_type: TEXT
trends: '0'
description: 'Collect archive status metrics.'
tags:
- tag: component
value: raw
- uuid: bc14c8544eed47ce9510a803be5708d7
name: 'Count of autovacuum workers'
type: ZABBIX_ACTIVE
key: 'pgsql.autovacuum.count["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
value_type: FLOAT
description: 'Number of autovacuum workers.'
tags:
- tag: component
value: system
- uuid: eadfb41d59a84315a8b3540005fc9138
name: 'Bgwriter: Buffers allocated per second'
type: DEPENDENT
key: pgsql.bgwriter.buffers_alloc.rate
delay: '0'
value_type: FLOAT
description: 'Number of buffers allocated per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.buffers_alloc
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.bgwriter["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: bgwriter
- uuid: 6c1df723638b435a813e144b730bab0a
name: 'Bgwriter: Buffers written directly by a backend per second'
type: DEPENDENT
key: pgsql.bgwriter.buffers_backend.rate
delay: '0'
value_type: FLOAT
description: 'Number of buffers written directly by a backend per second. Available in PostgreSQL versions prior to 17.'
preprocessing:
- type: JSONPATH
parameters:
- $.buffers_backend
error_handler: DISCARD_VALUE
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.bgwriter["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: bgwriter
- uuid: 2e0f72740975437d94807cc1ea3a52cd
name: 'Bgwriter: Times a backend executed its own fsync per second'
type: DEPENDENT
key: pgsql.bgwriter.buffers_backend_fsync.rate
delay: '0'
value_type: FLOAT
description: 'Number of times a backend had to execute its own fsync call per second (normally the background writer handles those even when the backend does its own write). Available in PostgreSQL versions prior to 17.'
preprocessing:
- type: JSONPATH
parameters:
- $.buffers_backend_fsync
error_handler: DISCARD_VALUE
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.bgwriter["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: bgwriter
- uuid: 84bffdbacf8449e48a58a15f3363d3b2
name: 'Checkpoint: Buffers written during checkpoints per second'
type: DEPENDENT
key: pgsql.bgwriter.buffers_checkpoint.rate
delay: '0'
value_type: FLOAT
description: 'Number of buffers written during checkpoints per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.buffers_checkpoint
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.bgwriter["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: bgwriter
- uuid: 98cace696df64de8a5f5106a8c2c52ba
name: 'Checkpoint: Buffers written by the background writer per second'
type: DEPENDENT
key: pgsql.bgwriter.buffers_clean.rate
delay: '0'
value_type: FLOAT
description: 'Number of buffers written by the background writer per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.buffers_clean
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.bgwriter["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: bgwriter
- uuid: 35b2f1af4e1f45d9b729eb09757ce6e4
name: 'Checkpoint: Requested per second'
type: DEPENDENT
key: pgsql.bgwriter.checkpoints_req.rate
delay: '0'
value_type: FLOAT
description: 'Number of requested checkpoints that have been performed per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.checkpoints_req
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.bgwriter["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: bgwriter
- uuid: a3d03d5bba4d4bb0a1ed52f684143ca5
name: 'Checkpoint: Scheduled per second'
type: DEPENDENT
key: pgsql.bgwriter.checkpoints_timed.rate
delay: '0'
value_type: FLOAT
description: 'Number of scheduled checkpoints that have been performed per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.checkpoints_timed
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.bgwriter["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: bgwriter
- uuid: 7ff2d5d51057451fb2089e92444feb84
name: 'Checkpoint: Checkpoint sync time per second'
type: DEPENDENT
key: pgsql.bgwriter.checkpoint_sync_time.rate
delay: '0'
value_type: FLOAT
units: s
description: 'Total amount of time per second that has been spent in the portion of checkpoint processing where files are synchronized to disk.'
preprocessing:
- type: JSONPATH
parameters:
- $.checkpoint_sync_time
- type: MULTIPLIER
parameters:
- '0.001'
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.bgwriter["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: bgwriter
- uuid: 7217bdae3d72478aae2c2cc1c151f203
name: 'Checkpoint: Checkpoint write time per second'
type: DEPENDENT
key: pgsql.bgwriter.checkpoint_write_time.rate
delay: '0'
value_type: FLOAT
units: s
description: 'Total amount of time per second that has been spent in the portion of checkpoint processing where files are written to disk.'
preprocessing:
- type: JSONPATH
parameters:
- $.checkpoint_write_time
- type: MULTIPLIER
parameters:
- '0.001'
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.bgwriter["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: bgwriter
- uuid: d0cb711ca251430ab0c1beb5f2617c6d
name: 'Bgwriter: Number of bgwriter cleaning scan stopped per second'
type: DEPENDENT
key: pgsql.bgwriter.maxwritten_clean.rate
delay: '0'
value_type: FLOAT
description: 'Number of times the background writer stopped a cleaning scan because it had written too many buffers per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.maxwritten_clean
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.bgwriter["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: bgwriter
- uuid: 8d0dd45f06974d6b8be9cc11404ac1c3
name: 'Get bgwriter'
type: ZABBIX_ACTIVE
key: 'pgsql.bgwriter["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
history: '0'
value_type: TEXT
trends: '0'
description: |
Collect all metrics from pg_stat_bgwriter:
https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-BGWRITER-VIEW
tags:
- tag: component
value: raw
- uuid: 7b701ad8f20a44958956a6cbfd4e5da2
name: 'Cache hit ratio, %'
type: CALCULATED
key: pgsql.cache.hit
value_type: FLOAT
units: '%'
params: 'last(//pgsql.dbstat.sum.blks_hit.rate) * 100 / (last(//pgsql.dbstat.sum.blks_hit.rate) + last(//pgsql.dbstat.sum.blks_read.rate))'
description: 'Cache hit ratio.'
tags:
- tag: component
value: cache
- uuid: 20eca5056709454189394db755132cb5
name: 'Connections sum: Active'
type: DEPENDENT
key: pgsql.connections.sum.active
delay: '0'
description: 'Total number of connections executing a query.'
preprocessing:
- type: JSONPATH
parameters:
- $.active
master_item:
key: 'pgsql.connections["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: connections
- uuid: 8ff6487a87d049ae95a4465b5c3cf438
name: 'Connections sum: Disabled'
type: DEPENDENT
key: pgsql.connections.sum.disabled
delay: '0'
description: 'Total number of disabled connections.'
preprocessing:
- type: JSONPATH
parameters:
- $.disabled
master_item:
key: 'pgsql.connections["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: connections
- uuid: dde39d43bd8e45e29e6ca2ab28d34499
name: 'Connections sum: Fastpath function call'
type: DEPENDENT
key: pgsql.connections.sum.fastpath_function_call
delay: '0'
description: 'Total number of connections executing a fast-path function.'
preprocessing:
- type: JSONPATH
parameters:
- $.fastpath_function_call
master_item:
key: 'pgsql.connections["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: connections
- uuid: 4717491488f642f5ad40d93da59793f5
name: 'Connections sum: Idle'
type: DEPENDENT
key: pgsql.connections.sum.idle
delay: '0'
description: 'Total number of connections waiting for a new client command.'
preprocessing:
- type: JSONPATH
parameters:
- $.idle
master_item:
key: 'pgsql.connections["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: connections
- uuid: cda45db6de6d4deeb988235f0c7d9376
name: 'Connections sum: Idle in transaction'
type: DEPENDENT
key: pgsql.connections.sum.idle_in_transaction
delay: '0'
description: 'Total number of connections in a transaction state but not executing a query.'
preprocessing:
- type: JSONPATH
parameters:
- $.idle_in_transaction
master_item:
key: 'pgsql.connections["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: connections
- uuid: 503826ace4f848ada43abc60ff7c1ee2
name: 'Connections sum: Idle in transaction (aborted)'
type: DEPENDENT
key: pgsql.connections.sum.idle_in_transaction_aborted
delay: '0'
description: 'Total number of connections in a transaction state but not executing a query, and where one of the statements in the transaction caused an error.'
preprocessing:
- type: JSONPATH
parameters:
- $.idle_in_transaction_aborted
master_item:
key: 'pgsql.connections["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: connections
- uuid: 604c4b1fd04249be896c7588bf2c6b23
name: 'Connections sum: Prepared'
type: DEPENDENT
key: pgsql.connections.sum.prepared
delay: '0'
description: |
Total number of prepared transactions:
https://www.postgresql.org/docs/current/sql-prepare-transaction.html
preprocessing:
- type: JSONPATH
parameters:
- $.prepared
master_item:
key: 'pgsql.connections["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: connections
- uuid: d7faa8068a8f4877b77fb5120bbe6d8d
name: 'Connections sum: Total'
type: DEPENDENT
key: pgsql.connections.sum.total
delay: '0'
description: 'Total number of connections.'
preprocessing:
- type: JSONPATH
parameters:
- $.total
master_item:
key: 'pgsql.connections["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: connections
- uuid: 85b9cf0643fc4cf289f8b0ac364e8879
name: 'Connections sum: Total, %'
type: DEPENDENT
key: pgsql.connections.sum.total_pct
delay: '0'
units: '%'
description: 'Total number of connections, in percentage.'
preprocessing:
- type: JSONPATH
parameters:
- $.total_pct
master_item:
key: 'pgsql.connections["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: connections
triggers:
- uuid: f07fbe410afa48e6a08da06f4af504c5
expression: 'min(/PostgreSQL by Zabbix agent 2 active/pgsql.connections.sum.total_pct,5m) > {$PG.CONN_TOTAL_PCT.MAX.WARN}'
name: 'PostgreSQL: Total number of connections is too high'
event_name: 'PostgreSQL: Total number of connections is too high (over {$PG.CONN_TOTAL_PCT.MAX.WARN} in 5m)'
priority: AVERAGE
description: 'Total number of current connections exceeds the limit of {$PG.CONN_TOTAL_PCT.MAX.WARN}% out of the maximum number of concurrent connections to the database server (the "max_connections" setting).'
tags:
- tag: scope
value: performance
- uuid: 2a05cc636fc0432386a5c6c00ac2777b
name: 'Connections sum: Waiting'
type: DEPENDENT
key: pgsql.connections.sum.waiting
delay: '0'
description: |
Total number of waiting connections:
https://www.postgresql.org/docs/current/monitoring-stats.html#WAIT-EVENT-TABLE
preprocessing:
- type: JSONPATH
parameters:
- $.waiting
master_item:
key: 'pgsql.connections["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: connections
- uuid: 52d9d2342b9c40a2b279dcbe4bcff023
name: 'Get connections sum'
type: ZABBIX_ACTIVE
key: 'pgsql.connections["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
history: '0'
value_type: TEXT
trends: '0'
description: |
Collect all metrics from pg_stat_activity:
https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW
tags:
- tag: component
value: raw
- uuid: defcba230619484db1a7d6faace8b33d
name: 'Custom queries'
type: ZABBIX_ACTIVE
key: 'pgsql.custom.query["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}",""]'
history: 1h
value_type: TEXT
trends: '0'
status: DISABLED
description: 'Execute custom queries from file *.sql (check for option Plugins.Postgres.CustomQueriesPath at agent configuration).'
tags:
- tag: component
value: application
- uuid: dbdeb7a7fc9f4187b29fb0dae2f2af62
name: 'Dbstat: Hit blocks read per second'
type: DEPENDENT
key: pgsql.dbstat.sum.blks_hit.rate
delay: '0'
value_type: FLOAT
description: 'Number of times per second disk blocks were found already in the buffer cache'
preprocessing:
- type: JSONPATH
parameters:
- $.blks_hit
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: cache
- uuid: 136db4803969403ebf2fdb97e1e3b1ec
name: 'Dbstat: Disk blocks read per second'
type: DEPENDENT
key: pgsql.dbstat.sum.blks_read.rate
delay: '0'
value_type: FLOAT
description: 'Number of disk blocks read per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.blks_read
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: storage
- uuid: badd110db2c64debb5619819299d7d47
name: 'Dbstat: Blocks read time'
type: DEPENDENT
key: pgsql.dbstat.sum.blk_read_time
delay: '0'
value_type: FLOAT
units: s
description: 'Time spent reading data file blocks by backends.'
preprocessing:
- type: JSONPATH
parameters:
- $.blk_read_time
- type: MULTIPLIER
parameters:
- '0.001'
master_item:
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: storage
- uuid: 310219edd25c45b19ca7ee9e3621331a
name: 'Dbstat: Blocks write time'
type: DEPENDENT
key: pgsql.dbstat.sum.blk_write_time
delay: '0'
value_type: FLOAT
units: s
description: 'Time spent writing data file blocks by backends.'
preprocessing:
- type: JSONPATH
parameters:
- $.blk_write_time
- type: MULTIPLIER
parameters:
- '0.001'
master_item:
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: storage
- uuid: f59fe2b665c94405b82bbc523aff1988
name: 'Dbstat: Checksum failures per second'
type: DEPENDENT
key: pgsql.dbstat.sum.checksum_failures.rate
delay: '0'
value_type: FLOAT
description: 'Number of data page checksum failures per second detected (or on a shared object), or NULL if data checksums are not enabled. This metric is available since PostgreSQL 12.'
valuemap:
name: 'PostgreSQL checksum failure status'
preprocessing:
- type: JSONPATH
parameters:
- $.checksum_failures
- type: MATCHES_REGEX
parameters:
- '^\d*$'
error_handler: CUSTOM_VALUE
error_handler_params: '-2'
- type: CHANGE_PER_SECOND
parameters:
- ''
error_handler: CUSTOM_VALUE
error_handler_params: '-1'
master_item:
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: system
triggers:
- uuid: 15357041a8774ae19a6cfa64154a4395
expression: 'last(/PostgreSQL by Zabbix agent 2 active/pgsql.dbstat.sum.checksum_failures.rate)>0'
name: 'PostgreSQL: Dbstat: Checksum failures detected'
priority: AVERAGE
description: |
Data page checksum failures were detected on that DB instance:
https://www.postgresql.org/docs/current/checksums.html
tags:
- tag: scope
value: availability
- uuid: e53fc92d8d4b4f8690901f4eb736ca8a
name: 'Dbstat: Conflicts per second'
type: DEPENDENT
key: pgsql.dbstat.sum.conflicts.rate
delay: '0'
value_type: FLOAT
description: 'Number of queries canceled per second due to conflicts with recovery (conflicts occur only on standby servers; see pg_stat_database_conflicts for details).'
preprocessing:
- type: JSONPATH
parameters:
- $.conflicts
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: queries
- uuid: 5ffee9612e844f15bfb1869f9f139171
name: 'Dbstat: Deadlocks per second'
type: DEPENDENT
key: pgsql.dbstat.sum.deadlocks.rate
delay: '0'
value_type: FLOAT
description: 'Number of deadlocks detected per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.deadlocks
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: deadlocks
- uuid: b7fecc03343045478e54f21a4406e793
name: 'Dbstat: Backends connected'
type: DEPENDENT
key: pgsql.dbstat.sum.numbackends
delay: '0'
description: 'Number of connected backends.'
preprocessing:
- type: JSONPATH
parameters:
- $.numbackends
master_item:
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: backends
- uuid: 1e95365a6e9c461aa7f09c407ecc7844
name: 'Dbstat: Number temp bytes per second'
type: DEPENDENT
key: pgsql.dbstat.sum.temp_bytes.rate
delay: '0'
value_type: FLOAT
units: b
description: 'Total amount of data written per second to temporary files by queries.'
preprocessing:
- type: JSONPATH
parameters:
- $.temp_bytes
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: storage
- uuid: 848bf15ec1c840959c83eba95645a810
name: 'Dbstat: Number temp files per second'
type: DEPENDENT
key: pgsql.dbstat.sum.temp_files.rate
delay: '0'
value_type: FLOAT
description: 'Number of temporary files created by queries per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.temp_files
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: storage
- uuid: db78e1e34e154bfca1e3fbc1fd1f0f20
name: 'Dbstat: Rows deleted per second'
type: DEPENDENT
key: pgsql.dbstat.sum.tup_deleted.rate
delay: '0'
value_type: FLOAT
description: 'Number of rows deleted by queries per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.tup_deleted
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: queries
- uuid: 3a1d49dd854d442aa0cafbc8025a942c
name: 'Dbstat: Rows fetched per second'
type: DEPENDENT
key: pgsql.dbstat.sum.tup_fetched.rate
delay: '0'
value_type: FLOAT
description: 'Number of rows fetched by queries per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.tup_fetched
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: queries
- uuid: fc3e55d1a7d147049715b064bdf234b0
name: 'Dbstat: Rows inserted per second'
type: DEPENDENT
key: pgsql.dbstat.sum.tup_inserted.rate
delay: '0'
value_type: FLOAT
description: 'Number of rows inserted by queries per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.tup_inserted
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: queries
- uuid: a92bc6f9bbbb4bf5b8289568b89642c8
name: 'Dbstat: Rows returned per second'
type: DEPENDENT
key: pgsql.dbstat.sum.tup_returned.rate
delay: '0'
value_type: FLOAT
description: 'Number of rows returned by queries per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.tup_returned
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: queries
- uuid: 9f8498a20db04822b0d03df4d8cb184e
name: 'Dbstat: Rows updated per second'
type: DEPENDENT
key: pgsql.dbstat.sum.tup_updated.rate
delay: '0'
value_type: FLOAT
description: 'Number of rows updated by queries per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.tup_updated
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: queries
- uuid: fed4fd91cbf846929795b960266301b7
name: 'Dbstat: Committed transactions per second'
type: DEPENDENT
key: pgsql.dbstat.sum.xact_commit.rate
delay: '0'
value_type: FLOAT
description: 'Number of transactions that have been committed per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.xact_commit
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: transactions
- uuid: e3337867025d4cd7bc4d26d663a4fc61
name: 'Dbstat: Roll backed transactions per second'
type: DEPENDENT
key: pgsql.dbstat.sum.xact_rollback.rate
delay: '0'
value_type: FLOAT
description: 'Number of transactions that have been rolled back per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.xact_rollback
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: transactions
- uuid: 8d84c4ec8d05427f9da4b9a1904a0af4
name: 'Get dbstat sum'
type: ZABBIX_ACTIVE
key: 'pgsql.dbstat.sum["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
history: '0'
value_type: TEXT
trends: '0'
description: |
Collect all metrics from pg_stat_database as sums for all databases:
https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-DATABASE-VIEW
tags:
- tag: component
value: raw
- uuid: e36f2b3e33e2435d9b95472a7844a1a4
name: 'Get dbstat'
type: ZABBIX_ACTIVE
key: 'pgsql.dbstat["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
history: '0'
value_type: TEXT
trends: '0'
description: |
Collect all metrics from pg_stat_database per database:
https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-DATABASE-VIEW
tags:
- tag: component
value: raw
- uuid: df19db910015411996e25ea5b48f0742
name: 'Get locks'
type: ZABBIX_ACTIVE
key: 'pgsql.locks["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
history: '0'
value_type: TEXT
trends: '0'
description: |
Collect all metrics from pg_locks per database:
https://www.postgresql.org/docs/current/explicit-locking.html#LOCKING-TABLES
tags:
- tag: component
value: raw
- uuid: 1a32b0308496460b83ad2698edb21420
name: 'Age of oldest xid'
type: ZABBIX_ACTIVE
key: 'pgsql.oldest.xid["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
value_type: FLOAT
description: 'Age of oldest xid.'
tags:
- tag: component
value: transactions
triggers:
- uuid: 233757fda5784d9fb264bd0d4a7765ac
expression: 'last(/PostgreSQL by Zabbix agent 2 active/pgsql.oldest.xid["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]) > 18000000'
name: 'PostgreSQL: Oldest xid is too big'
priority: AVERAGE
tags:
- tag: scope
value: availability
- uuid: 52edd592df6f49df9bf46b5e93689a1a
name: Ping
type: ZABBIX_ACTIVE
key: 'pgsql.ping["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
description: 'Used to test a connection to see if it is alive. It is set to 0 if the query is unsuccessful.'
valuemap:
name: 'Service state'
preprocessing:
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
tags:
- tag: component
value: application
- tag: component
value: health
triggers:
- uuid: ab52bca5bae940cdad5b7eead56f2ff9
expression: 'last(/PostgreSQL by Zabbix agent 2 active/pgsql.ping["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"])=0'
name: 'PostgreSQL: Service is down'
priority: HIGH
description: 'Last test of a connection was unsuccessful.'
tags:
- tag: scope
value: availability
- uuid: 060c0efaf60944538bf5fb6ca2828dc6
name: 'Get queries'
type: ZABBIX_ACTIVE
key: 'pgsql.queries["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}","{$PG.QUERY_ETIME.MAX.WARN}"]'
history: '0'
value_type: TEXT
trends: '0'
description: 'Collect all metrics by query execution time.'
tags:
- tag: component
value: raw
- uuid: f15d0758764c4bd6b607335d9d57b76b
name: 'Replication: Standby count'
type: ZABBIX_ACTIVE
key: 'pgsql.replication.count["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
description: 'Number of standby servers.'
tags:
- tag: component
value: replication
- uuid: a3297ef8198145848d4e3b16b7b8eb8b
name: 'Replication: Lag in bytes'
type: ZABBIX_ACTIVE
key: 'pgsql.replication.lag.b["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
units: B
description: 'Replication lag with master, in bytes.'
tags:
- tag: component
value: replication
- uuid: 142e93b332e24ecfbd50465bb4af91e7
name: 'Replication: Lag in seconds'
type: ZABBIX_ACTIVE
key: 'pgsql.replication.lag.sec["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
units: s
description: 'Replication lag with master, in seconds.'
tags:
- tag: component
value: replication
- uuid: aa03fb9cabd8459ea5f5efb90c9e1051
name: 'Get replication'
type: ZABBIX_ACTIVE
key: 'pgsql.replication.process["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
history: '0'
value_type: TEXT
trends: '0'
description: 'Collect metrics from the pg_stat_replication, which contains information about the WAL sender process, showing statistics about replication to that sender''s connected standby server.'
tags:
- tag: component
value: raw
- uuid: 226bcc226ffc487ba90d998a03692404
name: 'Replication: Recovery role'
type: ZABBIX_ACTIVE
key: 'pgsql.replication.recovery_role["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
description: 'Replication role: 1 — recovery is still in progress (standby mode), 0 — master mode.'
valuemap:
name: 'PostgreSQL recovery role'
tags:
- tag: component
value: replication
- uuid: ef2ac5eaf73c40e09af41bba03b4fac8
name: 'Replication: Status'
type: ZABBIX_ACTIVE
key: 'pgsql.replication.status["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
description: 'Replication status: 0 — streaming is down, 1 — streaming is up, 2 — master mode.'
valuemap:
name: 'PostgreSQL replication status'
tags:
- tag: component
value: replication
- uuid: 46b53fcf97a74619a03c2490fe9b71ea
name: Uptime
type: ZABBIX_ACTIVE
key: 'pgsql.uptime["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
value_type: FLOAT
units: uptime
description: 'Time since the server started.'
tags:
- tag: component
value: application
triggers:
- uuid: ec3d8fb289234e84b300b83ce169137f
expression: 'last(/PostgreSQL by Zabbix agent 2 active/pgsql.uptime["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]) < 10m'
name: 'PostgreSQL: Service has been restarted'
event_name: 'PostgreSQL: Service has been restarted (uptime < 10m)'
priority: AVERAGE
description: 'PostgreSQL uptime is less than 10 minutes.'
tags:
- tag: scope
value: notice
- uuid: 7a96feee8118450e83e994be87bc5eea
name: Version
type: ZABBIX_ACTIVE
key: 'pgsql.version["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
delay: 15m
value_type: CHAR
trends: '0'
description: 'PostgreSQL version.'
preprocessing:
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1d
tags:
- tag: component
value: application
triggers:
- uuid: 0d8c3bf10b4e42f796f72136768ce6ab
expression: 'last(/PostgreSQL by Zabbix agent 2 active/pgsql.version["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"],#1)<>last(/PostgreSQL by Zabbix agent 2 active/pgsql.version["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"],#2) and length(last(/PostgreSQL by Zabbix agent 2 active/pgsql.version["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]))>0'
name: 'PostgreSQL: Version has changed'
event_name: 'PostgreSQL: Version has changed (new version value received: {ITEM.VALUE})'
priority: INFO
tags:
- tag: scope
value: notice
- uuid: 5fc77f9d1d1d46ed84d71dedaf30de75
name: 'WAL: Segments count'
type: DEPENDENT
key: pgsql.wal.count
delay: '0'
description: 'Number of WAL segments.'
preprocessing:
- type: JSONPATH
parameters:
- $.count
master_item:
key: 'pgsql.wal.stat["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: wal
- uuid: 78f6cd549ecc417880df1851d8427722
name: 'WAL: Bytes received'
type: DEPENDENT
key: pgsql.wal.receive
delay: '0'
units: B
description: 'WAL receive, in bytes.'
preprocessing:
- type: JSONPATH
parameters:
- $.receive
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.wal.stat["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: wal
- uuid: cb2a0f990a39411e9d3c7d95cc7504ee
name: 'Get WAL'
type: ZABBIX_ACTIVE
key: 'pgsql.wal.stat["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
delay: 5m
history: '0'
value_type: TEXT
trends: '0'
description: 'Collect write-ahead log (WAL) metrics.'
tags:
- tag: component
value: raw
- uuid: 492f311473f645f19b79f46d07c9950a
name: 'WAL: Bytes written'
type: DEPENDENT
key: pgsql.wal.write
delay: '0'
units: B
description: 'WAL write, in bytes.'
preprocessing:
- type: JSONPATH
parameters:
- $.write
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.wal.stat["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: wal
discovery_rules:
- uuid: c5a95125be304bbeba407ce926ad7816
name: 'Database discovery'
type: ZABBIX_ACTIVE
key: 'pgsql.db.discovery["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
delay: 1h
filter:
evaltype: AND
conditions:
- macro: '{#DBNAME}'
value: '{$PG.LLD.FILTER.DBNAME}'
formulaid: A
description: |
Discovers databases (DB) in the database management system (DBMS), except:
- templates;
- DBs that do not allow connections.
item_prototypes:
- uuid: 7df48c3384b14356903c38b3b0e1c435
name: 'DB [{#DBNAME}]: Database age'
type: ZABBIX_ACTIVE
key: 'pgsql.db.age["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]'
delay: 10m
description: 'Database age.'
tags:
- tag: component
value: application
- tag: database
value: '{#DBNAME}'
- uuid: cd5516d8ea994a9e86aff2081d611176
name: 'DB [{#DBNAME}]: Bloating tables'
type: ZABBIX_ACTIVE
key: 'pgsql.db.bloating_tables["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]'
description: 'Number of bloating tables.'
tags:
- tag: component
value: tables
- tag: database
value: '{#DBNAME}'
- uuid: f2d58306483d4bb4a215e245f133b4ad
name: 'DB [{#DBNAME}]: Database size'
type: ZABBIX_ACTIVE
key: 'pgsql.db.size["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]'
delay: 5m
units: B
description: 'Database size.'
tags:
- tag: component
value: storage
- tag: database
value: '{#DBNAME}'
- uuid: ce43087066804e828d8a64eb0cc13ac6
name: 'DB [{#DBNAME}]: Blocks hit per second'
type: DEPENDENT
key: 'pgsql.dbstat.blks_hit.rate["{#DBNAME}"]'
delay: '0'
value_type: FLOAT
description: 'Total number of times per second disk blocks were found already in the buffer cache, so that a read was not necessary.'
preprocessing:
- type: JSONPATH
parameters:
- $.blks_hit
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: cache
- tag: database
value: '{#DBNAME}'
- uuid: 01d227b759d7404481e12e0daa90b3bb
name: 'DB [{#DBNAME}]: Disk blocks read per second'
type: DEPENDENT
key: 'pgsql.dbstat.blks_read.rate["{#DBNAME}"]'
delay: '0'
value_type: FLOAT
description: 'Total number of disk blocks read per second in this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.blks_read
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: storage
- tag: database
value: '{#DBNAME}'
- uuid: 1592dc3a802944cf8946bfee38652d44
name: 'DB [{#DBNAME}]: Disk blocks read time per second'
type: DEPENDENT
key: 'pgsql.dbstat.blk_read_time.rate["{#DBNAME}"]'
delay: '0'
value_type: FLOAT
units: s
description: 'Time spent reading data file blocks by backends per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.blk_read_time
- type: MULTIPLIER
parameters:
- '0.001'
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: storage
- tag: database
value: '{#DBNAME}'
- uuid: 491b9e40b3a243d6b22fb24124d98293
name: 'DB [{#DBNAME}]: Disk blocks write time'
type: DEPENDENT
key: 'pgsql.dbstat.blk_write_time.rate["{#DBNAME}"]'
delay: '0'
value_type: FLOAT
units: s
description: 'Time spent writing data file blocks by backends per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.blk_write_time
- type: MULTIPLIER
parameters:
- '0.001'
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: storage
- tag: database
value: '{#DBNAME}'
- uuid: 9540fc8baf2c4b0b81e4d8eafe1f57cf
name: 'DB [{#DBNAME}]: Checksum failures'
type: DEPENDENT
key: 'pgsql.dbstat.checksum_failures.rate["{#DBNAME}"]'
delay: '0'
value_type: FLOAT
description: 'Number of data page checksum failures detected in this database.'
valuemap:
name: 'PostgreSQL checksum failure status'
preprocessing:
- type: JSONPATH
parameters:
- $.checksum_failures
- type: MATCHES_REGEX
parameters:
- '^\d*$'
error_handler: CUSTOM_VALUE
error_handler_params: '-2'
- type: CHANGE_PER_SECOND
parameters:
- ''
error_handler: CUSTOM_VALUE
error_handler_params: '-1'
master_item:
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: system
- tag: database
value: '{#DBNAME}'
trigger_prototypes:
- uuid: b0a2935d0a984233a530cf47d8fc606b
expression: 'last(/PostgreSQL by Zabbix agent 2 active/pgsql.dbstat.checksum_failures.rate["{#DBNAME}"])>0'
name: 'PostgreSQL: DB [{#DBNAME}]: Checksum failures detected'
priority: AVERAGE
description: |
Data page checksum failures were detected on that database:
https://www.postgresql.org/docs/current/checksums.html
tags:
- tag: scope
value: availability
- uuid: 3e48cd0cf7214f77b8b6d9e76c1def00
name: 'DB [{#DBNAME}]: Detected conflicts per second'
type: DEPENDENT
key: 'pgsql.dbstat.conflicts.rate["{#DBNAME}"]'
delay: '0'
value_type: FLOAT
description: 'Total number of queries canceled due to conflicts with recovery in this database per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.conflicts
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: queries
- tag: database
value: '{#DBNAME}'
trigger_prototypes:
- uuid: d156ed02bcad4123a827a3d7900bed1e
expression: 'min(/PostgreSQL by Zabbix agent 2 active/pgsql.dbstat.conflicts.rate["{#DBNAME}"],5m) > {$PG.CONFLICTS.MAX.WARN:"{#DBNAME}"}'
name: 'PostgreSQL: DB [{#DBNAME}]: Too many recovery conflicts'
event_name: 'PostgreSQL: DB [{#DBNAME}]: Too many recovery conflicts (over {$PG.CONFLICTS.MAX.WARN:"{#DBNAME}"} in 5m)'
priority: AVERAGE
description: |
The primary and standby servers are in many ways loosely connected. Actions on the primary will have an effect on the standby. As a result, there is potential for negative interactions or conflicts between them.
https://www.postgresql.org/docs/current/hot-standby.html#HOT-STANDBY-CONFLICT
tags:
- tag: scope
value: performance
- uuid: 43aab996a12a49c582d46f96f999ab89
name: 'DB [{#DBNAME}]: Detected deadlocks per second'
type: DEPENDENT
key: 'pgsql.dbstat.deadlocks.rate["{#DBNAME}"]'
delay: '0'
value_type: FLOAT
description: 'Total number of detected deadlocks in this database per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.deadlocks
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: deadlocks
- tag: database
value: '{#DBNAME}'
trigger_prototypes:
- uuid: d188109b522b4ff896ed08fb04cf5f9d
expression: 'min(/PostgreSQL by Zabbix agent 2 active/pgsql.dbstat.deadlocks.rate["{#DBNAME}"],5m) > {$PG.DEADLOCKS.MAX.WARN:"{#DBNAME}"}'
name: 'PostgreSQL: DB [{#DBNAME}]: Deadlock occurred'
event_name: 'PostgreSQL: DB [{#DBNAME}]: Deadlock occurred (over {$PG.DEADLOCKS.MAX.WARN:"{#DBNAME}"} in 5m)'
priority: HIGH
description: 'Number of deadlocks detected per second exceeds {$PG.DEADLOCKS.MAX.WARN:"{#DBNAME}"} for 5m.'
tags:
- tag: scope
value: availability
- uuid: 02c15c6f80e644269e14e5047f07efb1
name: 'DB [{#DBNAME}]: Get dbstat'
type: DEPENDENT
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
delay: '0'
history: '0'
value_type: TEXT
trends: '0'
description: 'Get dbstat metrics for database "{#DBNAME}".'
preprocessing:
- type: JSONPATH
parameters:
- '$[''{#DBNAME}'']'
error_handler: DISCARD_VALUE
master_item:
key: 'pgsql.dbstat["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: raw
- tag: database
value: '{#DBNAME}'
- uuid: 2e8648e519524533b430bdf863561ba4
name: 'DB [{#DBNAME}]: Backends connected'
type: DEPENDENT
key: 'pgsql.dbstat.numbackends["{#DBNAME}"]'
delay: '0'
description: 'Number of backends currently connected to this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.numbackends
master_item:
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: backends
- tag: database
value: '{#DBNAME}'
- uuid: d2a01165e7c24969b26cdebe42f53c39
name: 'DB [{#DBNAME}]: Temp_bytes written per second'
type: DEPENDENT
key: 'pgsql.dbstat.temp_bytes.rate["{#DBNAME}"]'
delay: '0'
units: B
description: 'Total amount of data written to temporary files by queries in this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.temp_bytes
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: storage
- tag: database
value: '{#DBNAME}'
- uuid: 74dc57aaeba74b599cda10817961d5da
name: 'DB [{#DBNAME}]: Temp_files created per second'
type: DEPENDENT
key: 'pgsql.dbstat.temp_files.rate["{#DBNAME}"]'
delay: '0'
description: 'Total number of temporary files created by queries in this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.temp_files
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: storage
- tag: database
value: '{#DBNAME}'
- uuid: ec42f02be51b49789d1ad1fc3d636be4
name: 'DB [{#DBNAME}]: Tuples deleted per second'
type: DEPENDENT
key: 'pgsql.dbstat.tup_deleted.rate["{#DBNAME}"]'
delay: '0'
value_type: FLOAT
description: 'Total number of rows deleted by queries in this database per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.tup_deleted
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: queries
- tag: database
value: '{#DBNAME}'
- uuid: ffa697ab71734806aac1102c7d133521
name: 'DB [{#DBNAME}]: Tuples fetched per second'
type: DEPENDENT
key: 'pgsql.dbstat.tup_fetched.rate["{#DBNAME}"]'
delay: '0'
value_type: FLOAT
description: 'Total number of rows fetched by queries in this database per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.tup_fetched
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: queries
- tag: database
value: '{#DBNAME}'
- uuid: 8fe771d00b5648758c0d568cb1d7b207
name: 'DB [{#DBNAME}]: Tuples inserted per second'
type: DEPENDENT
key: 'pgsql.dbstat.tup_inserted.rate["{#DBNAME}"]'
delay: '0'
value_type: FLOAT
description: 'Total number of rows inserted by queries in this database per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.tup_inserted
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: queries
- tag: database
value: '{#DBNAME}'
- uuid: aeb15898d242406393108df7bfd52881
name: 'DB [{#DBNAME}]: Tuples returned per second'
type: DEPENDENT
key: 'pgsql.dbstat.tup_returned.rate["{#DBNAME}"]'
delay: '0'
value_type: FLOAT
description: 'Number of rows returned by queries in this database per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.tup_returned
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: queries
- tag: database
value: '{#DBNAME}'
- uuid: 22dee9fb2db8478caf1fd83f415414ef
name: 'DB [{#DBNAME}]: Tuples updated per second'
type: DEPENDENT
key: 'pgsql.dbstat.tup_updated.rate["{#DBNAME}"]'
delay: '0'
value_type: FLOAT
description: 'Total number of rows updated by queries in this database per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.tup_updated
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: queries
- tag: database
value: '{#DBNAME}'
- uuid: 2bfdd988bca74df5a31dbf3727aa10a0
name: 'DB [{#DBNAME}]: Commits per second'
type: DEPENDENT
key: 'pgsql.dbstat.xact_commit.rate["{#DBNAME}"]'
delay: '0'
value_type: FLOAT
description: 'Number of transactions in this database that have been committed per second.'
preprocessing:
- type: JSONPATH
parameters:
- $.xact_commit
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: transactions
- tag: database
value: '{#DBNAME}'
- uuid: b7edf603e83a48bca580e932fc87c5cf
name: 'DB [{#DBNAME}]: Rollbacks per second'
type: DEPENDENT
key: 'pgsql.dbstat.xact_rollback.rate["{#DBNAME}"]'
delay: '0'
value_type: FLOAT
description: 'Total number of transactions in this database that have been rolled back.'
preprocessing:
- type: JSONPATH
parameters:
- $.xact_rollback
- type: CHANGE_PER_SECOND
parameters:
- ''
master_item:
key: 'pgsql.dbstat.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: transactions
- tag: database
value: '{#DBNAME}'
- uuid: af381c8bd21c4189b6b8230325c97358
name: 'DB [{#DBNAME}]: Num of accessexclusive locks'
type: DEPENDENT
key: 'pgsql.locks.accessexclusive["{#DBNAME}"]'
delay: '0'
description: 'Number of accessexclusive locks for this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.accessexclusive
master_item:
key: 'pgsql.locks.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: locks
- tag: database
value: '{#DBNAME}'
- uuid: fe133b91b9a3474ab5ed12055c277969
name: 'DB [{#DBNAME}]: Num of accessshare locks'
type: DEPENDENT
key: 'pgsql.locks.accessshare["{#DBNAME}"]'
delay: '0'
description: 'Number of accessshare locks for this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.accessshare
master_item:
key: 'pgsql.locks.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: locks
- tag: database
value: '{#DBNAME}'
- uuid: 3a28968abd5945cebb1157ae74e2de7d
name: 'DB [{#DBNAME}]: Num of exclusive locks'
type: DEPENDENT
key: 'pgsql.locks.exclusive["{#DBNAME}"]'
delay: '0'
description: 'Number of exclusive locks for this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.exclusive
master_item:
key: 'pgsql.locks.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: locks
- tag: database
value: '{#DBNAME}'
- uuid: ce03b994ad894100a11816b043d84c23
name: 'DB [{#DBNAME}]: Get locks'
type: DEPENDENT
key: 'pgsql.locks.get_metrics["{#DBNAME}"]'
delay: '0'
history: '0'
value_type: TEXT
trends: '0'
description: 'Get locks metrics for database "{#DBNAME}".'
preprocessing:
- type: JSONPATH
parameters:
- '$[''{#DBNAME}'']'
error_handler: DISCARD_VALUE
master_item:
key: 'pgsql.locks["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: component
value: raw
- tag: database
value: '{#DBNAME}'
- uuid: 8bb0fe1e02ef4ad19f4367dbc67e9bc0
name: 'DB [{#DBNAME}]: Num of rowexclusive locks'
type: DEPENDENT
key: 'pgsql.locks.rowexclusive["{#DBNAME}"]'
delay: '0'
description: 'Number of rowexclusive locks for this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.rowexclusive
master_item:
key: 'pgsql.locks.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: locks
- tag: database
value: '{#DBNAME}'
- uuid: 9821b111e1e741a592c962c503129eae
name: 'DB [{#DBNAME}]: Num of rowshare locks'
type: DEPENDENT
key: 'pgsql.locks.rowshare["{#DBNAME}"]'
delay: '0'
description: 'Number of rowshare locks for this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.rowshare
error_handler: DISCARD_VALUE
master_item:
key: 'pgsql.locks.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: locks
- tag: database
value: '{#DBNAME}'
- uuid: 94b2491b18d74345b5bd33a523049cbf
name: 'DB [{#DBNAME}]: Num of sharerowexclusive locks'
type: DEPENDENT
key: 'pgsql.locks.sharerowexclusive["{#DBNAME}"]'
delay: '0'
description: 'Number of total sharerowexclusive for this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.sharerowexclusive
master_item:
key: 'pgsql.locks.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: locks
- tag: database
value: '{#DBNAME}'
- uuid: 888f4f0f47b54d708d87b22efa25f0e5
name: 'DB [{#DBNAME}]: Num of shareupdateexclusive locks'
type: DEPENDENT
key: 'pgsql.locks.shareupdateexclusive["{#DBNAME}"]'
delay: '0'
description: 'Number of shareupdateexclusive locks for this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.shareupdateexclusive
master_item:
key: 'pgsql.locks.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: locks
- tag: database
value: '{#DBNAME}'
- uuid: 70abd9b269f94310875c1777c089741b
name: 'DB [{#DBNAME}]: Num of share locks'
type: DEPENDENT
key: 'pgsql.locks.share["{#DBNAME}"]'
delay: '0'
description: 'Number of share locks for this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.share
master_item:
key: 'pgsql.locks.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: locks
- tag: database
value: '{#DBNAME}'
- uuid: 19d118b8a99845ef8d2eaaa5ec38f50d
name: 'DB [{#DBNAME}]: Num of locks total'
type: DEPENDENT
key: 'pgsql.locks.total["{#DBNAME}"]'
delay: '0'
description: 'Total number of locks in this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.total
master_item:
key: 'pgsql.locks.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: locks
- tag: database
value: '{#DBNAME}'
- uuid: 15cf79b8fafa442a80a10368f5b5962d
name: 'DB [{#DBNAME}]: Get queries'
type: DEPENDENT
key: 'pgsql.queries.get_metrics["{#DBNAME}"]'
delay: '0'
history: '0'
value_type: TEXT
trends: '0'
description: 'Get queries metrics for database "{#DBNAME}".'
preprocessing:
- type: JSONPATH
parameters:
- '$[''{#DBNAME}'']'
error_handler: DISCARD_VALUE
master_item:
key: 'pgsql.queries["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}","{$PG.QUERY_ETIME.MAX.WARN}"]'
tags:
- tag: component
value: raw
- tag: database
value: '{#DBNAME}'
- uuid: f8c0e60c70d14103b39b1a6218093c0a
name: 'DB [{#DBNAME}]: Queries slow maintenance count'
type: DEPENDENT
key: 'pgsql.queries.mro.slow_count["{#DBNAME}"]'
delay: '0'
description: 'Slow maintenance query count for this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.mro_slow_count
master_item:
key: 'pgsql.queries.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: queries
- tag: database
value: '{#DBNAME}'
- uuid: 8d16b715b12648f5b5dca0f80857e46e
name: 'DB [{#DBNAME}]: Queries max maintenance time'
type: DEPENDENT
key: 'pgsql.queries.mro.time_max["{#DBNAME}"]'
delay: '0'
units: s
description: 'Max maintenance query time for this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.mro_time_max
master_item:
key: 'pgsql.queries.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: queries
- tag: database
value: '{#DBNAME}'
- uuid: af2c1c09b2a04911b2e6e892d1051e94
name: 'DB [{#DBNAME}]: Queries sum maintenance time'
type: DEPENDENT
key: 'pgsql.queries.mro.time_sum["{#DBNAME}"]'
delay: '0'
units: s
description: 'Sum maintenance query time for this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.mro_time_sum
master_item:
key: 'pgsql.queries.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: queries
- tag: database
value: '{#DBNAME}'
- uuid: bd070ec5cbcf42a7a2dfa56dd3eca7a3
name: 'DB [{#DBNAME}]: Queries slow query count'
type: DEPENDENT
key: 'pgsql.queries.query.slow_count["{#DBNAME}"]'
delay: '0'
description: 'Slow query count for this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.query_slow_count
master_item:
key: 'pgsql.queries.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: queries
- tag: database
value: '{#DBNAME}'
trigger_prototypes:
- uuid: be059c5eb7b6442b8312ef58b2bc55cc
expression: 'min(/PostgreSQL by Zabbix agent 2 active/pgsql.queries.query.slow_count["{#DBNAME}"],5m)>{$PG.SLOW_QUERIES.MAX.WARN:"{#DBNAME}"}'
name: 'PostgreSQL: DB [{#DBNAME}]: Too many slow queries'
event_name: 'PostgreSQL: DB [{#DBNAME}]: Too many slow queries (over {$PG.SLOW_QUERIES.MAX.WARN:"{#DBNAME}"} in 5m)'
priority: WARNING
description: 'The number of detected slow queries exceeds the limit of {$PG.SLOW_QUERIES.MAX.WARN:"{#DBNAME}"}.'
tags:
- tag: scope
value: performance
- uuid: 827abbb549b640f28a7984ba157de73e
name: 'DB [{#DBNAME}]: Queries max query time'
type: DEPENDENT
key: 'pgsql.queries.query.time_max["{#DBNAME}"]'
delay: '0'
units: s
description: 'Max query time for this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.query_time_max
master_item:
key: 'pgsql.queries.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: queries
- tag: database
value: '{#DBNAME}'
- uuid: 93a773701de54ce3a3af3d651167c0a9
name: 'DB [{#DBNAME}]: Queries sum query time'
type: DEPENDENT
key: 'pgsql.queries.query.time_sum["{#DBNAME}"]'
delay: '0'
units: s
description: 'Sum query time for this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.query_time_sum
master_item:
key: 'pgsql.queries.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: queries
- tag: database
value: '{#DBNAME}'
- uuid: ee6fb28b33424ffab8e336280cfe5d7e
name: 'DB [{#DBNAME}]: Queries slow transaction count'
type: DEPENDENT
key: 'pgsql.queries.tx.slow_count["{#DBNAME}"]'
delay: '0'
description: 'Slow transaction query count for this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.tx_slow_count
master_item:
key: 'pgsql.queries.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: queries
- tag: database
value: '{#DBNAME}'
- uuid: 73c67fc53f944fb6a15c0e0776ba4cf3
name: 'DB [{#DBNAME}]: Queries max transaction time'
type: DEPENDENT
key: 'pgsql.queries.tx.time_max["{#DBNAME}"]'
delay: '0'
units: s
description: 'Max transaction query time for this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.tx_time_max
master_item:
key: 'pgsql.queries.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: queries
- tag: database
value: '{#DBNAME}'
- uuid: 62771b2b28f94f93b54ea5e31f336938
name: 'DB [{#DBNAME}]: Queries sum transaction time'
type: DEPENDENT
key: 'pgsql.queries.tx.time_sum["{#DBNAME}"]'
delay: '0'
units: s
description: 'Sum transaction query time for this database.'
preprocessing:
- type: JSONPATH
parameters:
- $.tx_time_sum
master_item:
key: 'pgsql.queries.get_metrics["{#DBNAME}"]'
tags:
- tag: component
value: queries
- tag: database
value: '{#DBNAME}'
graph_prototypes:
- uuid: 2c0fea3adf254d41b123fb69202c51fe
name: 'DB [{#DBNAME}]: Locks'
graph_items:
- drawtype: GRADIENT_LINE
color: 199C0D
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.locks.total["{#DBNAME}"]'
- sortorder: '1'
color: F63100
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.locks.accessexclusive["{#DBNAME}"]'
- sortorder: '2'
color: 00611C
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.locks.accessshare["{#DBNAME}"]'
- sortorder: '3'
color: F7941D
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.locks.exclusive["{#DBNAME}"]'
- sortorder: '4'
color: FC6EA3
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.locks.rowexclusive["{#DBNAME}"]'
- sortorder: '5'
color: 6C59DC
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.locks.rowshare["{#DBNAME}"]'
- sortorder: '6'
color: C7A72D
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.locks.sharerowexclusive["{#DBNAME}"]'
- sortorder: '7'
color: BA2A5D
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.locks.shareupdateexclusive["{#DBNAME}"]'
- sortorder: '8'
color: F230E0
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.locks.share["{#DBNAME}"]'
- uuid: 96144801ca8a4c02ac88c49f0fb4eb7c
name: 'DB [{#DBNAME}]: Number of bloating tables'
graph_items:
- drawtype: GRADIENT_LINE
color: 199C0D
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.db.bloating_tables["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]'
- uuid: 55268d2bc7224902836b8ec683b82865
name: 'DB [{#DBNAME}]: pg_stat_database metrics'
graph_items:
- color: 199C0D
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.dbstat.blks_hit.rate["{#DBNAME}"]'
- sortorder: '1'
color: F63100
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.dbstat.blks_read.rate["{#DBNAME}"]'
- sortorder: '2'
color: 00611C
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.dbstat.conflicts.rate["{#DBNAME}"]'
- sortorder: '3'
color: F7941D
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.dbstat.deadlocks.rate["{#DBNAME}"]'
- sortorder: '4'
color: FC6EA3
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.dbstat.temp_bytes.rate["{#DBNAME}"]'
- sortorder: '5'
color: 6C59DC
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.dbstat.temp_files.rate["{#DBNAME}"]'
- sortorder: '6'
color: C7A72D
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.dbstat.tup_deleted.rate["{#DBNAME}"]'
- sortorder: '7'
color: BA2A5D
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.dbstat.tup_fetched.rate["{#DBNAME}"]'
- sortorder: '8'
color: F230E0
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.dbstat.tup_inserted.rate["{#DBNAME}"]'
- sortorder: '9'
color: 5CCD18
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.dbstat.tup_returned.rate["{#DBNAME}"]'
- sortorder: '10'
color: BB2A02
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.dbstat.tup_updated.rate["{#DBNAME}"]'
- sortorder: '11'
color: AC41A5
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.dbstat.xact_commit.rate["{#DBNAME}"]'
- sortorder: '12'
color: 89ABF8
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.dbstat.xact_rollback.rate["{#DBNAME}"]'
- uuid: 7d0246026bae4e6680f19626fba2bc02
name: 'DB [{#DBNAME}]: Queries'
ymin_type_1: FIXED
graph_items:
- color: 199C0D
yaxisside: RIGHT
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.queries.mro.time_max["{#DBNAME}"]'
- sortorder: '1'
color: F63100
yaxisside: RIGHT
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.queries.query.time_max["{#DBNAME}"]'
- sortorder: '2'
color: 00611C
yaxisside: RIGHT
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.queries.tx.time_max["{#DBNAME}"]'
- sortorder: '3'
drawtype: GRADIENT_LINE
color: F7941D
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.queries.mro.time_sum["{#DBNAME}"]'
- sortorder: '4'
drawtype: GRADIENT_LINE
color: FC6EA3
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.queries.query.time_sum["{#DBNAME}"]'
- sortorder: '5'
drawtype: GRADIENT_LINE
color: 6C59DC
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.queries.tx.time_sum["{#DBNAME}"]'
- uuid: 9a4b7b68ae0f4291a970e3e1838368c6
name: 'DB [{#DBNAME}]: Size'
graph_items:
- drawtype: GRADIENT_LINE
color: 199C0D
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.db.size["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]'
- uuid: 31c3e16c49ba486db9f6f92714d927b6
name: 'DB [{#DBNAME}]: Slow queries'
ymin_type_1: FIXED
graph_items:
- color: 199C0D
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.queries.mro.slow_count["{#DBNAME}"]'
- sortorder: '1'
color: F63100
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.queries.query.slow_count["{#DBNAME}"]'
- sortorder: '2'
color: 00611C
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.queries.tx.slow_count["{#DBNAME}"]'
- uuid: 92ba6c1b038a454d8d8d40399d0967d8
name: 'Replication discovery'
type: ZABBIX_ACTIVE
key: 'pgsql.replication.process.discovery["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
delay: 15m
filter:
evaltype: AND
conditions:
- macro: '{#APPLICATION_NAME}'
value: '{$PG.LLD.FILTER.APPLICATION}'
formulaid: A
description: 'Discovers replication lag metrics.'
item_prototypes:
- uuid: 7d994bb6b0de4f76810e4beaf9c6318c
name: 'Application [{#APPLICATION_NAME}]: Get replication'
type: DEPENDENT
key: 'pgsql.replication.get_metrics["{#APPLICATION_NAME}"]'
delay: '0'
history: '0'
value_type: TEXT
trends: '0'
description: 'Collect metrics from the "pg_stat_replication" about the application "{#APPLICATION_NAME}" that is connected to this WAL sender, which contains information about the WAL sender process, showing statistics about replication to that sender''s connected standby server.'
preprocessing:
- type: JSONPATH
parameters:
- '$[''{#APPLICATION_NAME}'']'
error_handler: DISCARD_VALUE
master_item:
key: 'pgsql.replication.process["{$PG.CONNSTRING.AGENT2}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}"]'
tags:
- tag: application
value: '{#APPLICATION_NAME}'
- tag: component
value: raw
- uuid: 33541a2ce9894c71aef710d1e227dab2
name: 'Application [{#APPLICATION_NAME}]: Replication flush lag'
type: DEPENDENT
key: 'pgsql.replication.process.flush_lag["{#APPLICATION_NAME}"]'
delay: '0'
value_type: FLOAT
units: s
preprocessing:
- type: JSONPATH
parameters:
- $.flush_lag
master_item:
key: 'pgsql.replication.get_metrics["{#APPLICATION_NAME}"]'
tags:
- tag: application
value: '{#APPLICATION_NAME}'
- tag: component
value: replication
- uuid: 4ef7353e3b904f33ac2b592d5cbfba62
name: 'Application [{#APPLICATION_NAME}]: Replication replay lag'
type: DEPENDENT
key: 'pgsql.replication.process.replay_lag["{#APPLICATION_NAME}"]'
delay: '0'
value_type: FLOAT
units: s
preprocessing:
- type: JSONPATH
parameters:
- $.replay_lag
master_item:
key: 'pgsql.replication.get_metrics["{#APPLICATION_NAME}"]'
tags:
- tag: application
value: '{#APPLICATION_NAME}'
- tag: component
value: replication
- uuid: 3beb600f296c4263b92434a46bd946cd
name: 'Application [{#APPLICATION_NAME}]: Replication write lag'
type: DEPENDENT
key: 'pgsql.replication.process.write_lag["{#APPLICATION_NAME}"]'
delay: '0'
value_type: FLOAT
units: s
preprocessing:
- type: JSONPATH
parameters:
- $.write_lag
master_item:
key: 'pgsql.replication.get_metrics["{#APPLICATION_NAME}"]'
tags:
- tag: application
value: '{#APPLICATION_NAME}'
- tag: component
value: replication
graph_prototypes:
- uuid: 3942169cc1eb4715a5f2ca0ee58c33df
name: 'Application [{#APPLICATION_NAME}]: Replication lag'
graph_items:
- color: 199C0D
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.replication.process.flush_lag["{#APPLICATION_NAME}"]'
- sortorder: '1'
color: F63100
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.replication.process.replay_lag["{#APPLICATION_NAME}"]'
- sortorder: '2'
color: 00611C
item:
host: 'PostgreSQL by Zabbix agent 2 active'
key: 'pgsql.replication.process.write_lag["{#APPLICATION_NAME}"]'
tags:
- tag: class
value: database
- tag: target
value: postgresql
macros:
- macro: '{$PG.CONFLICTS.MAX.WARN}'
value: '0'
description: 'Maximum number of recovery conflicts for trigger expression.'
- macro: '{$PG.CONNSTRING.AGENT2}'
value: 'tcp://localhost:5432'
description: 'URI or named session of the PostgreSQL instance.'
- macro: '{$PG.CONN_TOTAL_PCT.MAX.WARN}'
value: '90'
description: 'Maximum percentage of current connections for trigger expression.'
- macro: '{$PG.DATABASE}'
value: postgres
description: 'Default PostgreSQL database for the connection.'
- macro: '{$PG.DEADLOCKS.MAX.WARN}'
value: '0'
description: 'Maximum number of detected deadlocks for trigger expression.'
- macro: '{$PG.LLD.FILTER.APPLICATION}'
value: .+
description: 'Filter of discoverable applications.'
- macro: '{$PG.LLD.FILTER.DBNAME}'
value: .+
description: 'Filter of discoverable databases.'
- macro: '{$PG.PASSWORD}'
value: '<Put the password here>'
description: 'PostgreSQL user password.'
- macro: '{$PG.QUERY_ETIME.MAX.WARN}'
value: '30'
description: 'Execution time limit for count of slow queries.'
- macro: '{$PG.SLOW_QUERIES.MAX.WARN}'
value: '5'
description: 'Slow queries count threshold for a trigger.'
- macro: '{$PG.USER}'
value: zbx_monitor
description: 'PostgreSQL username.'
dashboards:
- uuid: ee3e7ee2f7de495997f4749a23f00f48
name: 'PostgreSQL databases'
pages:
- widgets:
- type: graphprototype
width: '36'
height: '5'
fields:
- type: INTEGER
name: columns
value: '1'
- type: GRAPH_PROTOTYPE
name: graphid.0
value:
host: 'PostgreSQL by Zabbix agent 2 active'
name: 'DB [{#DBNAME}]: pg_stat_database metrics'
- type: STRING
name: reference
value: AAAAA
- type: graphprototype
'y': '5'
width: '36'
height: '5'
fields:
- type: INTEGER
name: columns
value: '1'
- type: GRAPH_PROTOTYPE
name: graphid.0
value:
host: 'PostgreSQL by Zabbix agent 2 active'
name: 'DB [{#DBNAME}]: Size'
- type: STRING
name: reference
value: AAAAC
- type: graphprototype
'y': '10'
width: '36'
height: '5'
fields:
- type: INTEGER
name: columns
value: '1'
- type: GRAPH_PROTOTYPE
name: graphid.0
value:
host: 'PostgreSQL by Zabbix agent 2 active'
name: 'DB [{#DBNAME}]: Queries'
- type: STRING
name: reference
value: AAAAE
- type: graphprototype
x: '36'
width: '36'
height: '5'
fields:
- type: INTEGER
name: columns
value: '1'
- type: GRAPH_PROTOTYPE
name: graphid.0
value:
host: 'PostgreSQL by Zabbix agent 2 active'
name: 'DB [{#DBNAME}]: Locks'
- type: STRING
name: reference
value: AAAAB
- type: graphprototype
x: '36'
'y': '5'
width: '36'
height: '5'
fields:
- type: INTEGER
name: columns
value: '1'
- type: GRAPH_PROTOTYPE
name: graphid.0
value:
host: 'PostgreSQL by Zabbix agent 2 active'
name: 'DB [{#DBNAME}]: Number of bloating tables'
- type: STRING
name: reference
value: AAAAD
- type: graphprototype
x: '36'
'y': '10'
width: '36'
height: '5'
fields:
- type: INTEGER
name: columns
value: '1'
- type: GRAPH_PROTOTYPE
name: graphid.0
value:
host: 'PostgreSQL by Zabbix agent 2 active'
name: 'DB [{#DBNAME}]: Slow queries'
- type: STRING
name: reference
value: AAAAF
valuemaps:
- uuid: 9b9961c136c4426bb6d11c749cbb4cfa
name: 'PostgreSQL checksum failure status'
mappings:
- value: '-2'
newvalue: 'null'
- uuid: bf1b2c09ce844d9c8b2735901fe77a03
name: 'PostgreSQL recovery role'
mappings:
- value: '0'
newvalue: Master
- value: '1'
newvalue: Standby
- uuid: ee126cb6f7e14a93ae1e21106ee8732f
name: 'PostgreSQL replication status'
mappings:
- value: '0'
newvalue: Down
- value: '1'
newvalue: Up
- value: '2'
newvalue: Master
- uuid: e11dca50f6e4481fa1fda75aeb71cf8c
name: 'Service state'
mappings:
- value: '0'
newvalue: Down
- value: '1'
newvalue: Up