Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>4.4</version>
<date>2020-02-28T07:40:46Z</date>
<groups>
<group>
<name>Templates/Databases</name>
</group>
</groups>
<templates>
<template>
<template>Template DB PostgreSQL</template>
<name>Template DB PostgreSQL</name>
<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>Bgwriter: Buffers allocated per second</name>
<type>DEPENDENT</type>
<key>pgsql.bgwriter.buffers_alloc.rate</key>
<delay>0</delay>
<history>7d</history>
<value_type>FLOAT</value_type>
<units>Bps</units>
<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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>Bgwriter: Buffers written directly by a backend per second</name>
<type>DEPENDENT</type>
<key>pgsql.bgwriter.buffers_backend.rate</key>
<delay>0</delay>
<history>7d</history>
<value_type>FLOAT</value_type>
<units>Bps</units>
<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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>Bgwriter: Buffers backend fsync per second</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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>Bgwriter: Buffers written during checkpoints per second</name>
<type>DEPENDENT</type>
<key>pgsql.bgwriter.buffers_checkpoint.rate</key>
<delay>0</delay>
<history>7d</history>
<value_type>FLOAT</value_type>
<units>Bps</units>
<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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>Bgwriter: Buffers written by the background writer per second</name>
<type>DEPENDENT</type>
<key>pgsql.bgwriter.buffers_clean.rate</key>
<delay>0</delay>
<history>7d</history>
<value_type>FLOAT</value_type>
<units>Bps</units>
<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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>Bgwriter: Requested checkpoints per second</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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
<triggers>
<trigger>
<expression>{last()} &gt; {$PG.CHECKPOINTS_REQ.MAX.WARN}</expression>
<name>PostgreSQL: Required checkpoints occurs too frequently (over {$PG.CHECKPOINTS_REQ.MAX.WARN})</name>
<priority>AVERAGE</priority>
<description>Checkpoints are points in the sequence of transactions at which it is guaranteed that the heap and index data files have been updated with all information written before that checkpoint. At checkpoint time, all dirty data pages are flushed to disk and a special checkpoint record is written to the log file.&#13;
https://www.postgresql.org/docs/current/wal-configuration.html</description>
</trigger>
</triggers>
</item>
<item>
<name>Bgwriter: Scheduled checkpoints per second</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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>Bgwriter: Checkpoint sync time</name>
<type>DEPENDENT</type>
<key>pgsql.bgwriter.checkpoint_sync_time</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_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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>Bgwriter: Checkpoint write time</name>
<type>DEPENDENT</type>
<key>pgsql.bgwriter.checkpoint_write_time</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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>Bgwriter: Max written per second</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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>PostgreSQL: Get bgwriter</name>
<key>pgsql.bgwriter[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
<history>1h</history>
<trends>0</trends>
<value_type>TEXT</value_type>
<description>Statistics about the background writer process's activity</description>
<applications>
<application>
<name>Zabbix raw items</name>
</application>
</applications>
<triggers>
<trigger>
<expression>{nodata(30m)} = 1</expression>
<name>PostgreSQL: Failed to get items (no data for 30m)</name>
<priority>WARNING</priority>
<description>Zabbix has not received data for items for the last 30 minutes</description>
<dependencies>
<dependency>
<name>PostgreSQL: Service is down</name>
<expression>{Template DB PostgreSQL:pgsql.ping[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;].last()} = 0</expression>
</dependency>
</dependencies>
</trigger>
</triggers>
</item>
<item>
<name>Status: Cache hit ratio %</name>
<key>pgsql.cache.hit[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
<history>7d</history>
<value_type>FLOAT</value_type>
<units>%</units>
<description>Cache hit ratio</description>
<applications>
<application>
<name>PostgreSQL</name>
</application>
</applications>
<triggers>
<trigger>
<expression>{max(5m)} &lt; {$PG.CACHE_HITRATIO.MIN.WARN}</expression>
<name>PostgreSQL: Cache hit ratio too low (under {$PG.CACHE_HITRATIO.MIN.WARN} in 5m)</name>
<priority>WARNING</priority>
</trigger>
</triggers>
</item>
<item>
<name>Status: Config hash</name>
<key>pgsql.config.hash[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
<delay>15m</delay>
<history>7d</history>
<trends>0</trends>
<value_type>TEXT</value_type>
<description>PostgreSQL configuration hash</description>
<applications>
<application>
<name>PostgreSQL</name>
</application>
</applications>
<preprocessing>
<step>
<type>DISCARD_UNCHANGED_HEARTBEAT</type>
<params>1h</params>
</step>
</preprocessing>
<triggers>
<trigger>
<expression>{diff()}=1 and {strlen()}&gt;0</expression>
<name>PostgreSQL: Configuration has changed</name>
<priority>INFO</priority>
</trigger>
</triggers>
</item>
<item>
<name>Connections sum: Active</name>
<type>DEPENDENT</type>
<key>pgsql.connections.sum.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.sum[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>Connections sum: Idle</name>
<type>DEPENDENT</type>
<key>pgsql.connections.sum.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.sum[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>Connections sum: Idle in transaction</name>
<type>DEPENDENT</type>
<key>pgsql.connections.sum.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.sum[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>Connections sum: Prepared</name>
<type>DEPENDENT</type>
<key>pgsql.connections.sum.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.sum[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>Connections sum: Total</name>
<type>DEPENDENT</type>
<key>pgsql.connections.sum.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.sum[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>Connections sum: Total %</name>
<type>DEPENDENT</type>
<key>pgsql.connections.sum.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.sum[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
<triggers>
<trigger>
<expression>{min(5m)} &gt; {$PG.CONN_TOTAL_PCT.MAX.WARN}</expression>
<name>PostgreSQL: 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.sum.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.sum[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>PostgreSQL: Get connections sum</name>
<key>pgsql.connections.sum[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
<history>1h</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>PostgreSQL: Get dbstat</name>
<key>pgsql.dbstat[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
<history>1h</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[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
<history>1h</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>Status: Ping time</name>
<key>pgsql.ping.time[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
<history>7d</history>
<value_type>FLOAT</value_type>
<units>ms</units>
<applications>
<application>
<name>PostgreSQL</name>
</application>
</applications>
<preprocessing>
<step>
<type>REGEX</type>
<params>Time:\s(\d+\.\d+)\sms
\1</params>
</step>
</preprocessing>
<triggers>
<trigger>
<expression>{min(5m)} &gt; {$PG.PING_TIME.MAX.WARN}</expression>
<name>PostgreSQL: Response too long (over {$PG.PING_TIME.MAX.WARN})</name>
<priority>AVERAGE</priority>
<dependencies>
<dependency>
<name>PostgreSQL: Service is down</name>
<expression>{Template DB PostgreSQL:pgsql.ping[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;].last()} = 0</expression>
</dependency>
</dependencies>
</trigger>
</triggers>
</item>
<item>
<name>Status: Ping</name>
<key>pgsql.ping[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
<history>7d</history>
<applications>
<application>
<name>PostgreSQL</name>
</application>
</applications>
<valuemap>
<name>Service state</name>
</valuemap>
<preprocessing>
<step>
<type>JAVASCRIPT</type>
<params>return value.search(/accepting connections/)&gt;0 ? 1 : 0</params>
</step>
<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>PostgreSQL: Get queries</name>
<key>pgsql.queries[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;,&quot;{$PG.QUERY_ETIME.MAX.WARN}&quot;]</key>
<history>1h</history>
<trends>0</trends>
<value_type>TEXT</value_type>
<description>Collect all metrics by query execution time</description>
<applications>
<application>
<name>Zabbix raw items</name>
</application>
</applications>
</item>
<item>
<name>Replication: standby count</name>
<key>pgsql.replication.count[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
<history>7d</history>
<description>Number of standby servers</description>
<applications>
<application>
<name>PostgreSQL</name>
</application>
</applications>
</item>
<item>
<name>Replication: lag in seconds</name>
<key>pgsql.replication.lag.sec[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
<history>7d</history>
<units>s</units>
<description>Replication lag with Master in seconds</description>
<applications>
<application>
<name>PostgreSQL</name>
</application>
</applications>
<triggers>
<trigger>
<expression>{min(5m)} &gt; {$PG.REPL_LAG.MAX.WARN}</expression>
<name>PostgreSQL: Streaming lag with {#MASTER} is too high (over {$PG.REPL_LAG.MAX.WARN} in 5m)</name>
<priority>AVERAGE</priority>
</trigger>
</triggers>
</item>
<item>
<name>Replication: recovery role</name>
<key>pgsql.replication.recovery_role[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&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>
<triggers>
<trigger>
<expression>{max(5m)}=0</expression>
<name>PostgreSQL: Replication is down</name>
<priority>AVERAGE</priority>
</trigger>
</triggers>
</item>
<item>
<name>Transactions: Max active transaction time</name>
<type>DEPENDENT</type>
<key>pgsql.transactions.active</key>
<delay>0</delay>
<history>7d</history>
<value_type>FLOAT</value_type>
<units>s</units>
<description>Current max active transaction time</description>
<applications>
<application>
<name>PostgreSQL</name>
</application>
</applications>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$.active</params>
</step>
</preprocessing>
<master_item>
<key>pgsql.transactions[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>Transactions: Max idle transaction time</name>
<type>DEPENDENT</type>
<key>pgsql.transactions.idle</key>
<delay>0</delay>
<history>7d</history>
<value_type>FLOAT</value_type>
<units>s</units>
<description>Current max idle transaction time</description>
<applications>
<application>
<name>PostgreSQL</name>
</application>
</applications>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$.idle</params>
</step>
</preprocessing>
<master_item>
<key>pgsql.transactions[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>Transactions: Max prepared transaction time</name>
<type>DEPENDENT</type>
<key>pgsql.transactions.prepared</key>
<delay>0</delay>
<history>7d</history>
<value_type>FLOAT</value_type>
<units>s</units>
<description>Current max prepared transaction time</description>
<applications>
<application>
<name>PostgreSQL</name>
</application>
</applications>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$.prepared</params>
</step>
</preprocessing>
<master_item>
<key>pgsql.transactions[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>Transactions: Max waiting transaction time</name>
<type>DEPENDENT</type>
<key>pgsql.transactions.waiting</key>
<delay>0</delay>
<history>7d</history>
<value_type>FLOAT</value_type>
<units>s</units>
<description>Current max waiting transaction time</description>
<applications>
<application>
<name>PostgreSQL</name>
</application>
</applications>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$.waiting</params>
</step>
</preprocessing>
<master_item>
<key>pgsql.transactions[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>PostgreSQL: Get transactions</name>
<key>pgsql.transactions[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
<history>1h</history>
<trends>0</trends>
<value_type>TEXT</value_type>
<description>Collect metrics by transaction execution time</description>
<applications>
<application>
<name>Zabbix raw items</name>
</application>
</applications>
</item>
<item>
<name>Status: Uptime</name>
<key>pgsql.uptime[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
<history>7d</history>
<units>uptime</units>
<applications>
<application>
<name>PostgreSQL</name>
</application>
</applications>
<triggers>
<trigger>
<expression>{last()} &lt; 10m</expression>
<name>PostgreSQL: Service has been restarted (uptime &lt; 10m)</name>
<priority>INFO</priority>
<description>PostgreSQL uptime is less than 10 minutes</description>
</trigger>
</triggers>
</item>
<item>
<name>Status: Version</name>
<key>pgsql.version[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
<delay>15m</delay>
<history>7d</history>
<trends>0</trends>
<value_type>CHAR</value_type>
<description>PostgreSQL version</description>
<applications>
<application>
<name>PostgreSQL</name>
</application>
</applications>
<preprocessing>
<step>
<type>DISCARD_UNCHANGED_HEARTBEAT</type>
<params>1d</params>
</step>
</preprocessing>
<triggers>
<trigger>
<expression>{diff()}=1 and {strlen()}&gt;0</expression>
<name>PostgreSQL: Version has changed (new version value received: {ITEM.VALUE})</name>
<priority>INFO</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>$.count</params>
</step>
</preprocessing>
<master_item>
<key>pgsql.wal.stat[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
<item>
<name>PostgreSQL: Get WAL</name>
<key>pgsql.wal.stat[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
<delay>5m</delay>
<history>1h</history>
<trends>0</trends>
<value_type>TEXT</value_type>
<description>Master item to 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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item>
</items>
<discovery_rules>
<discovery_rule>
<name>Database discovery</name>
<key>pgsql.discovery.db[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
<delay>1h</delay>
<filter>
<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 size</name>
<key>pgsql.db.size[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;,&quot;{#DBNAME}&quot;]</key>
<delay>15m</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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
<trigger_prototypes>
<trigger_prototype>
<expression>{min(5m)} &gt; {$PG.CONFLICTS.MAX.WARN:&quot;{#DBNAME}&quot;}</expression>
<name>Database {#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[&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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
<trigger_prototypes>
<trigger_prototype>
<expression>{min(5m)} &gt; {$PG.DEADLOCKS.MAX.WARN:&quot;{#DBNAME}&quot;}</expression>
<name>Database {#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}: 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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&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>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_returned</params>
</step>
<step>
<type>CHANGE_PER_SECOND</type>
<params/>
</step>
</preprocessing>
<master_item>
<key>pgsql.dbstat[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
</item_prototype>
<item_prototype>
<name>DB {#DBNAME}: Frozen XID before avtovacuum %</name>
<type>DEPENDENT</type>
<key>pgsql.frozenxid.prc_before_av[&quot;{#DBNAME}&quot;]</key>
<delay>0</delay>
<history>7d</history>
<value_type>FLOAT</value_type>
<units>%</units>
<description>reventing Transaction ID Wraparound Failures&#13;
https://www.postgresql.org/docs/current/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND</description>
<application_prototypes>
<application_prototype>
<name>PostgreSQL: DB {#DBNAME}</name>
</application_prototype>
</application_prototypes>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$.prc_before_av</params>
</step>
</preprocessing>
<master_item>
<key>pgsql.frozenxid[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{#DBNAME}&quot;]</key>
</master_item>
</item_prototype>
<item_prototype>
<name>DB {#DBNAME}: Frozen XID before stop %</name>
<type>DEPENDENT</type>
<key>pgsql.frozenxid.prc_before_stop[&quot;{#DBNAME}&quot;]</key>
<delay>0</delay>
<history>7d</history>
<value_type>FLOAT</value_type>
<units>%</units>
<description>Preventing Transaction ID Wraparound Failures&#13;
https://www.postgresql.org/docs/current/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND</description>
<application_prototypes>
<application_prototype>
<name>PostgreSQL: DB {#DBNAME}</name>
</application_prototype>
</application_prototypes>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$.prc_before_stop</params>
</step>
</preprocessing>
<master_item>
<key>pgsql.frozenxid[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{#DBNAME}&quot;]</key>
</master_item>
<trigger_prototypes>
<trigger_prototype>
<expression>{last()}&lt;{$PG.FROZENXID_PCT_STOP.MIN.HIGH:&quot;{#DBNAME}&quot;}</expression>
<name>Database {#DBNAME}: VACUUM FREEZE is required to prevent wraparound (frozen XID less then {$PG.FROZENXID_PCT_STOP.MIN.HIGH:&quot;{#DBNAME}&quot;} %)</name>
<priority>AVERAGE</priority>
<description>Preventing Transaction ID Wraparound Failures&#13;
https://www.postgresql.org/docs/current/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND</description>
</trigger_prototype>
</trigger_prototypes>
</item_prototype>
<item_prototype>
<name>DB {#DBNAME}: Get frozen XID</name>
<key>pgsql.frozenxid[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{#DBNAME}&quot;]</key>
<history>1h</history>
<trends>0</trends>
<value_type>TEXT</value_type>
<applications>
<application>
<name>Zabbix raw items</name>
</application>
</applications>
</item_prototype>
<item_prototype>
<name>DB {#DBNAME}: Locks total</name>
<type>DEPENDENT</type>
<key>pgsql.locks.total[&quot;{#DBNAME}&quot;]</key>
<delay>0</delay>
<history>7d</history>
<description>Total number of locks in the 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.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</master_item>
<trigger_prototypes>
<trigger_prototype>
<expression>{min(5m)}&gt;{$PG.LOCKS.MAX.WARN:&quot;{#DBNAME}&quot;}</expression>
<name>Database {#DBNAME}: Number of locks is too high (over {$PG.LOCKS.MAX.WARN:&quot;{#DBNAME}&quot;} in 5m)</name>
<priority>WARNING</priority>
</trigger_prototype>
</trigger_prototypes>
</item_prototype>
<item_prototype>
<name>DB {#DBNAME}: Queries slow maintenance count</name>
<type>DEPENDENT</type>
<key>pgsql.queries.mro.slow_count[&quot;{#DBNAME}&quot;]</key>
<delay>0</delay>
<history>7d</history>
<description>Slow maintenance query count</description>
<application_prototypes>
<application_prototype>
<name>PostgreSQL: DB {#DBNAME}</name>
</application_prototype>
</application_prototypes>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$['{#DBNAME}'].mro_slow_count</params>
</step>
</preprocessing>
<master_item>
<key>pgsql.queries[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;,&quot;{$PG.QUERY_ETIME.MAX.WARN}&quot;]</key>
</master_item>
</item_prototype>
<item_prototype>
<name>DB {#DBNAME}: Queries max maintenance time</name>
<type>DEPENDENT</type>
<key>pgsql.queries.mro.time_max[&quot;{#DBNAME}&quot;]</key>
<delay>0</delay>
<history>7d</history>
<units>s</units>
<description>Max maintenance query time</description>
<application_prototypes>
<application_prototype>
<name>PostgreSQL: DB {#DBNAME}</name>
</application_prototype>
</application_prototypes>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$['{#DBNAME}'].mro_time_max</params>
</step>
</preprocessing>
<master_item>
<key>pgsql.queries[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;,&quot;{$PG.QUERY_ETIME.MAX.WARN}&quot;]</key>
</master_item>
</item_prototype>
<item_prototype>
<name>DB {#DBNAME}: Queries sum maintenance time</name>
<type>DEPENDENT</type>
<key>pgsql.queries.mro.time_sum[&quot;{#DBNAME}&quot;]</key>
<delay>0</delay>
<history>7d</history>
<units>s</units>
<description>Sum maintenance query time</description>
<application_prototypes>
<application_prototype>
<name>PostgreSQL: DB {#DBNAME}</name>
</application_prototype>
</application_prototypes>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$['{#DBNAME}'].mro_time_sum</params>
</step>
</preprocessing>
<master_item>
<key>pgsql.queries[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;,&quot;{$PG.QUERY_ETIME.MAX.WARN}&quot;]</key>
</master_item>
</item_prototype>
<item_prototype>
<name>DB {#DBNAME}: Queries slow query count</name>
<type>DEPENDENT</type>
<key>pgsql.queries.query.slow_count[&quot;{#DBNAME}&quot;]</key>
<delay>0</delay>
<history>7d</history>
<description>Slow query count</description>
<application_prototypes>
<application_prototype>
<name>PostgreSQL: DB {#DBNAME}</name>
</application_prototype>
</application_prototypes>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$['{#DBNAME}'].query_slow_count</params>
</step>
</preprocessing>
<master_item>
<key>pgsql.queries[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;,&quot;{$PG.QUERY_ETIME.MAX.WARN}&quot;]</key>
</master_item>
<trigger_prototypes>
<trigger_prototype>
<expression>{min(5m)}&gt;{$PG.SLOW_QUERIES.MAX.WARN:&quot;{#DBNAME}&quot;}</expression>
<name>Database {#DBNAME}: Too many slow queries (over {$PG.SLOW_QUERIES.MAX.WARN:&quot;{#DBNAME}&quot;} in 5m)</name>
<priority>WARNING</priority>
</trigger_prototype>
</trigger_prototypes>
</item_prototype>
<item_prototype>
<name>DB {#DBNAME}: Queries max query time</name>
<type>DEPENDENT</type>
<key>pgsql.queries.query.time_max[&quot;{#DBNAME}&quot;]</key>
<delay>0</delay>
<history>7d</history>
<units>s</units>
<description>Max query time</description>
<application_prototypes>
<application_prototype>
<name>PostgreSQL: DB {#DBNAME}</name>
</application_prototype>
</application_prototypes>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$['{#DBNAME}'].query_time_max</params>
</step>
</preprocessing>
<master_item>
<key>pgsql.queries[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;,&quot;{$PG.QUERY_ETIME.MAX.WARN}&quot;]</key>
</master_item>
</item_prototype>
<item_prototype>
<name>DB {#DBNAME}: Queries sum query time</name>
<type>DEPENDENT</type>
<key>pgsql.queries.query.time_sum[&quot;{#DBNAME}&quot;]</key>
<delay>0</delay>
<history>7d</history>
<units>s</units>
<description>Sum query time</description>
<application_prototypes>
<application_prototype>
<name>PostgreSQL: DB {#DBNAME}</name>
</application_prototype>
</application_prototypes>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$['{#DBNAME}'].query_time_sum</params>
</step>
</preprocessing>
<master_item>
<key>pgsql.queries[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;,&quot;{$PG.QUERY_ETIME.MAX.WARN}&quot;]</key>
</master_item>
</item_prototype>
<item_prototype>
<name>DB {#DBNAME}: Queries slow transaction count</name>
<type>DEPENDENT</type>
<key>pgsql.queries.tx.slow_count[&quot;{#DBNAME}&quot;]</key>
<delay>0</delay>
<history>7d</history>
<description>Slow transaction query count</description>
<application_prototypes>
<application_prototype>
<name>PostgreSQL: DB {#DBNAME}</name>
</application_prototype>
</application_prototypes>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$['{#DBNAME}'].tx_slow_count</params>
</step>
</preprocessing>
<master_item>
<key>pgsql.queries[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;,&quot;{$PG.QUERY_ETIME.MAX.WARN}&quot;]</key>
</master_item>
</item_prototype>
<item_prototype>
<name>DB {#DBNAME}: Queries max transaction time</name>
<type>DEPENDENT</type>
<key>pgsql.queries.tx.time_max[&quot;{#DBNAME}&quot;]</key>
<delay>0</delay>
<history>7d</history>
<units>s</units>
<description>Max transaction query time</description>
<application_prototypes>
<application_prototype>
<name>PostgreSQL: DB {#DBNAME}</name>
</application_prototype>
</application_prototypes>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$['{#DBNAME}'].tx_time_max</params>
</step>
</preprocessing>
<master_item>
<key>pgsql.queries[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;,&quot;{$PG.QUERY_ETIME.MAX.WARN}&quot;]</key>
</master_item>
</item_prototype>
<item_prototype>
<name>DB {#DBNAME}: Queries sum transaction time</name>
<type>DEPENDENT</type>
<key>pgsql.queries.tx.time_sum[&quot;{#DBNAME}&quot;]</key>
<delay>0</delay>
<history>7d</history>
<units>s</units>
<description>Sum transaction query time</description>
<application_prototypes>
<application_prototype>
<name>PostgreSQL: DB {#DBNAME}</name>
</application_prototype>
</application_prototypes>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$['{#DBNAME}'].tx_time_sum</params>
</step>
</preprocessing>
<master_item>
<key>pgsql.queries[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;,&quot;{$PG.QUERY_ETIME.MAX.WARN}&quot;]</key>
</master_item>
</item_prototype>
<item_prototype>
<name>DB {#DBNAME}: Index scans per second</name>
<type>DEPENDENT</type>
<key>pgsql.scans.idx.rate[&quot;{#DBNAME}&quot;]</key>
<delay>0</delay>
<history>7d</history>
<description>Number of index scans in the database</description>
<application_prototypes>
<application_prototype>
<name>PostgreSQL: DB {#DBNAME}</name>
</application_prototype>
</application_prototypes>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$.idx</params>
</step>
<step>
<type>CHANGE_PER_SECOND</type>
<params/>
</step>
</preprocessing>
<master_item>
<key>pgsql.scans[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{#DBNAME}&quot;]</key>
</master_item>
</item_prototype>
<item_prototype>
<name>DB {#DBNAME}: Sequential scans per second</name>
<type>DEPENDENT</type>
<key>pgsql.scans.seq.rate[&quot;{#DBNAME}&quot;]</key>
<delay>0</delay>
<history>7d</history>
<value_type>FLOAT</value_type>
<description>Number of sequential scans in the database</description>
<application_prototypes>
<application_prototype>
<name>PostgreSQL: DB {#DBNAME}</name>
</application_prototype>
</application_prototypes>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$.seq</params>
</step>
<step>
<type>CHANGE_PER_SECOND</type>
<params/>
</step>
</preprocessing>
<master_item>
<key>pgsql.scans[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{#DBNAME}&quot;]</key>
</master_item>
</item_prototype>
<item_prototype>
<name>DB {#DBNAME}: Get scans</name>
<key>pgsql.scans[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{#DBNAME}&quot;]</key>
<history>1h</history>
<trends>0</trends>
<value_type>TEXT</value_type>
<description>Number of scans done for table/index in the database</description>
<applications>
<application>
<name>Zabbix raw items</name>
</application>
</applications>
</item_prototype>
</item_prototypes>
<graph_prototypes>
<graph_prototype>
<name>DB {#DBNAME}: Block hit/read</name>
<ymin_type_1>FIXED</ymin_type_1>
<graph_items>
<graph_item>
<color>66BB6A</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.dbstat.blks_hit.rate[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<color>42A5F5</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.dbstat.blks_read.rate[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph_prototype>
<graph_prototype>
<name>DB {#DBNAME}: Database size</name>
<ymin_type_1>FIXED</ymin_type_1>
<graph_items>
<graph_item>
<color>66BB6A</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.db.size[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;,&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph_prototype>
<graph_prototype>
<name>DB {#DBNAME}: Events</name>
<ymin_type_1>FIXED</ymin_type_1>
<graph_items>
<graph_item>
<drawtype>GRADIENT_LINE</drawtype>
<color>1A7C11</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.dbstat.xact_commit.rate[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<color>F63100</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.dbstat.conflicts.rate[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<color>2774A4</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.dbstat.deadlocks.rate[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>3</sortorder>
<color>A54F10</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.dbstat.xact_rollback.rate[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph_prototype>
<graph_prototype>
<name>DB {#DBNAME}: Locks</name>
<ymin_type_1>FIXED</ymin_type_1>
<graph_items>
<graph_item>
<color>EC407A</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.locks.total[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph_prototype>
<graph_prototype>
<name>DB {#DBNAME}: Queries</name>
<ymin_type_1>FIXED</ymin_type_1>
<graph_items>
<graph_item>
<color>4CAF50</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.queries.mro.time_max[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<color>03A9F4</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.queries.query.time_max[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<color>9C27B0</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.queries.tx.time_max[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>3</sortorder>
<drawtype>GRADIENT_LINE</drawtype>
<color>81C784</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.queries.mro.time_sum[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>4</sortorder>
<drawtype>GRADIENT_LINE</drawtype>
<color>90CAF9</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.queries.query.time_sum[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>5</sortorder>
<drawtype>GRADIENT_LINE</drawtype>
<color>CE93D8</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.queries.tx.time_sum[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph_prototype>
<graph_prototype>
<name>DB {#DBNAME}: Slow queries</name>
<ymin_type_1>FIXED</ymin_type_1>
<graph_items>
<graph_item>
<color>1A7C11</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.queries.mro.slow_count[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<color>F63100</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.queries.query.slow_count[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<color>2774A4</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.queries.tx.slow_count[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph_prototype>
<graph_prototype>
<name>DB {#DBNAME}: Temp files</name>
<graph_items>
<graph_item>
<drawtype>GRADIENT_LINE</drawtype>
<color>66BB6A</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.dbstat.temp_bytes.rate[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<color>42A5F5</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.dbstat.temp_files.rate[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph_prototype>
<graph_prototype>
<name>DB {#DBNAME}: Tuples</name>
<ymin_type_1>FIXED</ymin_type_1>
<graph_items>
<graph_item>
<color>1A7C11</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.dbstat.tup_deleted.rate[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<color>F63100</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.dbstat.tup_fetched.rate[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<color>2774A4</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.dbstat.tup_inserted.rate[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>3</sortorder>
<color>A54F10</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.dbstat.tup_returned.rate[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>4</sortorder>
<color>FC6EA3</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.dbstat.tup_updated.rate[&quot;{#DBNAME}&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph_prototype>
</graph_prototypes>
</discovery_rule>
</discovery_rules>
<macros>
<macro>
<macro>{$PG.CACHE_HITRATIO.MIN.WARN}</macro>
<value>90</value>
</macro>
<macro>
<macro>{$PG.CHECKPOINTS_REQ.MAX.WARN}</macro>
<value>5</value>
</macro>
<macro>
<macro>{$PG.CONFLICTS.MAX.WARN}</macro>
<value>0</value>
</macro>
<macro>
<macro>{$PG.CONN_IDLE_IN_TRANS.MAX.WARN}</macro>
<value>5</value>
</macro>
<macro>
<macro>{$PG.CONN_TOTAL_PCT.MAX.WARN}</macro>
<value>90</value>
</macro>
<macro>
<macro>{$PG.CONN_WAIT.MAX.WARN}</macro>
<value>0</value>
</macro>
<macro>
<macro>{$PG.DB}</macro>
<value>postgres</value>
</macro>
<macro>
<macro>{$PG.DEADLOCKS.MAX.WARN}</macro>
<value>0</value>
</macro>
<macro>
<macro>{$PG.FROZENXID_PCT_STOP.MIN.HIGH}</macro>
<value>75</value>
</macro>
<macro>
<macro>{$PG.HOST}</macro>
<value>127.0.0.1</value>
</macro>
<macro>
<macro>{$PG.LLD.FILTER.DBNAME}</macro>
<value>(.*)</value>
</macro>
<macro>
<macro>{$PG.LOCKS.MAX.WARN}</macro>
<value>100</value>
</macro>
<macro>
<macro>{$PG.PING_TIME.MAX.WARN}</macro>
<value>1s</value>
</macro>
<macro>
<macro>{$PG.PORT}</macro>
<value>5432</value>
</macro>
<macro>
<macro>{$PG.QUERY_ETIME.MAX.WARN}</macro>
<value>30</value>
</macro>
<macro>
<macro>{$PG.REPL_LAG.MAX.WARN}</macro>
<value>10m</value>
</macro>
<macro>
<macro>{$PG.SLOW_QUERIES.MAX.WARN}</macro>
<value>5</value>
</macro>
<macro>
<macro>{$PG.TRANS_ACTIVE.MAX.WARN}</macro>
<value>30s</value>
</macro>
<macro>
<macro>{$PG.TRANS_IDLE.MAX.WARN}</macro>
<value>30s</value>
</macro>
<macro>
<macro>{$PG.TRANS_WAIT.MAX.WARN}</macro>
<value>30s</value>
</macro>
<macro>
<macro>{$PG.USER}</macro>
<value>zbx_monitor</value>
</macro>
</macros>
<screens>
<screen>
<name>PostgreSQL databases</name>
<hsize>2</hsize>
<vsize>4</vsize>
<screen_items>
<screen_item>
<resourcetype>20</resourcetype>
<style>0</style>
<resource>
<name>DB {#DBNAME}: Tuples</name>
<host>Template DB PostgreSQL</host>
</resource>
<width>750</width>
<height>200</height>
<x>0</x>
<y>0</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</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}: Events</name>
<host>Template DB PostgreSQL</host>
</resource>
<width>750</width>
<height>200</height>
<x>1</x>
<y>0</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</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}: Block hit/read</name>
<host>Template DB PostgreSQL</host>
</resource>
<width>750</width>
<height>200</height>
<x>0</x>
<y>1</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</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}: Temp files</name>
<host>Template DB PostgreSQL</host>
</resource>
<width>750</width>
<height>200</height>
<x>1</x>
<y>1</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</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</host>
</resource>
<width>750</width>
<height>200</height>
<x>0</x>
<y>2</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</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}: Database size</name>
<host>Template DB PostgreSQL</host>
</resource>
<width>750</width>
<height>200</height>
<x>1</x>
<y>2</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</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}: Queries</name>
<host>Template DB PostgreSQL</host>
</resource>
<width>750</width>
<height>200</height>
<x>0</x>
<y>3</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</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}: Slow queries</name>
<host>Template DB PostgreSQL</host>
</resource>
<width>750</width>
<height>200</height>
<x>1</x>
<y>3</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</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>
<screen>
<name>PostgreSQL stat</name>
<hsize>2</hsize>
<vsize>4</vsize>
<screen_items>
<screen_item>
<resourcetype>0</resourcetype>
<style>0</style>
<resource>
<name>PostgreSQL connections</name>
<host>Template DB PostgreSQL</host>
</resource>
<width>750</width>
<height>200</height>
<x>0</x>
<y>0</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</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>0</resourcetype>
<style>0</style>
<resource>
<name>PostgreSQL transactions</name>
<host>Template DB PostgreSQL</host>
</resource>
<width>750</width>
<height>200</height>
<x>1</x>
<y>0</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</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>0</resourcetype>
<style>0</style>
<resource>
<name>PostgreSQL ping</name>
<host>Template DB PostgreSQL</host>
</resource>
<width>750</width>
<height>200</height>
<x>0</x>
<y>1</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</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>0</resourcetype>
<style>0</style>
<resource>
<name>PostgreSQL uptime</name>
<host>Template DB PostgreSQL</host>
</resource>
<width>750</width>
<height>200</height>
<x>1</x>
<y>1</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</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>0</resourcetype>
<style>0</style>
<resource>
<name>PostgreSQL replication lag</name>
<host>Template DB PostgreSQL</host>
</resource>
<width>750</width>
<height>200</height>
<x>0</x>
<y>2</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</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>0</resourcetype>
<style>0</style>
<resource>
<name>PostgreSQL WAL</name>
<host>Template DB PostgreSQL</host>
</resource>
<width>750</width>
<height>200</height>
<x>1</x>
<y>2</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</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>0</resourcetype>
<style>0</style>
<resource>
<name>PostgreSQL bgwriter</name>
<host>Template DB PostgreSQL</host>
</resource>
<width>750</width>
<height>200</height>
<x>0</x>
<y>3</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</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>0</resourcetype>
<style>0</style>
<resource>
<name>PostgreSQL checkpoints</name>
<host>Template DB PostgreSQL</host>
</resource>
<width>750</width>
<height>200</height>
<x>1</x>
<y>3</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</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>
<graphs>
<graph>
<name>PostgreSQL bgwriter</name>
<ymin_type_1>FIXED</ymin_type_1>
<graph_items>
<graph_item>
<color>1A7C11</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.bgwriter.buffers_alloc.rate</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<color>F63100</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.bgwriter.buffers_clean.rate</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<color>2774A4</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.bgwriter.buffers_backend.rate</key>
</item>
</graph_item>
<graph_item>
<sortorder>3</sortorder>
<color>A54F10</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.bgwriter.buffers_checkpoint.rate</key>
</item>
</graph_item>
<graph_item>
<sortorder>4</sortorder>
<color>FC6EA3</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.bgwriter.maxwritten_clean.rate</key>
</item>
</graph_item>
<graph_item>
<sortorder>5</sortorder>
<color>6C59DC</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.bgwriter.buffers_backend_fsync.rate</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>PostgreSQL checkpoints</name>
<ymin_type_1>FIXED</ymin_type_1>
<graph_items>
<graph_item>
<color>1A7C11</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.bgwriter.checkpoints_timed.rate</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<color>F63100</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.bgwriter.checkpoints_req.rate</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<color>2774A4</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.bgwriter.checkpoint_sync_time</key>
</item>
</graph_item>
<graph_item>
<sortorder>3</sortorder>
<color>A54F10</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.bgwriter.checkpoint_write_time</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>PostgreSQL connections</name>
<ymin_type_1>FIXED</ymin_type_1>
<graph_items>
<graph_item>
<drawtype>GRADIENT_LINE</drawtype>
<color>C8E6C9</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.connections.sum.total</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<color>6C59DC</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.connections.sum.total_pct</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<color>1A7C11</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.connections.sum.active</key>
</item>
</graph_item>
<graph_item>
<sortorder>3</sortorder>
<color>F63100</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.connections.sum.idle</key>
</item>
</graph_item>
<graph_item>
<sortorder>4</sortorder>
<color>2774A4</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.connections.sum.idle_in_transaction</key>
</item>
</graph_item>
<graph_item>
<sortorder>5</sortorder>
<color>A54F10</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.connections.sum.prepared</key>
</item>
</graph_item>
<graph_item>
<sortorder>6</sortorder>
<color>AC8C14</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.connections.sum.waiting</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>PostgreSQL ping</name>
<ymin_type_1>FIXED</ymin_type_1>
<graph_items>
<graph_item>
<drawtype>GRADIENT_LINE</drawtype>
<color>A5D6A7</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.ping[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<color>039BE5</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.ping.time[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>PostgreSQL replication lag</name>
<ymin_type_1>FIXED</ymin_type_1>
<graph_items>
<graph_item>
<color>42A5F5</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.replication.lag.sec[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>PostgreSQL transactions</name>
<ymin_type_1>FIXED</ymin_type_1>
<graph_items>
<graph_item>
<color>1A7C11</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.transactions.active</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<color>F63100</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.transactions.idle</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<color>2774A4</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.transactions.prepared</key>
</item>
</graph_item>
<graph_item>
<sortorder>3</sortorder>
<color>A54F10</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.transactions.waiting</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>PostgreSQL uptime</name>
<show_triggers>NO</show_triggers>
<ymin_type_1>FIXED</ymin_type_1>
<graph_items>
<graph_item>
<color>66BB6A</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.uptime[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<color>03A9F4</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.cache.hit[&quot;{$PG.HOST}&quot;,&quot;{$PG.PORT}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.DB}&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>PostgreSQL WAL</name>
<ymin_type_1>FIXED</ymin_type_1>
<graph_items>
<graph_item>
<color>29B6F6</color>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.wal.write</key>
</item>
</graph_item>
<graph_item>
<sortorder>1</sortorder>
<color>AB47BC</color>
<yaxisside>RIGHT</yaxisside>
<item>
<host>Template DB PostgreSQL</host>
<key>pgsql.wal.count</key>
</item>
</graph_item>
</graph_items>
</graph>
</graphs>
<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_map>
<name>Service state</name>
<mappings>
<mapping>
<value>0</value>
<newvalue>Down</newvalue>
</mapping>
<mapping>
<value>1</value>
<newvalue>Up</newvalue>
</mapping>
</mappings>
</value_map>
</value_maps>
</zabbix_export>
@sunrules

This comment has been minimized.

Copy link

@sunrules sunrules commented Jan 11, 2021

Hi
This template is not for redis - this is for PostgreSQL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment