Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Fayantsev <anton.fayantsev@zabbix.com>2021-01-15 18:14:44 +0300
committerAnton Fayantsev <anton.fayantsev@zabbix.com>2021-01-15 18:14:44 +0300
commit9e86219c50d11ca78df10642459702515910021f (patch)
tree3aad9c717bd733ba5fc71c05533b0cc538cdd701 /templates
parent98cb9ce82748929b0ddcaf78f4133edd333ee995 (diff)
parentcacc5f6161ad74b06abeac453dc65efdcec79bcc (diff)
.........T [ZBXCTR-13] updated template and readme
* commit 'cacc5f6161ad74b06abeac453dc65efdcec79bcc': .........T [ZBXCTR-13] added ChangeLog entry .........T [ZBXCTR-13] updated template and readme
Diffstat (limited to 'templates')
-rw-r--r--templates/db/postgresql_agent2/README.md21
-rw-r--r--templates/db/postgresql_agent2/template_db_postgresql_agent2.xml5131
2 files changed, 2652 insertions, 2500 deletions
diff --git a/templates/db/postgresql_agent2/README.md b/templates/db/postgresql_agent2/README.md
index 6c2eabf977b..4461491483e 100644
--- a/templates/db/postgresql_agent2/README.md
+++ b/templates/db/postgresql_agent2/README.md
@@ -50,7 +50,9 @@ No specific Zabbix configuration is required.
|----|-----------|-------|
|{$PG.CONFLICTS.MAX.WARN} |<p>-</p> |`0` |
|{$PG.CONN_TOTAL_PCT.MAX.WARN} |<p>-</p> |`90` |
+|{$PG.DATABASE} |<p>-</p> |`postgres` |
|{$PG.DEADLOCKS.MAX.WARN} |<p>-</p> |`0` |
+|{$PG.LLD.FILTER.APPLICATION} |<p>-</p> |`(.+)` |
|{$PG.LLD.FILTER.DBNAME} |<p>-</p> |`(.+)` |
|{$PG.PASSWORD} |<p>-</p> |`postgres` |
|{$PG.URI} |<p>-</p> |`tcp://localhost:5432` |
@@ -64,12 +66,14 @@ There are no template links in this template.
|Name|Description|Type|Key and additional info|
|----|-----------|----|----|
+|Replication Discovery |<p>-</p> |ZABBIX_PASSIVE |pgsql.replication.process.discovery["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]<p>**Filter**:</p>AND <p>- A: {#APPLICATION} MATCHES_REGEX `{$PG.LLD.FILTER.APPLICATION}`</p> |
|Database discovery |<p>-</p> |ZABBIX_PASSIVE |pgsql.db.discovery["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]<p>**Filter**:</p>AND <p>- A: {#DBNAME} MATCHES_REGEX `{$PG.LLD.FILTER.DBNAME}`</p> |
## Items collected
|Group|Name|Description|Type|Key and additional info|
|-----|----|-----------|----|---------------------|
+|PostgreSQL |PostgreSQL: Custom queries |<p>Execute custom queries from file *.sql</p> |ZABBIX_PASSIVE |pgsql.custom.query["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}",""] |
|PostgreSQL |WAL: Bytes written |<p>WAL write in bytes</p> |DEPENDENT |pgsql.wal.write<p>**Preprocessing**:</p><p>- JSONPATH: `$.write`</p><p>- CHANGE_PER_SECOND |
|PostgreSQL |WAL: Segments count |<p>Number of WAL segments</p> |DEPENDENT |pgsql.wal.count<p>**Preprocessing**:</p><p>- JSONPATH: `$.write`</p> |
|PostgreSQL |Bgwriter: Buffers allocated |<p>Number of buffers allocated</p> |DEPENDENT |pgsql.bgwriter.buffers_alloc.rate<p>**Preprocessing**:</p><p>- JSONPATH: `$.buffers_alloc`</p><p>- CHANGE_PER_SECOND |
@@ -81,7 +85,8 @@ There are no template links in this template.
|PostgreSQL |Checkpoint: By timeout |<p>Number of scheduled checkpoints that have been performed</p> |DEPENDENT |pgsql.bgwriter.checkpoints_timed.rate<p>**Preprocessing**:</p><p>- JSONPATH: `$.checkpoints_timed`</p><p>- CHANGE_PER_SECOND |
|PostgreSQL |Checkpoint: Requested |<p>Number of requested checkpoints that have been performed</p> |DEPENDENT |pgsql.bgwriter.checkpoints_req.rate<p>**Preprocessing**:</p><p>- JSONPATH: `$.checkpoints_req`</p><p>- CHANGE_PER_SECOND |
|PostgreSQL |Checkpoint: Checkpoint write time |<p>Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk, in milliseconds</p> |DEPENDENT |pgsql.bgwriter.checkpoint_write_time.rate<p>**Preprocessing**:</p><p>- JSONPATH: `$.checkpoint_write_time`</p><p>- MULTIPLIER: `0.001`</p><p>- CHANGE_PER_SECOND |
-|PostgreSQL |Checkpoint: Checkpoint sync time |<p>Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk</p> |DEPENDENT |pgsql.bgwriter.sync_time.rate<p>**Preprocessing**:</p><p>- JSONPATH: `$.sync_time`</p><p>- MULTIPLIER: `0.001`</p><p>- CHANGE_PER_SECOND |
+|PostgreSQL |Checkpoint: Checkpoint write time |<p>Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk, in milliseconds</p> |DEPENDENT |pgsql.bgwriter.checkpoint_sync_time.rate<p>**Preprocessing**:</p><p>- JSONPATH: `$.checkpoint_sync_time`</p><p>- MULTIPLIER: `0.001`</p><p>- CHANGE_PER_SECOND |
+|PostgreSQL |Checkpoint: Checkpoint sync time |<p>Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk</p> |DEPENDENT |pgsql.bgwriter.checkpoint_sync_time.rate<p>**Preprocessing**:</p><p>- JSONPATH: `$.checkpoint_sync_time`</p><p>- MULTIPLIER: `0.001`</p><p>- CHANGE_PER_SECOND |
|PostgreSQL |Archive: Count of archive files |<p>Collect all metrics from pg_stat_activity</p><p>https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-ARCHIVER-VIEW</p> |DEPENDENT |pgsql.archive.count_archived_files<p>**Preprocessing**:</p><p>- JSONPATH: `$.archived_count`</p> |
|PostgreSQL |Archive: Count of attempts to archive files |<p>Collect all metrics from pg_stat_activity</p><p>https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-ARCHIVER-VIEW</p> |DEPENDENT |pgsql.archive.failed_trying_to_archive<p>**Preprocessing**:</p><p>- JSONPATH: `$.failed_count`</p> |
|PostgreSQL |Archive: Count of files in archive_status need to archive |<p>-</p> |DEPENDENT |pgsql.archive.count_files_to_archive<p>**Preprocessing**:</p><p>- JSONPATH: `$.count_files`</p> |
@@ -113,9 +118,9 @@ There are no template links in this template.
|PostgreSQL |Connections sum: Waiting |<p>Total number of waiting connections</p><p>https://www.postgresql.org/docs/current/monitoring-stats.html#WAIT-EVENT-TABLE</p> |DEPENDENT |pgsql.connections.waiting<p>**Preprocessing**:</p><p>- JSONPATH: `$.waiting`</p> |
|PostgreSQL |Connections sum: Idle in transaction (aborted) |<p>Total number of connections in a transaction state, but not executing a query and one of the statements in the transaction caused an error.</p> |DEPENDENT |pgsql.connections.idle_in_transaction_aborted<p>**Preprocessing**:</p><p>- JSONPATH: `$.idle_in_transaction_aborted`</p> |
|PostgreSQL |Connections sum: Disabled |<p>Total number of disabled connections</p> |DEPENDENT |pgsql.connections.disabled<p>**Preprocessing**:</p><p>- JSONPATH: `$.disabled`</p> |
-|PostgreSQL |PostgreSQL: Age of oldest xid |<p>Age of oldest xid.</p> |ZABBIX_PASSIVE |pgsql.oldest.xid["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"] |
+|PostgreSQL |PostgreSQL: Age of oldest xid |<p>Age of oldest xid.</p> |ZABBIX_PASSIVE |pgsql.oldest.xid["{$PG.URI}","{$PG.USER}"] |
|PostgreSQL |Autovacuum: Count of autovacuum workers |<p>Number of autovacuum workers.</p> |ZABBIX_PASSIVE |pgsql.autovacuum.count["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"] |
-|PostgreSQL |PostgreSQL: Cache hit |<p>-</p> |ZABBIX_PASSIVE |pgsql.cache.hit["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"] |
+|PostgreSQL |PostgreSQL: Cache hit |<p>-</p> |ZABBIX_PASSIVE |pgsql.cache.hit["{$PG.URI}"] |
|PostgreSQL |PostgreSQL: Uptime |<p>-</p> |ZABBIX_PASSIVE |pgsql.uptime["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"] |
|PostgreSQL |Replication: Lag in bytes |<p>Replication lag with Master in byte.</p> |ZABBIX_PASSIVE |pgsql.replication.lag.b["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"] |
|PostgreSQL |Replication: Lag in seconds |<p>Replication lag with Master in seconds.</p> |ZABBIX_PASSIVE |pgsql.replication.lag.sec["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"] |
@@ -123,8 +128,11 @@ There are no template links in this template.
|PostgreSQL |Replication: Standby count |<p>Number of standby servers</p> |ZABBIX_PASSIVE |pgsql.replication.count["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"] |
|PostgreSQL |Replication: Status |<p>Replication status: 0 — streaming is down, 1 — streaming is up, 2 — master mode</p> |ZABBIX_PASSIVE |pgsql.replication.status["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"] |
|PostgreSQL |PostgreSQL: Ping |<p>-</p> |ZABBIX_PASSIVE |pgsql.ping["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]<p>**Preprocessing**:</p><p>- DISCARD_UNCHANGED_HEARTBEAT: `1h`</p> |
+|PostgreSQL |Application {#APPLICATION}: Replication flush lag | |DEPENDENT |pgsql.replication.process.flush_lag["{#APPLICATION}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$['{#APPLICATION}'].flush_lag`</p> |
+|PostgreSQL |Application {#APPLICATION}: Replication replay lag | |DEPENDENT |pgsql.replication.process.replay_lag["{#APPLICATION}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$['{#APPLICATION}'].replay_lag`</p> |
+|PostgreSQL |Application {#APPLICATION}: Replication write lag | |DEPENDENT |pgsql.replication.process.write_lag["{#APPLICATION}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$['{#APPLICATION}'].write_lag`</p> |
|PostgreSQL |DB {#DBNAME}: Database age |<p>Database age</p> |ZABBIX_PASSIVE |pgsql.db.age["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"] |
-|PostgreSQL |DB {#DBNAME}: Get bloating tables |<p>Number of bloating tables</p> |ZABBIX_PASSIVE |pgsql.db.bloating_tables["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"] |
+|PostgreSQL |DB {#DBNAME}: Get bloating tables |<p>Number оf bloating tables</p> |ZABBIX_PASSIVE |pgsql.db.bloating_tables["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"] |
|PostgreSQL |DB {#DBNAME}: Database size |<p>Database size</p> |ZABBIX_PASSIVE |pgsql.db.size["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"] |
|PostgreSQL |DB {#DBNAME}: Blocks hit per second |<p>Total number of times disk blocks were found already in the buffer cache, so that a read was not necessary</p> |DEPENDENT |pgsql.dbstat.blks_hit.rate["{#DBNAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$['{#DBNAME}'].blks_hit`</p><p>- CHANGE_PER_SECOND |
|PostgreSQL |DB {#DBNAME}: Disk blocks read per second |<p>Total number of disk blocks read in this database</p> |DEPENDENT |pgsql.dbstat.blks_read.rate["{#DBNAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$['{#DBNAME}'].blks_read`</p><p>- CHANGE_PER_SECOND |
@@ -140,7 +148,7 @@ There are no template links in this template.
|PostgreSQL |DB {#DBNAME}: Commits per second |<p>Number of transactions in this database that have been committed</p> |DEPENDENT |pgsql.dbstat.xact_commit.rate["{#DBNAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$['{#DBNAME}'].xact_commit`</p><p>- CHANGE_PER_SECOND |
|PostgreSQL |DB {#DBNAME}: Rollbacks per second |<p>Total number of transactions in this database that have been rolled back</p> |DEPENDENT |pgsql.dbstat.xact_rollback.rate["{#DBNAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$['{#DBNAME}'].xact_rollback`</p><p>- CHANGE_PER_SECOND |
|PostgreSQL |DB {#DBNAME}: Backends connected |<p>Number of backends currently connected to this database</p> |DEPENDENT |pgsql.dbstat.numbackends["{#DBNAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$['{#DBNAME}'].numbackends`</p> |
-|PostgreSQL |DB {#DBNAME}: Checksum failures |<p>Number of data page checksum failures detected in this database</p> |DEPENDENT |pgsql.dbstat.checksum_failures.rate["{#DBNAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$['{#DBNAME}'].checksum_failures`</p><p>- MATCHES_REGEX: `^\d*$`</p><p>- CHANGE_PER_SECOND |
+|PostgreSQL |DB {#DBNAME}: Checksum failures |<p>Number of data page checksum failures detected in this database</p> |DEPENDENT |pgsql.dbstat.checksum_failures.rate["{#DBNAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$['{#DBNAME}'].checksum_failures`</p><p>- CHANGE_PER_SECOND |
|PostgreSQL |DB {#DBNAME}: Disk blocks read per second |<p>Time spent reading data file blocks by backends, in milliseconds</p> |DEPENDENT |pgsql.dbstat.blk_read_time.rate["{#DBNAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$['{#DBNAME}'].blk_read_time`</p><p>- MULTIPLIER: `0.001`</p><p>- CHANGE_PER_SECOND |
|PostgreSQL |DB {#DBNAME}: Disk blocks read per second |<p>Time spent writing data file blocks by backends, in milliseconds</p> |DEPENDENT |pgsql.dbstat.blk_write_time.rate["{#DBNAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$['{#DBNAME}'].blk_write_time`</p><p>- MULTIPLIER: `0.001`</p><p>- CHANGE_PER_SECOND |
|PostgreSQL |DB {#DBNAME}: Num of accessexclusive locks |<p>Number of accessexclusive locks for each database</p> |DEPENDENT |pgsql.locks.accessexclusive["{#DBNAME}"]<p>**Preprocessing**:</p><p>- JSONPATH: `$['{#DBNAME}'].accessexclusive`</p> |
@@ -159,13 +167,14 @@ There are no template links in this template.
|Zabbix_raw_items |PostgreSQL: Get connections |<p>Collect all metrics from pg_stat_activity</p><p>https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW</p> |ZABBIX_PASSIVE |pgsql.connections["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"] |
|Zabbix_raw_items |PostgreSQL: Get WAL |<p>Collect WAL metrics</p> |ZABBIX_PASSIVE |pgsql.wal.stat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"] |
|Zabbix_raw_items |PostgreSQL: Get locks |<p>Collect all metrics from pg_locks per database</p><p>https://www.postgresql.org/docs/current/explicit-locking.html#LOCKING-TABLES</p> |ZABBIX_PASSIVE |pgsql.locks["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"] |
+|Zabbix_raw_items |PostgreSQL: Get replication |<p>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.</p> |ZABBIX_PASSIVE |pgsql.replication.process["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"] |
## Triggers
|Name|Description|Expression|Severity|Dependencies and additional info|
|----|-----------|----|----|----|
|Connections sum: Total number of connections is too high (over {$PG.CONN_TOTAL_PCT.MAX.WARN} in 5m) |<p>-</p> |`{TEMPLATE_NAME:pgsql.connections.total_pct.min(5m)} > {$PG.CONN_TOTAL_PCT.MAX.WARN}` |AVERAGE | |
-|PostgreSQL: Oldest xid is too big |<p>-</p> |`{TEMPLATE_NAME:pgsql.oldest.xid["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"].last()} > 18000000` |AVERAGE | |
+|PostgreSQL: Oldest xid is too big |<p>-</p> |`{TEMPLATE_NAME:pgsql.oldest.xid["{$PG.URI}","{$PG.USER}"].last()} > 18000000` |AVERAGE | |
|PostgreSQL: Service has been restarted (uptime={ITEM.LASTVALUE}) |<p>-</p> |`{TEMPLATE_NAME:pgsql.uptime["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"].last()} < 600` |AVERAGE | |
|PostgreSQL: Service is down |<p>-</p> |`{TEMPLATE_NAME:pgsql.ping["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"].last()}=0` |HIGH | |
|DB {#DBNAME}: Too many recovery conflicts (over {$PG.CONFLICTS.MAX.WARN:"{#DBNAME}"} in 5m) |<p>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.</p><p>https://www.postgresql.org/docs/current/hot-standby.html#HOT-STANDBY-CONFLICT</p> |`{TEMPLATE_NAME:pgsql.dbstat.conflicts.rate["{#DBNAME}"].min(5m)} > {$PG.CONFLICTS.MAX.WARN:"{#DBNAME}"}` |AVERAGE | |
diff --git a/templates/db/postgresql_agent2/template_db_postgresql_agent2.xml b/templates/db/postgresql_agent2/template_db_postgresql_agent2.xml
index c1ff9c5fc71..32da0f63c78 100644
--- a/templates/db/postgresql_agent2/template_db_postgresql_agent2.xml
+++ b/templates/db/postgresql_agent2/template_db_postgresql_agent2.xml
@@ -1,2506 +1,2649 @@
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
- <version>5.0</version>
- <date>2020-08-13T07:38:24Z</date>
- <groups>
- <group>
- <name>Templates/Databases</name>
- </group>
- </groups>
- <templates>
- <template>
- <template>Template DB PostgreSQL Agent 2</template>
- <name>Template DB PostgreSQL Agent 2</name>
- <description>Template tooling version used: 0.37</description>
- <groups>
- <group>
- <name>Templates/Databases</name>
- </group>
- </groups>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- <application>
- <name>Zabbix raw items</name>
- </application>
- </applications>
- <items>
- <item>
- <name>Archive: Count of archive files</name>
- <type>DEPENDENT</type>
- <key>pgsql.archive.count_archived_files</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Collect all metrics from pg_stat_activity&#13;
+ <version>5.0</version>
+ <date>2021-01-12T12:44:23Z</date>
+ <groups>
+ <group>
+ <name>Templates/Databases</name>
+ </group>
+ </groups>
+ <templates>
+ <template>
+ <template>Template DB PostgreSQL Agent 2</template>
+ <name>Template DB PostgreSQL Agent 2</name>
+ <description>Template tooling version used: 0.38</description>
+ <groups>
+ <group>
+ <name>Templates/Databases</name>
+ </group>
+ </groups>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ <application>
+ <name>Zabbix raw items</name>
+ </application>
+ </applications>
+ <items>
+ <item>
+ <name>Archive: Count of archive files</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.archive.count_archived_files</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Collect all metrics from pg_stat_activity&#13;
https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-ARCHIVER-VIEW</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.archived_count</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.archive["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Archive: Count of files in archive_status need to archive</name>
- <type>DEPENDENT</type>
- <key>pgsql.archive.count_files_to_archive</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.count_files</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.archive["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Archive: Count of attempts to archive files</name>
- <type>DEPENDENT</type>
- <key>pgsql.archive.failed_trying_to_archive</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Collect all metrics from pg_stat_activity&#13;
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.archived_count</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.archive[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Archive: Count of files in archive_status need to archive</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.archive.count_files_to_archive</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.count_files</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.archive[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Archive: Count of attempts to archive files</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.archive.failed_trying_to_archive</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Collect all metrics from pg_stat_activity&#13;
https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-ARCHIVER-VIEW</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.failed_count</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.archive["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Archive: Count of files need to archive</name>
- <type>DEPENDENT</type>
- <key>pgsql.archive.size_files_to_archive</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Size of files to archive</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.size_files</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.archive["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>PostgreSQL: Get archive</name>
- <key>pgsql.archive["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <history>0</history>
- <trends>0</trends>
- <value_type>TEXT</value_type>
- <description>Collect archive status metrics</description>
- <applications>
- <application>
- <name>Zabbix raw items</name>
- </application>
- </applications>
- </item>
- <item>
- <name>Autovacuum: Count of autovacuum workers</name>
- <key>pgsql.autovacuum.count["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of autovacuum workers.</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- </item>
- <item>
- <name>Bgwriter: Buffers allocated</name>
- <type>DEPENDENT</type>
- <key>pgsql.bgwriter.buffers_alloc.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of buffers allocated</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.buffers_alloc</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.bgwriter["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Bgwriter: Times a backend execute its own fsync</name>
- <type>DEPENDENT</type>
- <key>pgsql.bgwriter.buffers_backend_fsync.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of times a backend had to execute its own fsync call (normally the background writer handles those even when the backend does its own write)</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.buffers_backend_fsync</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.bgwriter["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Bgwriter: Buffers written directly by a backend</name>
- <type>DEPENDENT</type>
- <key>pgsql.bgwriter.buffers_backend.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of buffers written directly by a backend</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.buffers_backend</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.bgwriter["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Checkpoint: Buffers checkpoints written</name>
- <type>DEPENDENT</type>
- <key>pgsql.bgwriter.buffers_checkpoint.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of buffers written during checkpoints</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.buffers_checkpoint</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.bgwriter["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Checkpoint: Buffers background written</name>
- <type>DEPENDENT</type>
- <key>pgsql.bgwriter.buffers_clean.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of buffers written by the background writer</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.buffers_clean</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.bgwriter["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Checkpoint: Checkpoint write time</name>
- <type>DEPENDENT</type>
- <key>pgsql.bgwriter.checkpoint_write_time.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <units>s</units>
- <description>Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk, in milliseconds</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.checkpoint_write_time</params>
- </step>
- <step>
- <type>MULTIPLIER</type>
- <params>0.001</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.bgwriter["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Checkpoint: Requested</name>
- <type>DEPENDENT</type>
- <key>pgsql.bgwriter.checkpoints_req.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of requested checkpoints that have been performed</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.checkpoints_req</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.bgwriter["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Checkpoint: By timeout</name>
- <type>DEPENDENT</type>
- <key>pgsql.bgwriter.checkpoints_timed.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of scheduled checkpoints that have been performed</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.checkpoints_timed</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.bgwriter["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Bgwriter: Number of bgwriter stopped</name>
- <type>DEPENDENT</type>
- <key>pgsql.bgwriter.maxwritten_clean.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of times the background writer stopped a cleaning scan because it had written too many buffers</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.maxwritten_clean</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.bgwriter["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Checkpoint: Checkpoint sync time</name>
- <type>DEPENDENT</type>
- <key>pgsql.bgwriter.sync_time.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <units>s</units>
- <description>Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.sync_time</params>
- </step>
- <step>
- <type>MULTIPLIER</type>
- <params>0.001</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.bgwriter["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>PostgreSQL: Get bgwriter</name>
- <key>pgsql.bgwriter["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <history>0</history>
- <trends>0</trends>
- <value_type>TEXT</value_type>
- <description>https://www.postgresql.org/docs/12/monitoring-stats.html#PG-STAT-BGWRITER-VIEW</description>
- <applications>
- <application>
- <name>Zabbix raw items</name>
- </application>
- </applications>
- </item>
- <item>
- <name>PostgreSQL: Cache hit</name>
- <key>pgsql.cache.hit["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <units>%</units>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- </item>
- <item>
- <name>Connections sum: Active</name>
- <type>DEPENDENT</type>
- <key>pgsql.connections.active</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Total number of connections executing a query</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.active</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.connections["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Connections sum: Disabled</name>
- <type>DEPENDENT</type>
- <key>pgsql.connections.disabled</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Total number of disabled connections</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.disabled</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.connections["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Connections sum: Fastpath function call</name>
- <type>DEPENDENT</type>
- <key>pgsql.connections.fastpath_function_call</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Total number of connections executing a fast-path function</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.idle_in_transaction</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.connections["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Connections sum: Idle</name>
- <type>DEPENDENT</type>
- <key>pgsql.connections.idle</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Total number of connections waiting for a new client command</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.idle</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.connections["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Connections sum: Idle in transaction</name>
- <type>DEPENDENT</type>
- <key>pgsql.connections.idle_in_transaction</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Total number of connections in a transaction state, but not executing a query</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.idle_in_transaction</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.connections["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Connections sum: Idle in transaction (aborted)</name>
- <type>DEPENDENT</type>
- <key>pgsql.connections.idle_in_transaction_aborted</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Total number of connections in a transaction state, but not executing a query and one of the statements in the transaction caused an error.</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.idle_in_transaction_aborted</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.connections["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Connections sum: Prepared</name>
- <type>DEPENDENT</type>
- <key>pgsql.connections.prepared</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Total number of prepared transactions&#13;
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.failed_count</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.archive[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Archive: Count of files need to archive</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.archive.size_files_to_archive</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Size of files to archive</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.size_files</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.archive[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>PostgreSQL: Get archive</name>
+ <key>pgsql.archive[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <history>0</history>
+ <trends>0</trends>
+ <value_type>TEXT</value_type>
+ <description>Collect archive status metrics</description>
+ <applications>
+ <application>
+ <name>Zabbix raw items</name>
+ </application>
+ </applications>
+ </item>
+ <item>
+ <name>Autovacuum: Count of autovacuum workers</name>
+ <key>pgsql.autovacuum.count[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of autovacuum workers.</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ </item>
+ <item>
+ <name>Bgwriter: Buffers allocated</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.bgwriter.buffers_alloc.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of buffers allocated</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.buffers_alloc</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.bgwriter[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Bgwriter: Buffers written directly by a backend</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.bgwriter.buffers_backend.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of buffers written directly by a backend</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.buffers_backend</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.bgwriter[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Bgwriter: Times a backend execute its own fsync</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.bgwriter.buffers_backend_fsync.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of times a backend had to execute its own fsync call (normally the background writer handles those even when the backend does its own write)</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.buffers_backend_fsync</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.bgwriter[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Checkpoint: Buffers checkpoints written</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.bgwriter.buffers_checkpoint.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of buffers written during checkpoints</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.buffers_checkpoint</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.bgwriter[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Checkpoint: Buffers background written</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.bgwriter.buffers_clean.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of buffers written by the background writer</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.buffers_clean</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.bgwriter[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Checkpoint: Requested</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.bgwriter.checkpoints_req.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of requested checkpoints that have been performed</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.checkpoints_req</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.bgwriter[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Checkpoint: By timeout</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.bgwriter.checkpoints_timed.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of scheduled checkpoints that have been performed</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.checkpoints_timed</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.bgwriter[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Checkpoint: Checkpoint sync time</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.bgwriter.checkpoint_sync_time.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <units>s</units>
+ <description>Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.checkpoint_sync_time</params>
+ </step>
+ <step>
+ <type>MULTIPLIER</type>
+ <params>0.001</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.bgwriter[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Checkpoint: Checkpoint write time</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.bgwriter.checkpoint_write_time.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <units>s</units>
+ <description>Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk, in milliseconds</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.checkpoint_write_time</params>
+ </step>
+ <step>
+ <type>MULTIPLIER</type>
+ <params>0.001</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.bgwriter[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Bgwriter: Number of bgwriter stopped</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.bgwriter.maxwritten_clean.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of times the background writer stopped a cleaning scan because it had written too many buffers</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.maxwritten_clean</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.bgwriter[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>PostgreSQL: Get bgwriter</name>
+ <key>pgsql.bgwriter[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <history>0</history>
+ <trends>0</trends>
+ <value_type>TEXT</value_type>
+ <description>https://www.postgresql.org/docs/12/monitoring-stats.html#PG-STAT-BGWRITER-VIEW</description>
+ <applications>
+ <application>
+ <name>Zabbix raw items</name>
+ </application>
+ </applications>
+ </item>
+ <item>
+ <name>PostgreSQL: Cache hit</name>
+ <key>pgsql.cache.hit[&quot;{$PG.URI}&quot;]</key>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <units>%</units>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ </item>
+ <item>
+ <name>Connections sum: Active</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.connections.active</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Total number of connections executing a query</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.active</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.connections[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Connections sum: Disabled</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.connections.disabled</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Total number of disabled connections</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.disabled</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.connections[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Connections sum: Fastpath function call</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.connections.fastpath_function_call</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Total number of connections executing a fast-path function</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.idle_in_transaction</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.connections[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Connections sum: Idle</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.connections.idle</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Total number of connections waiting for a new client command</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.idle</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.connections[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Connections sum: Idle in transaction</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.connections.idle_in_transaction</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Total number of connections in a transaction state, but not executing a query</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.idle_in_transaction</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.connections[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Connections sum: Idle in transaction (aborted)</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.connections.idle_in_transaction_aborted</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Total number of connections in a transaction state, but not executing a query and one of the statements in the transaction caused an error.</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.idle_in_transaction_aborted</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.connections[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Connections sum: Prepared</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.connections.prepared</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Total number of prepared transactions&#13;
https://www.postgresql.org/docs/current/sql-prepare-transaction.html</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.prepared</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.connections["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Connections sum: Total</name>
- <type>DEPENDENT</type>
- <key>pgsql.connections.total</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Total number of connections</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.total</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.connections["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Connections sum: Total %</name>
- <type>DEPENDENT</type>
- <key>pgsql.connections.total_pct</key>
- <delay>0</delay>
- <history>7d</history>
- <units>%</units>
- <description>Total number of connections in percentage</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.total_pct</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.connections["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- <triggers>
- <trigger>
- <expression>{min(5m)} &gt; {$PG.CONN_TOTAL_PCT.MAX.WARN}</expression>
- <name>Connections sum: Total number of connections is too high (over {$PG.CONN_TOTAL_PCT.MAX.WARN} in 5m)</name>
- <priority>AVERAGE</priority>
- </trigger>
- </triggers>
- </item>
- <item>
- <name>Connections sum: Waiting</name>
- <type>DEPENDENT</type>
- <key>pgsql.connections.waiting</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Total number of waiting connections&#13;
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.prepared</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.connections[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Connections sum: Total</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.connections.total</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Total number of connections</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.total</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.connections[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Connections sum: Total %</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.connections.total_pct</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <units>%</units>
+ <description>Total number of connections in percentage</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.total_pct</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.connections[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ <triggers>
+ <trigger>
+ <expression>{min(5m)} &gt; {$PG.CONN_TOTAL_PCT.MAX.WARN}</expression>
+ <name>Connections sum: Total number of connections is too high (over {$PG.CONN_TOTAL_PCT.MAX.WARN} in 5m)</name>
+ <priority>AVERAGE</priority>
+ </trigger>
+ </triggers>
+ </item>
+ <item>
+ <name>Connections sum: Waiting</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.connections.waiting</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Total number of waiting connections&#13;
https://www.postgresql.org/docs/current/monitoring-stats.html#WAIT-EVENT-TABLE</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.waiting</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.connections["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>PostgreSQL: Get connections</name>
- <key>pgsql.connections["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <history>0</history>
- <trends>0</trends>
- <value_type>TEXT</value_type>
- <description>Collect all metrics from pg_stat_activity&#13;
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.waiting</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.connections[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>PostgreSQL: Get connections</name>
+ <key>pgsql.connections[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <history>0</history>
+ <trends>0</trends>
+ <value_type>TEXT</value_type>
+ <description>Collect all metrics from pg_stat_activity&#13;
https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW</description>
- <applications>
- <application>
- <name>Zabbix raw items</name>
- </application>
- </applications>
- </item>
- <item>
- <name>Dbstat: Blocks read time</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.sum.blk_read_time</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <units>s</units>
- <description>Time spent reading data file blocks by backends, in milliseconds</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.blk_read_time</params>
- </step>
- <step>
- <type>MULTIPLIER</type>
- <params>0.001</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Dbstat: Blocks write time</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.sum.blk_write_time</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <units>s</units>
- <description>Time spent writing data file blocks by backends, in milliseconds</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.blk_read_time</params>
- </step>
- <step>
- <type>MULTIPLIER</type>
- <params>0.001</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Dbstat: Hit blocks read</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.sum.blks_hit.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of times disk blocks were found already in the buffer cache</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.blks_hit</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Dbstat: Disk blocks read</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.sum.blks_read.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of disk blocks read</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.blks_read</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Dbstat: Checksum failures</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.sum.checksum_failures.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of data page checksum failures detected (or on a shared object), or NULL if data checksums are not enabled. This metric included in PostgreSQL 12</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.checksum_failures</params>
- </step>
- <step>
- <type>MATCHES_REGEX</type>
- <params>^\d*$</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- <error_handler>CUSTOM_VALUE</error_handler>
- <error_handler_params>ZBX_NOTSUPPORTED: Checksum failures metric is supported only in PostgreSQL 12 or higher.</error_handler_params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Dbstat: Conflicts</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.sum.conflicts.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of queries canceled due to conflicts with recovery. (Conflicts occur only on standby servers; see pg_stat_database_conflicts for details.)</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.conflicts</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Dbstat: Deadlocks</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.sum.deadlocks.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of deadlocks detected</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.deadlocks</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Dbstat: Backends connected</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.sum.numbackends</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Number of connected backends</description>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.numbackends</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Dbstat: Number temp bytes</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.sum.temp_bytes.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <units>b</units>
- <description>Total amount of data written to temporary files by queries</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.temp_bytes</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Dbstat: Number temp bytes</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.sum.temp_files.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of temporary files created by queries</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.temp_files</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Dbstat: Rows deleted</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.sum.tup_deleted.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of rows deleted by queries</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.tup_deleted</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Dbstat: Rows fetched</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.sum.tup_fetched.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of rows fetched by queries</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.tup_fetched</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Dbstat: Rows inserted</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.sum.tup_inserted.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of rows inserted by queries</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.tup_inserted</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Dbstat: Rows returned</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.sum.tup_returned.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of rows returned by queries</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.tup_returned</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Dbstat: Rows updated</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.sum.tup_updated.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of rows updated by queries</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.tup_updated</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Dbstat: Committed transactions</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.sum.xact_commit.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of transactions that have been committed</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.xact_commit</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>Dbstat: Roll backed transactions</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.sum.xact_rollback.rate</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of transactions that have been rolled back</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.xact_rollback</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>PostgreSQL: Get dbstat sum</name>
- <key>pgsql.dbstat.sum["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <history>0</history>
- <trends>0</trends>
- <value_type>TEXT</value_type>
- <description>Collect all metrics from pg_stat_database per database&#13;
+ <applications>
+ <application>
+ <name>Zabbix raw items</name>
+ </application>
+ </applications>
+ </item>
+ <item>
+ <name>PostgreSQL: Custom queries</name>
+ <key>pgsql.custom.query[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;,&quot;{$PG.DATABASE}&quot;,&quot;&quot;]</key>
+ <history>1h</history>
+ <trends>0</trends>
+ <status>DISABLED</status>
+ <value_type>TEXT</value_type>
+ <description>Execute custom queries from file *.sql</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ </item>
+ <item>
+ <name>Dbstat: Hit blocks read</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.sum.blks_hit.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of times disk blocks were found already in the buffer cache</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.blks_hit</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Dbstat: Disk blocks read</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.sum.blks_read.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of disk blocks read</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.blks_read</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Dbstat: Blocks read time</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.sum.blk_read_time</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <units>s</units>
+ <description>Time spent reading data file blocks by backends, in milliseconds</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.blk_read_time</params>
+ </step>
+ <step>
+ <type>MULTIPLIER</type>
+ <params>0.001</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Dbstat: Blocks write time</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.sum.blk_write_time</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <units>s</units>
+ <description>Time spent writing data file blocks by backends, in milliseconds</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.blk_read_time</params>
+ </step>
+ <step>
+ <type>MULTIPLIER</type>
+ <params>0.001</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Dbstat: Checksum failures</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.sum.checksum_failures.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of data page checksum failures detected (or on a shared object), or NULL if data checksums are not enabled. This metric included in PostgreSQL 12</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.checksum_failures</params>
+ </step>
+ <step>
+ <type>MATCHES_REGEX</type>
+ <params>^\d*$</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ <error_handler>CUSTOM_VALUE</error_handler>
+ <error_handler_params>-1</error_handler_params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Dbstat: Conflicts</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.sum.conflicts.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of queries canceled due to conflicts with recovery. (Conflicts occur only on standby servers; see pg_stat_database_conflicts for details.)</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.conflicts</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Dbstat: Deadlocks</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.sum.deadlocks.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of deadlocks detected</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.deadlocks</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Dbstat: Backends connected</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.sum.numbackends</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Number of connected backends</description>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.numbackends</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Dbstat: Number temp bytes</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.sum.temp_bytes.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <units>b</units>
+ <description>Total amount of data written to temporary files by queries</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.temp_bytes</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Dbstat: Number temp bytes</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.sum.temp_files.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of temporary files created by queries</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.temp_files</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Dbstat: Rows deleted</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.sum.tup_deleted.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of rows deleted by queries</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.tup_deleted</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Dbstat: Rows fetched</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.sum.tup_fetched.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of rows fetched by queries</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.tup_fetched</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Dbstat: Rows inserted</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.sum.tup_inserted.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of rows inserted by queries</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.tup_inserted</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Dbstat: Rows returned</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.sum.tup_returned.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of rows returned by queries</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.tup_returned</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Dbstat: Rows updated</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.sum.tup_updated.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of rows updated by queries</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.tup_updated</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Dbstat: Committed transactions</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.sum.xact_commit.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of transactions that have been committed</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.xact_commit</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>Dbstat: Roll backed transactions</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.sum.xact_rollback.rate</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of transactions that have been rolled back</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.xact_rollback</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>PostgreSQL: Get dbstat sum</name>
+ <key>pgsql.dbstat.sum[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <history>0</history>
+ <trends>0</trends>
+ <value_type>TEXT</value_type>
+ <description>Collect all metrics from pg_stat_database per database&#13;
https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-DATABASE-VIEW</description>
- <applications>
- <application>
- <name>Zabbix raw items</name>
- </application>
- </applications>
- </item>
- <item>
- <name>PostgreSQL: Get dbstat</name>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <history>0</history>
- <trends>0</trends>
- <value_type>TEXT</value_type>
- <description>Collect all metrics from pg_stat_database per database&#13;
+ <applications>
+ <application>
+ <name>Zabbix raw items</name>
+ </application>
+ </applications>
+ </item>
+ <item>
+ <name>PostgreSQL: Get dbstat</name>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <history>0</history>
+ <trends>0</trends>
+ <value_type>TEXT</value_type>
+ <description>Collect all metrics from pg_stat_database per database&#13;
https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-DATABASE-VIEW</description>
- <applications>
- <application>
- <name>Zabbix raw items</name>
- </application>
- </applications>
- </item>
- <item>
- <name>PostgreSQL: Get locks</name>
- <key>pgsql.locks["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <history>0</history>
- <trends>0</trends>
- <value_type>TEXT</value_type>
- <description>Collect all metrics from pg_locks per database&#13;
+ <applications>
+ <application>
+ <name>Zabbix raw items</name>
+ </application>
+ </applications>
+ </item>
+ <item>
+ <name>PostgreSQL: Get locks</name>
+ <key>pgsql.locks[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <history>0</history>
+ <trends>0</trends>
+ <value_type>TEXT</value_type>
+ <description>Collect all metrics from pg_locks per database&#13;
https://www.postgresql.org/docs/current/explicit-locking.html#LOCKING-TABLES</description>
- <applications>
- <application>
- <name>Zabbix raw items</name>
- </application>
- </applications>
- </item>
- <item>
- <name>PostgreSQL: Age of oldest xid</name>
- <key>pgsql.oldest.xid["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Age of oldest xid.</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <triggers>
- <trigger>
- <expression>{last()} &gt; 18000000</expression>
- <name>PostgreSQL: Oldest xid is too big</name>
- <priority>AVERAGE</priority>
- </trigger>
- </triggers>
- </item>
- <item>
- <name>PostgreSQL: Ping</name>
- <key>pgsql.ping["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <history>7d</history>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>DISCARD_UNCHANGED_HEARTBEAT</type>
- <params>1h</params>
- </step>
- </preprocessing>
- <triggers>
- <trigger>
- <expression>{last()}=0</expression>
- <name>PostgreSQL: Service is down</name>
- <priority>HIGH</priority>
- </trigger>
- </triggers>
- </item>
- <item>
- <name>Replication: Standby count</name>
- <key>pgsql.replication.count["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <history>7d</history>
- <description>Number of standby servers</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- </item>
- <item>
- <name>Replication: Lag in bytes</name>
- <key>pgsql.replication.lag.b["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <history>7d</history>
- <units>B</units>
- <description>Replication lag with Master in byte.</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- </item>
- <item>
- <name>Replication: Lag in seconds</name>
- <key>pgsql.replication.lag.sec["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <history>7d</history>
- <units>s</units>
- <description>Replication lag with Master in seconds.</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- </item>
- <item>
- <name>Replication: Recovery role</name>
- <key>pgsql.replication.recovery_role["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <history>7d</history>
- <description>Replication role: 1 — recovery is still in progress (standby mode), 0 — master mode.</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <valuemap>
- <name>PostgreSQL recovery role</name>
- </valuemap>
- </item>
- <item>
- <name>Replication: Status</name>
- <key>pgsql.replication.status["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <history>7d</history>
- <description>Replication status: 0 — streaming is down, 1 — streaming is up, 2 — master mode</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <valuemap>
- <name>PostgreSQL replication status</name>
- </valuemap>
- </item>
- <item>
- <name>PostgreSQL: Uptime</name>
- <key>pgsql.uptime["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <units>s</units>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <triggers>
- <trigger>
- <expression>{last()} &lt; 600</expression>
- <name>PostgreSQL: Service has been restarted (uptime={ITEM.LASTVALUE})</name>
- <priority>AVERAGE</priority>
- </trigger>
- </triggers>
- </item>
- <item>
- <name>WAL: Segments count</name>
- <type>DEPENDENT</type>
- <key>pgsql.wal.count</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Number of WAL segments</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.write</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.wal.stat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- <item>
- <name>PostgreSQL: Get WAL</name>
- <key>pgsql.wal.stat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <delay>5m</delay>
- <history>0</history>
- <trends>0</trends>
- <value_type>TEXT</value_type>
- <description>Collect WAL metrics</description>
- <applications>
- <application>
- <name>Zabbix raw items</name>
- </application>
- </applications>
- </item>
- <item>
- <name>WAL: Bytes written</name>
- <type>DEPENDENT</type>
- <key>pgsql.wal.write</key>
- <delay>0</delay>
- <history>7d</history>
- <units>B</units>
- <description>WAL write in bytes</description>
- <applications>
- <application>
- <name>PostgreSQL</name>
- </application>
- </applications>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$.write</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.wal.stat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item>
- </items>
- <discovery_rules>
- <discovery_rule>
- <name>Database discovery</name>
- <type>ZABBIX_PASSIVE</type>
- <key>pgsql.db.discovery["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- <delay>1h</delay>
- <filter>
- <evaltype>AND</evaltype>
- <conditions>
- <condition>
- <macro>{#DBNAME}</macro>
- <value>{$PG.LLD.FILTER.DBNAME}</value>
- <formulaid>A</formulaid>
- </condition>
- </conditions>
- </filter>
- <item_prototypes>
- <item_prototype>
- <name>DB {#DBNAME}: Database age</name>
- <key>pgsql.db.age["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]</key>
- <delay>15m</delay>
- <history>7d</history>
- <description>Database age</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Get bloating tables</name>
- <key>pgsql.db.bloating_tables["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]</key>
- <history>7d</history>
- <description>Number of bloating tables</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Database size</name>
- <key>pgsql.db.size["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]</key>
- <delay>5m</delay>
- <history>7d</history>
- <units>B</units>
- <description>Database size</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Disk blocks read per second</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.blk_read_time.rate["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <units>s</units>
- <description>Time spent reading data file blocks by backends, in milliseconds</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].blk_read_time</params>
- </step>
- <step>
- <type>MULTIPLIER</type>
- <params>0.001</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Disk blocks read per second</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.blk_write_time.rate["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <units>s</units>
- <description>Time spent writing data file blocks by backends, in milliseconds</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].blk_write_time</params>
- </step>
- <step>
- <type>MULTIPLIER</type>
- <params>0.001</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Blocks hit per second</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.blks_hit.rate["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Total number of times disk blocks were found already in the buffer cache, so that a read was not necessary</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].blks_hit</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Disk blocks read per second</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.blks_read.rate["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Total number of disk blocks read in this database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].blks_read</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Checksum failures</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.checksum_failures.rate["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of data page checksum failures detected in this database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].checksum_failures</params>
- </step>
- <step>
- <type>MATCHES_REGEX</type>
- <params>^\d*$</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- <error_handler>CUSTOM_VALUE</error_handler>
- <error_handler_params>ZBX_NOTSUPPORTED: Checksum failures metric is supported only in PostgreSQL 12 or higher.</error_handler_params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Detected conflicts per second</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.conflicts.rate["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Total number of queries canceled due to conflicts with recovery in this database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].conflicts</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- <trigger_prototypes>
- <trigger_prototype>
- <expression>{min(5m)} &gt; {$PG.CONFLICTS.MAX.WARN:"{#DBNAME}"}</expression>
- <name>DB {#DBNAME}: Too many recovery conflicts (over {$PG.CONFLICTS.MAX.WARN:"{#DBNAME}"} in 5m)</name>
- <priority>AVERAGE</priority>
- <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.&#13;
+ <applications>
+ <application>
+ <name>Zabbix raw items</name>
+ </application>
+ </applications>
+ </item>
+ <item>
+ <name>PostgreSQL: Age of oldest xid</name>
+ <key>pgsql.oldest.xid[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;]</key>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Age of oldest xid.</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <triggers>
+ <trigger>
+ <expression>{last()} &gt; 18000000</expression>
+ <name>PostgreSQL: Oldest xid is too big</name>
+ <priority>AVERAGE</priority>
+ </trigger>
+ </triggers>
+ </item>
+ <item>
+ <name>PostgreSQL: Ping</name>
+ <key>pgsql.ping[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <history>7d</history>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>DISCARD_UNCHANGED_HEARTBEAT</type>
+ <params>1h</params>
+ </step>
+ </preprocessing>
+ <triggers>
+ <trigger>
+ <expression>{last()}=0</expression>
+ <name>PostgreSQL: Service is down</name>
+ <priority>HIGH</priority>
+ </trigger>
+ </triggers>
+ </item>
+ <item>
+ <name>Replication: Standby count</name>
+ <key>pgsql.replication.count[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <history>7d</history>
+ <description>Number of standby servers</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ </item>
+ <item>
+ <name>Replication: Lag in bytes</name>
+ <key>pgsql.replication.lag.b[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <history>7d</history>
+ <units>B</units>
+ <description>Replication lag with Master in byte.</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ </item>
+ <item>
+ <name>Replication: Lag in seconds</name>
+ <key>pgsql.replication.lag.sec[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <history>7d</history>
+ <units>s</units>
+ <description>Replication lag with Master in seconds.</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ </item>
+ <item>
+ <name>PostgreSQL: Get replication</name>
+ <key>pgsql.replication.process[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <history>0</history>
+ <trends>0</trends>
+ <value_type>TEXT</value_type>
+ <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.</description>
+ <applications>
+ <application>
+ <name>Zabbix raw items</name>
+ </application>
+ </applications>
+ </item>
+ <item>
+ <name>Replication: Recovery role</name>
+ <key>pgsql.replication.recovery_role[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <history>7d</history>
+ <description>Replication role: 1 — recovery is still in progress (standby mode), 0 — master mode.</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <valuemap>
+ <name>PostgreSQL recovery role</name>
+ </valuemap>
+ </item>
+ <item>
+ <name>Replication: Status</name>
+ <key>pgsql.replication.status[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <history>7d</history>
+ <description>Replication status: 0 — streaming is down, 1 — streaming is up, 2 — master mode</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <valuemap>
+ <name>PostgreSQL replication status</name>
+ </valuemap>
+ </item>
+ <item>
+ <name>PostgreSQL: Uptime</name>
+ <key>pgsql.uptime[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <units>s</units>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <triggers>
+ <trigger>
+ <expression>{last()} &lt; 600</expression>
+ <name>PostgreSQL: Service has been restarted (uptime={ITEM.LASTVALUE})</name>
+ <priority>AVERAGE</priority>
+ </trigger>
+ </triggers>
+ </item>
+ <item>
+ <name>WAL: Segments count</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.wal.count</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Number of WAL segments</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.write</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.wal.stat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ <item>
+ <name>PostgreSQL: Get WAL</name>
+ <key>pgsql.wal.stat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <delay>5m</delay>
+ <history>0</history>
+ <trends>0</trends>
+ <value_type>TEXT</value_type>
+ <description>Collect WAL metrics</description>
+ <applications>
+ <application>
+ <name>Zabbix raw items</name>
+ </application>
+ </applications>
+ </item>
+ <item>
+ <name>WAL: Bytes written</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.wal.write</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <units>B</units>
+ <description>WAL write in bytes</description>
+ <applications>
+ <application>
+ <name>PostgreSQL</name>
+ </application>
+ </applications>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$.write</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.wal.stat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item>
+ </items>
+ <discovery_rules>
+ <discovery_rule>
+ <name>Database discovery</name>
+ <key>pgsql.db.discovery[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <delay>1h</delay>
+ <filter>
+ <evaltype>AND</evaltype>
+ <conditions>
+ <condition>
+ <macro>{#DBNAME}</macro>
+ <value>{$PG.LLD.FILTER.DBNAME}</value>
+ <formulaid>A</formulaid>
+ </condition>
+ </conditions>
+ </filter>
+ <item_prototypes>
+ <item_prototype>
+ <name>DB {#DBNAME}: Database age</name>
+ <key>pgsql.db.age[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;,&quot;{#DBNAME}&quot;]</key>
+ <delay>10m</delay>
+ <history>7d</history>
+ <description>Database age</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Get bloating tables</name>
+ <key>pgsql.db.bloating_tables[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;,&quot;{#DBNAME}&quot;]</key>
+ <history>7d</history>
+ <description>Number оf bloating tables</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Database size</name>
+ <key>pgsql.db.size[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;,&quot;{#DBNAME}&quot;]</key>
+ <delay>5m</delay>
+ <history>7d</history>
+ <units>B</units>
+ <description>Database size</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Blocks hit per second</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.blks_hit.rate[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Total number of times disk blocks were found already in the buffer cache, so that a read was not necessary</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].blks_hit</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Disk blocks read per second</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.blks_read.rate[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Total number of disk blocks read in this database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].blks_read</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Disk blocks read per second</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.blk_read_time.rate[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <units>s</units>
+ <description>Time spent reading data file blocks by backends, in milliseconds</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].blk_read_time</params>
+ </step>
+ <step>
+ <type>MULTIPLIER</type>
+ <params>0.001</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Disk blocks read per second</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.blk_write_time.rate[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <units>s</units>
+ <description>Time spent writing data file blocks by backends, in milliseconds</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].blk_write_time</params>
+ </step>
+ <step>
+ <type>MULTIPLIER</type>
+ <params>0.001</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Checksum failures</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.checksum_failures.rate[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of data page checksum failures detected in this database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].checksum_failures</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Detected conflicts per second</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.conflicts.rate[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Total number of queries canceled due to conflicts with recovery in this database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].conflicts</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ <trigger_prototypes>
+ <trigger_prototype>
+ <expression>{min(5m)} &gt; {$PG.CONFLICTS.MAX.WARN:&quot;{#DBNAME}&quot;}</expression>
+ <name>DB {#DBNAME}: Too many recovery conflicts (over {$PG.CONFLICTS.MAX.WARN:&quot;{#DBNAME}&quot;} in 5m)</name>
+ <priority>AVERAGE</priority>
+ <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.&#13;
https://www.postgresql.org/docs/current/hot-standby.html#HOT-STANDBY-CONFLICT</description>
- </trigger_prototype>
- </trigger_prototypes>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Detected deadlocks per second</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.deadlocks.rate["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Total number of detected deadlocks in this database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].deadlocks</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- <trigger_prototypes>
- <trigger_prototype>
- <expression>{min(5m)} &gt; {$PG.DEADLOCKS.MAX.WARN:"{#DBNAME}"}</expression>
- <name>DB {#DBNAME}: Deadlock occurred (over {$PG.DEADLOCKS.MAX.WARN:"{#DBNAME}"} in 5m)</name>
- <priority>HIGH</priority>
- </trigger_prototype>
- </trigger_prototypes>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Backends connected</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.numbackends["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Number of backends currently connected to this database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].numbackends</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Temp_bytes written per second</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.temp_bytes.rate["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <units>B</units>
- <description>Total amount of data written to temporary files by queries in this database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].temp_bytes</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Temp_files created per second</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.temp_files.rate["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Total number of temporary files created by queries in this database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].temp_files</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Tuples deleted per second</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.tup_deleted.rate["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Total number of rows deleted by queries in this database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].tup_deleted</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Tuples fetched per second</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.tup_fetched.rate["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Total number of rows fetched by queries in this database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].tup_fetched</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Tuples inserted per second</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.tup_inserted.rate["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Total number of rows inserted by queries in this database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].tup_inserted</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Tuples returned per second</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.tup_returned.rate["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of rows returned by queries in this database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].tup_returned</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Tuples updated per second</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.tup_updated.rate["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Total number of rows updated by queries in this database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].tup_updated</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Commits per second</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.xact_commit.rate["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Number of transactions in this database that have been committed</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].xact_commit</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Rollbacks per second</name>
- <type>DEPENDENT</type>
- <key>pgsql.dbstat.xact_rollback.rate["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <value_type>FLOAT</value_type>
- <description>Total number of transactions in this database that have been rolled back</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].xact_rollback</params>
- </step>
- <step>
- <type>CHANGE_PER_SECOND</type>
- <params/>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.dbstat["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Num of accessexclusive locks</name>
- <type>DEPENDENT</type>
- <key>pgsql.locks.accessexclusive["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Number of accessexclusive locks for each database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].accessexclusive</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.locks["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Num of accessshare locks</name>
- <type>DEPENDENT</type>
- <key>pgsql.locks.accessshare["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Number of accessshare locks for each database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].accessshare</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.locks["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Num of exclusive locks</name>
- <type>DEPENDENT</type>
- <key>pgsql.locks.exclusive["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Number of exclusive locks for each database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].exclusive</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.locks["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Num of rowexclusive locks</name>
- <type>DEPENDENT</type>
- <key>pgsql.locks.rowexclusive["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Number of rowexclusive locks for each database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].rowexclusive</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.locks["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Num of rowshare locks</name>
- <type>DEPENDENT</type>
- <key>pgsql.locks.rowshare["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Number of rowshare locks for each database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].rowshare</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.locks["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Num of share locks</name>
- <type>DEPENDENT</type>
- <key>pgsql.locks.share["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Number of share locks for each database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].share</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.locks["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Num of sharerowexclusive locks</name>
- <type>DEPENDENT</type>
- <key>pgsql.locks.sharerowexclusive["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Number of total sharerowexclusive for each database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].sharerowexclusive</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.locks["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Num of shareupdateexclusive locks</name>
- <type>DEPENDENT</type>
- <key>pgsql.locks.shareupdateexclusive["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Number of shareupdateexclusive locks for each database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].shareupdateexclusive</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.locks["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- <item_prototype>
- <name>DB {#DBNAME}: Num of total locks</name>
- <type>DEPENDENT</type>
- <key>pgsql.locks.total["{#DBNAME}"]</key>
- <delay>0</delay>
- <history>7d</history>
- <description>Number of total locks for each database</description>
- <application_prototypes>
- <application_prototype>
- <name>PostgreSQL: DB {#DBNAME}</name>
- </application_prototype>
- </application_prototypes>
- <preprocessing>
- <step>
- <type>JSONPATH</type>
- <params>$['{#DBNAME}'].total</params>
- </step>
- </preprocessing>
- <master_item>
- <key>pgsql.locks["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}"]</key>
- </master_item>
- </item_prototype>
- </item_prototypes>
- <host_prototypes/>
- <graph_prototypes>
- <graph_prototype>
- <name>DB {#DBNAME}: Locks</name>
- <graph_items>
- <graph_item>
- <drawtype>GRADIENT_LINE</drawtype>
- <color>1A7C11</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.locks.total["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>1</sortorder>
- <color>2774A4</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.locks.accessexclusive["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>2</sortorder>
- <color>F63100</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.locks.accessshare["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>3</sortorder>
- <color>A54F10</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.locks.exclusive["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>4</sortorder>
- <color>FC6EA3</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.locks.rowexclusive["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>5</sortorder>
- <color>6C59DC</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.locks.rowshare["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>6</sortorder>
- <color>AC8C14</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.locks.sharerowexclusive["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>7</sortorder>
- <color>611F27</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.locks.shareupdateexclusive["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>8</sortorder>
- <color>F230E0</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.locks.share["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>9</sortorder>
- <color>FFAD40</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.locks.share["{#DBNAME}"]</key>
- </item>
- </graph_item>
- </graph_items>
- </graph_prototype>
- <graph_prototype>
- <name>DB {#DBNAME}: Number of bloating tables</name>
- <graph_items>
- <graph_item>
- <drawtype>GRADIENT_LINE</drawtype>
- <color>1A7C11</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.db.bloating_tables["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]</key>
- </item>
- </graph_item>
- </graph_items>
- </graph_prototype>
- <graph_prototype>
- <name>DB {#DBNAME}: pg_stat_database metrics</name>
- <graph_items>
- <graph_item>
- <color>1A7C11</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.dbstat.blks_hit.rate["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>1</sortorder>
- <color>2774A4</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.dbstat.blks_read.rate["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>2</sortorder>
- <color>F63100</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.dbstat.conflicts.rate["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>3</sortorder>
- <color>A54F10</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.dbstat.deadlocks.rate["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>4</sortorder>
- <color>FC6EA3</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.dbstat.temp_bytes.rate["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>5</sortorder>
- <color>6C59DC</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.dbstat.temp_files.rate["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>6</sortorder>
- <color>AC8C14</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.dbstat.tup_deleted.rate["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>7</sortorder>
- <color>611F27</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.dbstat.tup_fetched.rate["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>8</sortorder>
- <color>F230E0</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.dbstat.tup_inserted.rate["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>9</sortorder>
- <color>FFAD40</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.dbstat.tup_returned.rate["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>10</sortorder>
- <color>40CDFF</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.dbstat.tup_updated.rate["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>11</sortorder>
- <color>40FFA0</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.dbstat.xact_commit.rate["{#DBNAME}"]</key>
- </item>
- </graph_item>
- <graph_item>
- <sortorder>12</sortorder>
- <color>AE4500</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.dbstat.xact_rollback.rate["{#DBNAME}"]</key>
- </item>
- </graph_item>
- </graph_items>
- </graph_prototype>
- <graph_prototype>
- <name>DB {#DBNAME}: Size</name>
- <graph_items>
- <graph_item>
- <drawtype>GRADIENT_LINE</drawtype>
- <color>1A7C11</color>
- <item>
- <host>Template DB PostgreSQL Agent 2</host>
- <key>pgsql.db.size["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]</key>
- </item>
- </graph_item>
- </graph_items>
- </graph_prototype>
- </graph_prototypes>
- </discovery_rule>
- </discovery_rules>
- <macros>
- <macro>
- <macro>{$PG.CONFLICTS.MAX.WARN}</macro>
- <value>0</value>
- </macro>
- <macro>
- <macro>{$PG.CONN_TOTAL_PCT.MAX.WARN}</macro>
- <value>90</value>
- </macro>
- <macro>
- <macro>{$PG.DEADLOCKS.MAX.WARN}</macro>
- <value>0</value>
- </macro>
- <macro>
- <macro>{$PG.LLD.FILTER.DBNAME}</macro>
- <value>(.+)</value>
- </macro>
- <macro>
- <macro>{$PG.PASSWORD}</macro>
- <value>postgres</value>
- </macro>
- <macro>
- <macro>{$PG.URI}</macro>
- <value>tcp://localhost:5432</value>
- </macro>
- <macro>
- <macro>{$PG.USER}</macro>
- <value>postgres</value>
- </macro>
- </macros>
- <screens>
- <screen>
- <name>PostgreSQL databases</name>
- <hsize>2</hsize>
- <vsize>5</vsize>
- <screen_items>
- <screen_item>
- <resourcetype>20</resourcetype>
- <style>0</style>
- <resource>
- <name>DB {#DBNAME}: pg_stat_database metrics</name>
- <host>Template DB PostgreSQL Agent 2</host>
- </resource>
- <width>500</width>
- <height>100</height>
- <x>0</x>
- <y>0</y>
- <colspan>1</colspan>
- <rowspan>1</rowspan>
- <elements>25</elements>
- <valign>0</valign>
- <halign>0</halign>
- <dynamic>0</dynamic>
- <sort_triggers>0</sort_triggers>
- <url/>
- <application/>
- <max_columns>3</max_columns>
- </screen_item>
- <screen_item>
- <resourcetype>20</resourcetype>
- <style>0</style>
- <resource>
- <name>DB {#DBNAME}: Locks</name>
- <host>Template DB PostgreSQL Agent 2</host>
- </resource>
- <width>500</width>
- <height>100</height>
- <x>1</x>
- <y>0</y>
- <colspan>1</colspan>
- <rowspan>1</rowspan>
- <elements>25</elements>
- <valign>0</valign>
- <halign>0</halign>
- <dynamic>0</dynamic>
- <sort_triggers>0</sort_triggers>
- <url/>
- <application/>
- <max_columns>3</max_columns>
- </screen_item>
- <screen_item>
- <resourcetype>20</resourcetype>
- <style>0</style>
- <resource>
- <name>DB {#DBNAME}: Size</name>
- <host>Template DB PostgreSQL Agent 2</host>
- </resource>
- <width>500</width>
- <height>100</height>
- <x>0</x>
- <y>1</y>
- <colspan>1</colspan>
- <rowspan>1</rowspan>
- <elements>25</elements>
- <valign>0</valign>
- <halign>0</halign>
- <dynamic>0</dynamic>
- <sort_triggers>0</sort_triggers>
- <url/>
- <application/>
- <max_columns>3</max_columns>
- </screen_item>
- <screen_item>
- <resourcetype>20</resourcetype>
- <style>0</style>
- <resource>
- <name>DB {#DBNAME}: Number of bloating tables</name>
- <host>Template DB PostgreSQL Agent 2</host>
- </resource>
- <width>500</width>
- <height>100</height>
- <x>1</x>
- <y>1</y>
- <colspan>1</colspan>
- <rowspan>1</rowspan>
- <elements>25</elements>
- <valign>0</valign>
- <halign>0</halign>
- <dynamic>0</dynamic>
- <sort_triggers>0</sort_triggers>
- <url/>
- <application/>
- <max_columns>3</max_columns>
- </screen_item>
- </screen_items>
- </screen>
- </screens>
- </template>
- </templates>
- <value_maps>
- <value_map>
- <name>PostgreSQL recovery role</name>
- <mappings>
- <mapping>
- <value>0</value>
- <newvalue>Master</newvalue>
- </mapping>
- <mapping>
- <value>1</value>
- <newvalue>Standby</newvalue>
- </mapping>
- </mappings>
- </value_map>
- <value_map>
- <name>PostgreSQL replication status</name>
- <mappings>
- <mapping>
- <value>0</value>
- <newvalue>Down</newvalue>
- </mapping>
- <mapping>
- <value>1</value>
- <newvalue>Up</newvalue>
- </mapping>
- <mapping>
- <value>2</value>
- <newvalue>Master</newvalue>
- </mapping>
- </mappings>
- </value_map>
- </value_maps>
+ </trigger_prototype>
+ </trigger_prototypes>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Detected deadlocks per second</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.deadlocks.rate[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Total number of detected deadlocks in this database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].deadlocks</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ <trigger_prototypes>
+ <trigger_prototype>
+ <expression>{min(5m)} &gt; {$PG.DEADLOCKS.MAX.WARN:&quot;{#DBNAME}&quot;}</expression>
+ <name>DB {#DBNAME}: Deadlock occurred (over {$PG.DEADLOCKS.MAX.WARN:&quot;{#DBNAME}&quot;} in 5m)</name>
+ <priority>HIGH</priority>
+ </trigger_prototype>
+ </trigger_prototypes>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Backends connected</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.numbackends[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Number of backends currently connected to this database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].numbackends</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Temp_bytes written per second</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.temp_bytes.rate[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <units>B</units>
+ <description>Total amount of data written to temporary files by queries in this database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].temp_bytes</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Temp_files created per second</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.temp_files.rate[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Total number of temporary files created by queries in this database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].temp_files</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Tuples deleted per second</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.tup_deleted.rate[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Total number of rows deleted by queries in this database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].tup_deleted</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Tuples fetched per second</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.tup_fetched.rate[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Total number of rows fetched by queries in this database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].tup_fetched</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Tuples inserted per second</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.tup_inserted.rate[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Total number of rows inserted by queries in this database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].tup_inserted</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Tuples returned per second</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.tup_returned.rate[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of rows returned by queries in this database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].tup_returned</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Tuples updated per second</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.tup_updated.rate[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Total number of rows updated by queries in this database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].tup_updated</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Commits per second</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.xact_commit.rate[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Number of transactions in this database that have been committed</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].xact_commit</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Rollbacks per second</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.dbstat.xact_rollback.rate[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <description>Total number of transactions in this database that have been rolled back</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].xact_rollback</params>
+ </step>
+ <step>
+ <type>CHANGE_PER_SECOND</type>
+ <params />
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.dbstat[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Num of accessexclusive locks</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.locks.accessexclusive[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Number of accessexclusive locks for each database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].accessexclusive</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.locks[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Num of accessshare locks</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.locks.accessshare[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Number of accessshare locks for each database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].accessshare</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.locks[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Num of exclusive locks</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.locks.exclusive[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Number of exclusive locks for each database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].exclusive</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.locks[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Num of rowexclusive locks</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.locks.rowexclusive[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Number of rowexclusive locks for each database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].rowexclusive</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.locks[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Num of rowshare locks</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.locks.rowshare[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Number of rowshare locks for each database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].rowshare</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.locks[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Num of sharerowexclusive locks</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.locks.sharerowexclusive[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Number of total sharerowexclusive for each database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].sharerowexclusive</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.locks[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Num of shareupdateexclusive locks</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.locks.shareupdateexclusive[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Number of shareupdateexclusive locks for each database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].shareupdateexclusive</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.locks[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Num of share locks</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.locks.share[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Number of share locks for each database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].share</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.locks[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>DB {#DBNAME}: Num of total locks</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.locks.total[&quot;{#DBNAME}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <description>Number of total locks for each database</description>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: DB {#DBNAME}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#DBNAME}'].total</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.locks[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ </item_prototypes>
+ <graph_prototypes>
+ <graph_prototype>
+ <name>DB {#DBNAME}: Locks</name>
+ <graph_items>
+ <graph_item>
+ <drawtype>GRADIENT_LINE</drawtype>
+ <color>1A7C11</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.locks.total[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>1</sortorder>
+ <color>2774A4</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.locks.accessexclusive[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>2</sortorder>
+ <color>F63100</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.locks.accessshare[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>3</sortorder>
+ <color>A54F10</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.locks.exclusive[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>4</sortorder>
+ <color>FC6EA3</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.locks.rowexclusive[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>5</sortorder>
+ <color>6C59DC</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.locks.rowshare[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>6</sortorder>
+ <color>AC8C14</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.locks.sharerowexclusive[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>7</sortorder>
+ <color>611F27</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.locks.shareupdateexclusive[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>8</sortorder>
+ <color>F230E0</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.locks.share[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>9</sortorder>
+ <color>FFAD40</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.locks.share[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ </graph_items>
+ </graph_prototype>
+ <graph_prototype>
+ <name>DB {#DBNAME}: Number of bloating tables</name>
+ <graph_items>
+ <graph_item>
+ <drawtype>GRADIENT_LINE</drawtype>
+ <color>1A7C11</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.db.bloating_tables[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;,&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ </graph_items>
+ </graph_prototype>
+ <graph_prototype>
+ <name>DB {#DBNAME}: pg_stat_database metrics</name>
+ <graph_items>
+ <graph_item>
+ <color>1A7C11</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.dbstat.blks_hit.rate[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>1</sortorder>
+ <color>2774A4</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.dbstat.blks_read.rate[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>2</sortorder>
+ <color>F63100</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.dbstat.conflicts.rate[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>3</sortorder>
+ <color>A54F10</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.dbstat.deadlocks.rate[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>4</sortorder>
+ <color>FC6EA3</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.dbstat.temp_bytes.rate[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>5</sortorder>
+ <color>6C59DC</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.dbstat.temp_files.rate[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>6</sortorder>
+ <color>AC8C14</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.dbstat.tup_deleted.rate[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>7</sortorder>
+ <color>611F27</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.dbstat.tup_fetched.rate[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>8</sortorder>
+ <color>F230E0</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.dbstat.tup_inserted.rate[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>9</sortorder>
+ <color>FFAD40</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.dbstat.tup_returned.rate[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>10</sortorder>
+ <color>40CDFF</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.dbstat.tup_updated.rate[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>11</sortorder>
+ <color>40FFA0</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.dbstat.xact_commit.rate[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>12</sortorder>
+ <color>AE4500</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.dbstat.xact_rollback.rate[&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ </graph_items>
+ </graph_prototype>
+ <graph_prototype>
+ <name>DB {#DBNAME}: Size</name>
+ <graph_items>
+ <graph_item>
+ <drawtype>GRADIENT_LINE</drawtype>
+ <color>1A7C11</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.db.size[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;,&quot;{#DBNAME}&quot;]</key>
+ </item>
+ </graph_item>
+ </graph_items>
+ </graph_prototype>
+ </graph_prototypes>
+ </discovery_rule>
+ <discovery_rule>
+ <name>Replication Discovery</name>
+ <key>pgsql.replication.process.discovery[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ <delay>15m</delay>
+ <filter>
+ <evaltype>AND</evaltype>
+ <conditions>
+ <condition>
+ <macro>{#APPLICATION}</macro>
+ <value>{$PG.LLD.FILTER.APPLICATION}</value>
+ <formulaid>A</formulaid>
+ </condition>
+ </conditions>
+ </filter>
+ <item_prototypes>
+ <item_prototype>
+ <name>Application {#APPLICATION}: Replication flush lag</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.replication.process.flush_lag[&quot;{#APPLICATION}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <units>s</units>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: Application {#APPLICATION}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#APPLICATION}'].flush_lag</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.replication.process[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>Application {#APPLICATION}: Replication replay lag</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.replication.process.replay_lag[&quot;{#APPLICATION}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <units>s</units>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: Application {#APPLICATION}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#APPLICATION}'].replay_lag</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.replication.process[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ <item_prototype>
+ <name>Application {#APPLICATION}: Replication write lag</name>
+ <type>DEPENDENT</type>
+ <key>pgsql.replication.process.write_lag[&quot;{#APPLICATION}&quot;]</key>
+ <delay>0</delay>
+ <history>7d</history>
+ <value_type>FLOAT</value_type>
+ <units>s</units>
+ <application_prototypes>
+ <application_prototype>
+ <name>PostgreSQL: Application {#APPLICATION}</name>
+ </application_prototype>
+ </application_prototypes>
+ <preprocessing>
+ <step>
+ <type>JSONPATH</type>
+ <params>$['{#APPLICATION}'].write_lag</params>
+ </step>
+ </preprocessing>
+ <master_item>
+ <key>pgsql.replication.process[&quot;{$PG.URI}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key>
+ </master_item>
+ </item_prototype>
+ </item_prototypes>
+ <graph_prototypes>
+ <graph_prototype>
+ <name>Application {#APPLICATION}: Replication lag</name>
+ <graph_items>
+ <graph_item>
+ <color>1A7C11</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.replication.process.flush_lag[&quot;{#APPLICATION}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>1</sortorder>
+ <color>2774A4</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.replication.process.replay_lag[&quot;{#APPLICATION}&quot;]</key>
+ </item>
+ </graph_item>
+ <graph_item>
+ <sortorder>2</sortorder>
+ <color>F63100</color>
+ <item>
+ <host>Template DB PostgreSQL Agent 2</host>
+ <key>pgsql.replication.process.write_lag[&quot;{#APPLICATION}&quot;]</key>
+ </item>
+ </graph_item>
+ </graph_items>
+ </graph_prototype>
+ </graph_prototypes>
+ </discovery_rule>
+ </discovery_rules>
+ <macros>
+ <macro>
+ <macro>{$PG.CONFLICTS.MAX.WARN}</macro>
+ <value>0</value>
+ </macro>
+ <macro>
+ <macro>{$PG.CONN_TOTAL_PCT.MAX.WARN}</macro>
+ <value>90</value>
+ </macro>
+ <macro>
+ <macro>{$PG.DATABASE}</macro>
+ <value>postgres</value>
+ </macro>
+ <macro>
+ <macro>{$PG.DEADLOCKS.MAX.WARN}</macro>
+ <value>0</value>
+ </macro>
+ <macro>
+ <macro>{$PG.LLD.FILTER.APPLICATION}</macro>
+ <value>(.+)</value>
+ </macro>
+ <macro>
+ <macro>{$PG.LLD.FILTER.DBNAME}</macro>
+ <value>(.+)</value>
+ </macro>
+ <macro>
+ <macro>{$PG.PASSWORD}</macro>
+ <value>postgres</value>
+ </macro>
+ <macro>
+ <macro>{$PG.URI}</macro>
+ <value>tcp://localhost:5432</value>
+ </macro>
+ <macro>
+ <macro>{$PG.USER}</macro>
+ <value>postgres</value>
+ </macro>
+ </macros>
+ <screens>
+ <screen>
+ <name>PostgreSQL databases</name>
+ <hsize>2</hsize>
+ <vsize>5</vsize>
+ <screen_items>
+ <screen_item>
+ <resourcetype>20</resourcetype>
+ <style>0</style>
+ <resource>
+ <name>DB {#DBNAME}: pg_stat_database metrics</name>
+ <host>Template DB PostgreSQL Agent 2</host>
+ </resource>
+ <width>500</width>
+ <height>100</height>
+ <x>0</x>
+ <y>0</y>
+ <colspan>1</colspan>
+ <rowspan>1</rowspan>
+ <elements>25</elements>
+ <valign>0</valign>
+ <halign>0</halign>
+ <dynamic>0</dynamic>
+ <sort_triggers>0</sort_triggers>
+ <url />
+ <application />
+ <max_columns>3</max_columns>
+ </screen_item>
+ <screen_item>
+ <resourcetype>20</resourcetype>
+ <style>0</style>
+ <resource>
+ <name>DB {#DBNAME}: Locks</name>
+ <host>Template DB PostgreSQL Agent 2</host>
+ </resource>
+ <width>500</width>
+ <height>100</height>
+ <x>1</x>
+ <y>0</y>
+ <colspan>1</colspan>
+ <rowspan>1</rowspan>
+ <elements>25</elements>
+ <valign>0</valign>
+ <halign>0</halign>
+ <dynamic>0</dynamic>
+ <sort_triggers>0</sort_triggers>
+ <url />
+ <application />
+ <max_columns>3</max_columns>
+ </screen_item>
+ <screen_item>
+ <resourcetype>20</resourcetype>
+ <style>0</style>
+ <resource>
+ <name>DB {#DBNAME}: Size</name>
+ <host>Template DB PostgreSQL Agent 2</host>
+ </resource>
+ <width>500</width>
+ <height>100</height>
+ <x>0</x>
+ <y>1</y>
+ <colspan>1</colspan>
+ <rowspan>1</rowspan>
+ <elements>25</elements>
+ <valign>0</valign>
+ <halign>0</halign>
+ <dynamic>0</dynamic>
+ <sort_triggers>0</sort_triggers>
+ <url />
+ <application />
+ <max_columns>3</max_columns>
+ </screen_item>
+ <screen_item>
+ <resourcetype>20</resourcetype>
+ <style>0</style>
+ <resource>
+ <name>DB {#DBNAME}: Number of bloating tables</name>
+ <host>Template DB PostgreSQL Agent 2</host>
+ </resource>
+ <width>500</width>
+ <height>100</height>
+ <x>1</x>
+ <y>1</y>
+ <colspan>1</colspan>
+ <rowspan>1</rowspan>
+ <elements>25</elements>
+ <valign>0</valign>
+ <halign>0</halign>
+ <dynamic>0</dynamic>
+ <sort_triggers>0</sort_triggers>
+ <url />
+ <application />
+ <max_columns>3</max_columns>
+ </screen_item>
+ </screen_items>
+ </screen>
+ </screens>
+ </template>
+ </templates>
+ <value_maps>
+ <value_map>
+ <name>PostgreSQL recovery role</name>
+ <mappings>
+ <mapping>
+ <value>0</value>
+ <newvalue>Master</newvalue>
+ </mapping>
+ <mapping>
+ <value>1</value>
+ <newvalue>Standby</newvalue>
+ </mapping>
+ </mappings>
+ </value_map>
+ <value_map>
+ <name>PostgreSQL replication status</name>
+ <mappings>
+ <mapping>
+ <value>0</value>
+ <newvalue>Down</newvalue>
+ </mapping>
+ <mapping>
+ <value>1</value>
+ <newvalue>Up</newvalue>
+ </mapping>
+ <mapping>
+ <value>2</value>
+ <newvalue>Master</newvalue>
+ </mapping>
+ </mappings>
+ </value_map>
+ </value_maps>
</zabbix_export>