Files
Zabbix/config-mover/export/10624/template_PostgreSQL by Zabbix agent 2.xml

47 lines
92 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export><version>7.4</version><template_groups><template_group><uuid>748ad4d098d447d492bb935c907f652f</uuid><name>Templates/Databases</name></template_group></template_groups><templates><template><uuid>d0ef7d659a8f4beaaabfc4b6134e737a</uuid><template>PostgreSQL by Zabbix agent 2</template><name>PostgreSQL by Zabbix agent 2</name><description>This template is designed for the deployment of PostgreSQL monitoring by Zabbix via Zabbix agent 2 and uses a loadable plugin to run SQL queries.
Setup:
1. Deploy Zabbix agent 2 with the PostgreSQL plugin. Starting with Zabbix versions 6.0.10 / 6.2.4 / 6.4 PostgreSQL metrics are moved to a loadable plugin and require installation of a separate package or compilation of the plugin from sources (https://www.zabbix.com/documentation/7.0/manual/extensions/plugins/build).
2. Create the PostgreSQL user for monitoring (`&lt;password&gt;` at your discretion) and inherit permissions from the default role `pg_monitor`:
CREATE USER zbx_monitor WITH PASSWORD '&lt;PASSWORD&gt;' INHERIT;
GRANT pg_monitor TO zbx_monitor;
3. Edit the `pg_hba.conf` configuration file to allow connections for the user `zbx_monitor`. You can check the PostgreSQL documentation for examples (https://www.postgresql.org/docs/current/auth-pg-hba-conf.html).
4. Set the connection string for the PostgreSQL instance in the `{$PG.CONNSTRING}` macro as URI, such as `&lt;protocol(host:port)&gt;`, or specify the named session - `&lt;sessionname&gt;`.
Note: if you want to use SSL/TLS encryption to protect communications with the remote PostgreSQL instance, a named session must be used. In that case, the instance URI should be specified in the `Plugins.PostgreSQL.Sessions.*.Uri` parameter in the PostgreSQL plugin configuration files alongside all the encryption parameters (type, cerfiticate/key filepaths if needed etc.).
You can check the PostgreSQL plugin documentation (https://git.zabbix.com/projects/AP/repos/postgresql/browse?at=refs%2Fheads%2Frelease%2F7.0) for details about agent plugin parameters and named sessions.
Also, it is assumed that you set up the PostgreSQL instance to work in the desired encryption mode. Check the PostgreSQL documentation (https://www.postgresql.org/docs/current/ssl-tcp.html) for details.
Note that plugin TLS certificate validation relies on checking the Subject Alternative Names (SAN) instead of the Common Name (CN), check the cryptography package documentation (https://pkg.go.dev/crypto/x509) for details.
For example, to enable required encryption in transport mode without identity checks you could create the file `/etc/zabbix/zabbix_agent2.d/postgresql_myconn.conf` with the following configuration for the named session `myconn` (replace `&lt;instanceip&gt;` with the address of the PostgreSQL instance):
Plugins.PostgreSQL.Sessions.myconn.Uri=tcp://&lt;instanceip&gt;:5432
Plugins.PostgreSQL.Sessions.myconn.TLSConnect=required
Then set the `{$PG.CONNSTRING}` macro to `myconn` to use this named session.
5. Set the password that you specified in step 2 in the macro `{$PG.PASSWORD}`.
You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384190-%C2%A0discussion-thread-for-official-zabbix-template-db-postgresql
Generated by official Zabbix template tool &quot;Templator&quot;</description><vendor><name>Zabbix</name><version>7.0-0</version></vendor><groups><group><name>Templates/Databases</name></group></groups><items><item><uuid>04b1c83463f247b0a42f17c5d0a9ce14</uuid><name>Archive: Count of archived files</name><type>DEPENDENT</type><key>pgsql.archive.count_archived_files</key><history>7d</history><value_type>FLOAT</value_type><description>Count of archived files.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.archived_count</parameter></parameters></step></preprocessing><master_item><key>pgsql.archive[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>archive</value></tag></tags></item><item><uuid>729208d50ef64e50b0bb342899e211c2</uuid><name>Archive: Count of files in archive_status need to archive</name><type>DEPENDENT</type><key>pgsql.archive.count_files_to_archive</key><history>7d</history><value_type>FLOAT</value_type><description>Count of files to archive.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.count_files</parameter></parameters></step></preprocessing><master_item><key>pgsql.archive[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>archive</value></tag></tags></item><item><uuid>b60523c62afc4813aeb64cf9598fb7bd</uuid><name>Archive: Count of failed attempts to archive files</name><type>DEPENDENT</type><key>pgsql.archive.failed_trying_to_archive</key><history>7d</history><value_type>FLOAT</value_type><description>Count of failed attempts to archive files.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.failed_count</parameter></parameters></step></preprocessing><master_item><key>pgsql.archive[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>archive</value></tag></tags></item><item><uuid>285f434f79864d24a4e66d5a49c539e9</uuid><name>Archive: Size of files need to archive</name><type>DEPENDENT</type><key>pgsql.archive.size_files_to_archive</key><history>7d</history><value_type>FLOAT</value_type><description>Size of files to archive.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.size_files</parameter></parameters></step></preprocessing><master_item><key>pgsql.archive[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>archive</value></tag></tags></item><item><uuid>e9f4284fd3a1459e9c519dbdd8ee3425</uuid><name>Get archive</name><key>pgsql.archive[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key><history>0</history><value_type>TEXT</value_type><description>Collect archive status metrics.</description><tags><tag><tag>component</tag><value>raw</value></tag></tags></item><item><uuid>d9169b4b31554063b9d01d0d27b4beee</uuid><name>Count of autovacuum workers</name><key>pgsql.autovacuum.count[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><description>Number of autovacuum workers.</description><tags><tag><tag>component</tag><value>system</value></tag></tags></item><item><uuid>c49f777ae0db48879bc946989bfc36f6</uuid><name>Bgwriter: Buffers allocated per second</name><type>DEPENDENT</type><key>pgsql.bgwriter.buffers_alloc.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of buffers allocated per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.buffers_alloc</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.bgwriter[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>bgwriter</value></tag></tags></item><item><uuid>1624e89567824e0493492a3dcc979788</uuid><name>Bgwriter: Buffers written directly by a backend per second</name><type>DEPENDENT</type><key>pgsql.bgwriter.buffers_backend.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of buffers written directly by a backend per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.buffers_backend</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.bgwriter[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>bgwriter</value></tag></tags></item><item><uuid>6e5990d8a0854efd83b3e6a57aa2c2f9</uuid><name>Bgwriter: Times a backend executed its own fsync per second</name><type>DEPENDENT</type><key>pgsql.bgwriter.buffers_backend_fsync.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of times a backend had to execute its own fsync call per second (normally the background writer handles those even when the backend does its own write).</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.buffers_backend_fsync</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.bgwriter[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>bgwriter</value></tag></tags></item><item><uuid>3bf0496d313f4dfea67c95010be54372</uuid><name>Checkpoint: Buffers written during checkpoints per second</name><type>DEPENDENT</type><key>pgsql.bgwriter.buffers_checkpoint.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of buffers written during checkpoints per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.buffers_checkpoint</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.bgwriter[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>bgwriter</value></tag></tags></item><item><uuid>65f4aeedbc7d40ed9a14e0dbd8024c4b</uuid><name>Checkpoint: Buffers written by the background writer per second</name><type>DEPENDENT</type><key>pgsql.bgwriter.buffers_clean.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of buffers written by the background writer per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.buffers_clean</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.bgwriter[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>bgwriter</value></tag></tags></item><item><uuid>23fcb5ee8c19436b827001114961eb16</uuid><name>Checkpoint: Requested per second</name><type>DEPENDENT</type><key>pgsql.bgwriter.checkpoints_req.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of requested checkpoints that have been performed per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.checkpoints_req</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.bgwriter[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>bgwriter</value></tag></tags></item><item><uuid>9c578a8e072940728cc00d94f52cec8d</uuid><name>Checkpoint: Scheduled per second</name><type>DEPENDENT</type><key>pgsql.bgwriter.checkpoints_timed.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of scheduled checkpoints that have been performed per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.checkpoints_timed</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.bgwriter[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>bgwriter</value></tag></tags></item><item><uuid>b94507037a584b9391f610e59dd34e6c</uuid><name>Checkpoint: Checkpoint sync time per second</name><type>DEPENDENT</type><key>pgsql.bgwriter.checkpoint_sync_time.rate</key><history>7d</history><value_type>FLOAT</value_type><units>s</units><description>Total amount of time per second that has been spent in the portion of checkpoint processing where files are synchronized to disk.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.checkpoint_sync_time</parameter></parameters></step><step><type>MULTIPLIER</type><parameters><parameter>0.001</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.bgwriter[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>bgwriter</value></tag></tags></item><item><uuid>26839587c46043caa2991e973962b954</uuid><name>Checkpoint: Checkpoint write time per second</name><type>DEPENDENT</type><key>pgsql.bgwriter.checkpoint_write_time.rate</key><history>7d</history><value_type>FLOAT</value_type><units>s</units><description>Total amount of time per second that has been spent in the portion of checkpoint processing where files are written to disk.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.checkpoint_write_time</parameter></parameters></step><step><type>MULTIPLIER</type><parameters><parameter>0.001</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.bgwriter[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>bgwriter</value></tag></tags></item><item><uuid>b83939ecfb094a7e9eb42cd9a7e2695c</uuid><name>Bgwriter: Number of bgwriter cleaning scan stopped per second</name><type>DEPENDENT</type><key>pgsql.bgwriter.maxwritten_clean.rate</key><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 per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.maxwritten_clean</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.bgwriter[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>bgwriter</value></tag></tags></item><item><uuid>6020e17c25104cbfba182e9cddfe6336</uuid><name>Get bgwriter</name><key>pgsql.bgwriter[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key><history>0</history><value_type>TEXT</value_type><description>Collect all metrics from pg_stat_bgwriter:
https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-BGWRITER-VIEW</description><tags><tag><tag>component</tag><value>raw</value></tag></tags></item><item><uuid>b98d2328694f44598f2177b3f93d4b90</uuid><name>Cache hit ratio, %</name><type>CALCULATED</type><key>pgsql.cache.hit</key><history>7d</history><value_type>FLOAT</value_type><units>%</units><params>last(//pgsql.dbstat.sum.blks_hit.rate) * 100 / (last(//pgsql.dbstat.sum.blks_hit.rate) + last(//pgsql.dbstat.sum.blks_read.rate))</params><description>Cache hit ratio.</description><tags><tag><tag>component</tag><value>cache</value></tag></tags></item><item><uuid>2ea55460f0d34063ae4ab65b74ec852c</uuid><name>Connections sum: Active</name><type>DEPENDENT</type><key>pgsql.connections.sum.active</key><history>7d</history><description>Total number of connections executing a query.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.active</parameter></parameters></step></preprocessing><master_item><key>pgsql.connections[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>connections</value></tag></tags></item><item><uuid>69f14028e98b48d489fbd7345c2213dd</uuid><name>Connections sum: Disabled</name><type>DEPENDENT</type><key>pgsql.connections.sum.disabled</key><history>7d</history><description>Total number of disabled connections.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.disabled</parameter></parameters></step></preprocessing><master_item><key>pgsql.connections[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>connections</value></tag></tags></item><item><uuid>62a2401041724b4888bf058035dc6a0c</uuid><name>Connections sum: Fastpath function call</name><type>DEPENDENT</type><key>pgsql.connections.sum.fastpath_function_call</key><history>7d</history><description>Total number of connections executing a fast-path function.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.fastpath_function_call</parameter></parameters></step></preprocessing><master_item><key>pgsql.connections[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>connections</value></tag></tags></item><item><uuid>fc3b357cc8a24c4aad60784d1bfb7e18</uuid><name>Connections sum: Idle</name><type>DEPENDENT</type><key>pgsql.connections.sum.idle</key><history>7d</history><description>Total number of connections waiting for a new client command.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.idle</parameter></parameters></step></preprocessing><master_item><key>pgsql.connections[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>connections</value></tag></tags></item><item><uuid>b900a8123dfa48e0ac8fd4b92ae8678d</uuid><name>Connections sum: Idle in transaction</name><type>DEPENDENT</type><key>pgsql.connections.sum.idle_in_transaction</key><history>7d</history><description>Total number of connections in a transaction state but not executing a query.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.idle_in_transaction</parameter></parameters></step></preprocessing><master_item><key>pgsql.connections[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>connections</value></tag></tags></item><item><uuid>99b0a3e14af44924b0319a0a9f6c16c7</uuid><name>Connections sum: Idle in transaction (aborted)</name><type>DEPENDENT</type><key>pgsql.connections.sum.idle_in_transaction_aborted</key><history>7d</history><description>Total number of connections in a transaction state but not executing a query, and where one of the statements in the transaction caused an error.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.idle_in_transaction_aborted</parameter></parameters></step></preprocessing><master_item><key>pgsql.connections[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>connections</value></tag></tags></item><item><uuid>194c41f88e9e44879a70033913dd41d3</uuid><name>Connections sum: Prepared</name><type>DEPENDENT</type><key>pgsql.connections.sum.prepared</key><history>7d</history><description>Total number of prepared transactions:
https://www.postgresql.org/docs/current/sql-prepare-transaction.html</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.prepared</parameter></parameters></step></preprocessing><master_item><key>pgsql.connections[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>connections</value></tag></tags></item><item><uuid>1ec042e5853b430d9d7982c53c3fcf14</uuid><name>Connections sum: Total</name><type>DEPENDENT</type><key>pgsql.connections.sum.total</key><history>7d</history><description>Total number of connections.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.total</parameter></parameters></step></preprocessing><master_item><key>pgsql.connections[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>connections</value></tag></tags></item><item><uuid>101149dd68994084a1cdab82c9d064f0</uuid><name>Connections sum: Total, %</name><type>DEPENDENT</type><key>pgsql.connections.sum.total_pct</key><history>7d</history><units>%</units><description>Total number of connections, in percentage.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.total_pct</parameter></parameters></step></preprocessing><master_item><key>pgsql.connections[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>connections</value></tag></tags><triggers><trigger><uuid>1d0903401af64d93ac16761808d672ca</uuid><expression>min(/PostgreSQL by Zabbix agent 2/pgsql.connections.sum.total_pct,5m) &gt; {$PG.CONN_TOTAL_PCT.MAX.WARN}</expression><name>Total number of connections is too high</name><event_name>Total number of connections is too high (over {$PG.CONN_TOTAL_PCT.MAX.WARN} in 5m)</event_name><priority>AVERAGE</priority><description>Total number of current connections exceeds the limit of {$PG.CONN_TOTAL_PCT.MAX.WARN}% out of the maximum number of concurrent connections to the database server (the &quot;max_connections&quot; setting).</description><tags><tag><tag>scope</tag><value>performance</value></tag></tags></trigger></triggers></item><item><uuid>f2c298008b914434b96da85a985e4a54</uuid><name>Connections sum: Waiting</name><type>DEPENDENT</type><key>pgsql.connections.sum.waiting</key><history>7d</history><description>Total number of waiting connections:
https://www.postgresql.org/docs/current/monitoring-stats.html#WAIT-EVENT-TABLE</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.waiting</parameter></parameters></step></preprocessing><master_item><key>pgsql.connections[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>connections</value></tag></tags></item><item><uuid>e926ecd967f342bf90e9923825147d64</uuid><name>Get connections sum</name><key>pgsql.connections[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key><history>0</history><value_type>TEXT</value_type><description>Collect all metrics from pg_stat_activity:
https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW</description><tags><tag><tag>component</tag><value>raw</value></tag></tags></item><item><uuid>1cab825fac8a49ba96dfbf7a696be729</uuid><name>Custom queries</name><key>pgsql.custom.query[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;,&quot;{$PG.DATABASE}&quot;,&quot;&quot;]</key><history>1h</history><value_type>TEXT</value_type><status>DISABLED</status><description>Execute custom queries from file *.sql (check for option Plugins.Postgres.CustomQueriesPath at agent configuration).</description><tags><tag><tag>component</tag><value>application</value></tag></tags></item><item><uuid>5c6de0fe332043bfb35c999b10893e4c</uuid><name>Dbstat: Hit blocks read per second</name><type>DEPENDENT</type><key>pgsql.dbstat.sum.blks_hit.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of times per second disk blocks were found already in the buffer cache</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.blks_hit</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>cache</value></tag></tags></item><item><uuid>4dc3f2c23dfd4dfebe024a5c2d4409ae</uuid><name>Dbstat: Disk blocks read per second</name><type>DEPENDENT</type><key>pgsql.dbstat.sum.blks_read.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of disk blocks read per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.blks_read</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>storage</value></tag></tags></item><item><uuid>619211cc2afa4a159f36abf1a17d5476</uuid><name>Dbstat: Blocks read time</name><type>DEPENDENT</type><key>pgsql.dbstat.sum.blk_read_time</key><history>7d</history><value_type>FLOAT</value_type><units>s</units><description>Time spent reading data file blocks by backends.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.blk_read_time</parameter></parameters></step><step><type>MULTIPLIER</type><parameters><parameter>0.001</parameter></parameters></step></preprocessing><master_item><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>storage</value></tag></tags></item><item><uuid>fba3b51d644c4c16ac71b3eda1be1701</uuid><name>Dbstat: Blocks write time</name><type>DEPENDENT</type><key>pgsql.dbstat.sum.blk_write_time</key><history>7d</history><value_type>FLOAT</value_type><units>s</units><description>Time spent writing data file blocks by backends.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.blk_write_time</parameter></parameters></step><step><type>MULTIPLIER</type><parameters><parameter>0.001</parameter></parameters></step></preprocessing><master_item><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>storage</value></tag></tags></item><item><uuid>1b98b9c95b32424baa68c354496ed2de</uuid><name>Dbstat: Checksum failures per second</name><type>DEPENDENT</type><key>pgsql.dbstat.sum.checksum_failures.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of data page checksum failures per second detected (or on a shared object), or NULL if data checksums are not enabled. This metric is available since PostgreSQL 12.</description><valuemap><name>PostgreSQL checksum failure status</name></valuemap><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.checksum_failures</parameter></parameters></step><step><type>MATCHES_REGEX</type><parameters><parameter>^\d*$</parameter></parameters><error_handler>CUSTOM_VALUE</error_handler><error_handler_params>-2</error_handler_params></step><step><type>CHANGE_PER_SECOND</type><error_handler>CUSTOM_VALUE</error_handler><error_handler_params>-1</error_handler_params></step></preprocessing><master_item><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>system</value></tag></tags><triggers><trigger><uuid>1d67b13f47134a538708c2a14dcfa6b1</uuid><expression>last(/PostgreSQL by Zabbix agent 2/pgsql.dbstat.sum.checksum_failures.rate)&gt;0</expression><name>Dbstat: Checksum failures detected</name><priority>AVERAGE</priority><description>Data page checksum failures were detected on that DB instance:
https://www.postgresql.org/docs/current/checksums.html</description><tags><tag><tag>scope</tag><value>availability</value></tag></tags></trigger></triggers></item><item><uuid>0106dfc55ace4dacaff00ce2c98de2ea</uuid><name>Dbstat: Conflicts per second</name><type>DEPENDENT</type><key>pgsql.dbstat.sum.conflicts.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of queries canceled per second due to conflicts with recovery (conflicts occur only on standby servers; see pg_stat_database_conflicts for details).</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.conflicts</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag></tags></item><item><uuid>e5d3838e5cf84be9ae83cacf22dc99af</uuid><name>Dbstat: Deadlocks per second</name><type>DEPENDENT</type><key>pgsql.dbstat.sum.deadlocks.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of deadlocks detected per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.deadlocks</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>deadlocks</value></tag></tags></item><item><uuid>c61f60e6f7d24ffe99db480f6bbd9613</uuid><name>Dbstat: Backends connected</name><type>DEPENDENT</type><key>pgsql.dbstat.sum.numbackends</key><history>7d</history><description>Number of connected backends.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.numbackends</parameter></parameters></step></preprocessing><master_item><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>backends</value></tag></tags></item><item><uuid>96cb6b388b2c480ead1568293dd81e70</uuid><name>Dbstat: Number temp bytes per second</name><type>DEPENDENT</type><key>pgsql.dbstat.sum.temp_bytes.rate</key><history>7d</history><value_type>FLOAT</value_type><units>b</units><description>Total amount of data written per second to temporary files by queries.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.temp_bytes</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>storage</value></tag></tags></item><item><uuid>bea47c8a95074ad3997aff64fcfcf49b</uuid><name>Dbstat: Number temp files per second</name><type>DEPENDENT</type><key>pgsql.dbstat.sum.temp_files.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of temporary files created by queries per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.temp_files</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>storage</value></tag></tags></item><item><uuid>731f4adac9d34eaaaa1f8d5080fdf6ce</uuid><name>Dbstat: Rows deleted per second</name><type>DEPENDENT</type><key>pgsql.dbstat.sum.tup_deleted.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of rows deleted by queries per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.tup_deleted</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag></tags></item><item><uuid>4eb6cc273484453bab1233de085363f5</uuid><name>Dbstat: Rows fetched per second</name><type>DEPENDENT</type><key>pgsql.dbstat.sum.tup_fetched.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of rows fetched by queries per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.tup_fetched</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag></tags></item><item><uuid>ae250ffa30c94df187c2010011e794aa</uuid><name>Dbstat: Rows inserted per second</name><type>DEPENDENT</type><key>pgsql.dbstat.sum.tup_inserted.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of rows inserted by queries per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.tup_inserted</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag></tags></item><item><uuid>3253ed1c96db4a84974e62b85d80bc0f</uuid><name>Dbstat: Rows returned per second</name><type>DEPENDENT</type><key>pgsql.dbstat.sum.tup_returned.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of rows returned by queries per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.tup_returned</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag></tags></item><item><uuid>13feadafa00a4bd293fcf1a98ddf1f39</uuid><name>Dbstat: Rows updated per second</name><type>DEPENDENT</type><key>pgsql.dbstat.sum.tup_updated.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of rows updated by queries per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.tup_updated</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag></tags></item><item><uuid>bc8a3b29a6684b7f8a70a54b962f0e7e</uuid><name>Dbstat: Committed transactions per second</name><type>DEPENDENT</type><key>pgsql.dbstat.sum.xact_commit.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of transactions that have been committed per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.xact_commit</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>transactions</value></tag></tags></item><item><uuid>8aedfe3e385b447eb75b85f92301665a</uuid><name>Dbstat: Roll backed transactions per second</name><type>DEPENDENT</type><key>pgsql.dbstat.sum.xact_rollback.rate</key><history>7d</history><value_type>FLOAT</value_type><description>Number of transactions that have been rolled back per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.xact_rollback</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>transactions</value></tag></tags></item><item><uuid>ddddde3084d54f55838b970f44290523</uuid><name>Get dbstat sum</name><key>pgsql.dbstat.sum[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key><history>0</history><value_type>TEXT</value_type><description>Collect all metrics from pg_stat_database as sums for all databases:
https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-DATABASE-VIEW</description><tags><tag><tag>component</tag><value>raw</value></tag></tags></item><item><uuid>3be06ec14cba44d0892f3271a599c473</uuid><name>Get dbstat</name><key>pgsql.dbstat[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key><history>0</history><value_type>TEXT</value_type><description>Collect all metrics from pg_stat_database per database:
https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-DATABASE-VIEW</description><tags><tag><tag>component</tag><value>raw</value></tag></tags></item><item><uuid>7112eeb300c14d959c79715462bf9563</uuid><name>Get locks</name><key>pgsql.locks[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key><history>0</history><value_type>TEXT</value_type><description>Collect all metrics from pg_locks per database:
https://www.postgresql.org/docs/current/explicit-locking.html#LOCKING-TABLES</description><tags><tag><tag>component</tag><value>raw</value></tag></tags></item><item><uuid>0377fe6f2f8d4539b649c636ab012415</uuid><name>Age of oldest xid</name><key>pgsql.oldest.xid[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><description>Age of oldest xid.</description><tags><tag><tag>component</tag><value>transactions</value></tag></tags><triggers><trigger><uuid>2a5c11571d9d46f093ed9081f9d51504</uuid><expression>last(/PostgreSQL by Zabbix agent 2/pgsql.oldest.xid[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]) &gt; 18000000</expression><name>Oldest xid is too big</name><priority>AVERAGE</priority><tags><tag><tag>scope</tag><value>availability</value></tag></tags></trigger></triggers></item><item><uuid>56323e572fa443228987c62039153825</uuid><name>Ping</name><key>pgsql.ping[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key><history>7d</history><description>Used to test a connection to see if it is alive. It is set to 0 if the query is unsuccessful.</description><valuemap><name>Service state</name></valuemap><preprocessing><step><type>DISCARD_UNCHANGED_HEARTBEAT</type><parameters><parameter>1h</parameter></parameters></step></preprocessing><tags><tag><tag>component</tag><value>application</value></tag><tag><tag>component</tag><value>health</value></tag></tags><triggers><trigger><uuid>48a24a78519d47349200f0b41ceec56a</uuid><expression>last(/PostgreSQL by Zabbix agent 2/pgsql.ping[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;])=0</expression><name>Service is down</name><priority>HIGH</priority><description>Last test of a connection was unsuccessful.</description><tags><tag><tag>scope</tag><value>availability</value></tag></tags></trigger></triggers></item><item><uuid>01123126fcd54adc84c3bbfa227d9c0c</uuid><name>Get queries</name><key>pgsql.queries[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;,&quot;{$PG.DATABASE}&quot;,&quot;{$PG.QUERY_ETIME.MAX.WARN}&quot;]</key><history>0</history><value_type>TEXT</value_type><description>Collect all metrics by query execution time.</description><tags><tag><tag>component</tag><value>raw</value></tag></tags></item><item><uuid>a171db459d6144e4ad294579fb8dc56d</uuid><name>Replication: Standby count</name><key>pgsql.replication.count[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key><history>7d</history><description>Number of standby servers.</description><tags><tag><tag>component</tag><value>replication</value></tag></tags></item><item><uuid>da9ce769f9444a3f9600ce64c4ab2857</uuid><name>Replication: Lag in bytes</name><key>pgsql.replication.lag.b[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key><history>7d</history><units>B</units><description>Replication lag with master, in bytes.</description><tags><tag><tag>component</tag><value>replication</value></tag></tags></item><item><uuid>5a9eb8ee4a484911903688e620eb618b</uuid><name>Replication: Lag in seconds</name><key>pgsql.replication.lag.sec[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key><history>7d</history><units>s</units><description>Replication lag with master, in seconds.</description><tags><tag><tag>component</tag><value>replication</value></tag></tags></item><item><uuid>4120befb754d47e9a931f868c28badb9</uuid><name>Get replication</name><key>pgsql.replication.process[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key><history>0</history><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><tags><tag><tag>component</tag><value>raw</value></tag></tags></item><item><uuid>4085b836bf614f3d910818074c386845</uuid><name>Replication: Recovery role</name><key>pgsql.replication.recovery_role[&quot;{$PG.CONNSTRING}&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><valuemap><name>PostgreSQL recovery role</name></valuemap><tags><tag><tag>component</tag><value>replication</value></tag></tags></item><item><uuid>3c83904cbad74ff7a0d10136a233e6c6</uuid><name>Replication: Status</name><key>pgsql.replication.status[&quot;{$PG.CONNSTRING}&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><valuemap><name>PostgreSQL replication status</name></valuemap><tags><tag><tag>component</tag><value>replication</value></tag></tags></item><item><uuid>efa946a67e5844ecb905c68a2a6b85bb</uuid><name>Uptime</name><key>pgsql.uptime[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><units>s</units><description>Time since the server started.</description><tags><tag><tag>component</tag><value>application</value></tag></tags><triggers><trigger><uuid>5fbabc5f60b74a369a13a260d25cce3c</uuid><expression>last(/PostgreSQL by Zabbix agent 2/pgsql.uptime[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]) &lt; 10m</expression><name>Service has been restarted</name><event_name>Service has been restarted (uptime &lt; 10m)</event_name><priority>AVERAGE</priority><description>PostgreSQL uptime is less than 10 minutes.</description><tags><tag><tag>scope</tag><value>notice</value></tag></tags></trigger></triggers></item><item><uuid>523528aad175455fbd1daba161365651</uuid><name>Version</name><key>pgsql.version[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key><delay>15m</delay><history>7d</history><value_type>CHAR</value_type><description>PostgreSQL version.</description><preprocessing><step><type>DISCARD_UNCHANGED_HEARTBEAT</type><parameters><parameter>1d</parameter></parameters></step></preprocessing><tags><tag><tag>component</tag><value>application</value></tag></tags><triggers><trigger><uuid>6b3ac2a19e114e1390e6e0793728f576</uuid><expression>last(/PostgreSQL by Zabbix agent 2/pgsql.version[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;],#1)&lt;&gt;last(/PostgreSQL by Zabbix agent 2/pgsql.version[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;],#2) and length(last(/PostgreSQL by Zabbix agent 2/pgsql.version[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]))&gt;0</expression><name>Version has changed</name><event_name>Version has changed (new version value received: {ITEM.VALUE})</event_name><priority>INFO</priority><tags><tag><tag>scope</tag><value>notice</value></tag></tags></trigger></triggers></item><item><uuid>6d5aa6213cf248749cbffdea9aff694f</uuid><name>WAL: Segments count</name><type>DEPENDENT</type><key>pgsql.wal.count</key><history>7d</history><description>Number of WAL segments.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.count</parameter></parameters></step></preprocessing><master_item><key>pgsql.wal.stat[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>wal</value></tag></tags></item><item><uuid>0e58a74b8a2d47d28f596196405b22b5</uuid><name>WAL: Bytes received</name><type>DEPENDENT</type><key>pgsql.wal.receive</key><history>7d</history><units>B</units><description>WAL receive, in bytes.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.receive</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.wal.stat[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>wal</value></tag></tags></item><item><uuid>c3d96741af454f6b9a3a49b6117c31be</uuid><name>Get WAL</name><key>pgsql.wal.stat[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key><delay>5m</delay><history>0</history><value_type>TEXT</value_type><description>Collect write-ahead log (WAL) metrics.</description><tags><tag><tag>component</tag><value>raw</value></tag></tags></item><item><uuid>95f67516be544daf9ad8a1cad2e46114</uuid><name>WAL: Bytes written</name><type>DEPENDENT</type><key>pgsql.wal.write</key><history>7d</history><units>B</units><description>WAL write, in bytes.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.write</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.wal.stat[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>wal</value></tag></tags></item></items><discovery_rules><discovery_rule><uuid>b1a4bfe1031a40529a7c38ac6bed3c6d</uuid><name>Database discovery</name><key>pgsql.db.discovery[&quot;{$PG.CONNSTRING}&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></condition></conditions></filter><description>Discovers databases (DB) in the database management system (DBMS), except:
- templates;
- DBs that do not allow connections.</description><item_prototypes><item_prototype><uuid>1419ff1331734a4088349332e118ca94</uuid><name>DB [{#DBNAME}]: Database age</name><key>pgsql.db.age[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;,&quot;{#DBNAME}&quot;]</key><delay>10m</delay><history>7d</history><description>Database age.</description><tags><tag><tag>component</tag><value>application</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>4367ba7fdffd459ea2b18e1877bc74ca</uuid><name>DB [{#DBNAME}]: Bloating tables</name><key>pgsql.db.bloating_tables[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;,&quot;{#DBNAME}&quot;]</key><history>7d</history><description>Number of bloating tables.</description><tags><tag><tag>component</tag><value>tables</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>b614a0909eec40bc841bf7446e842544</uuid><name>DB [{#DBNAME}]: Database size</name><key>pgsql.db.size[&quot;{$PG.CONNSTRING}&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><tags><tag><tag>component</tag><value>storage</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>4b1b1a4374c0429cb1790e774f181512</uuid><name>DB [{#DBNAME}]: Blocks hit per second</name><type>DEPENDENT</type><key>pgsql.dbstat.blks_hit.rate[&quot;{#DBNAME}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><description>Total number of times per second disk blocks were found already in the buffer cache, so that a read was not necessary.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.blks_hit</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>cache</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>841496e662cc43cf8db7728e96fcba76</uuid><name>DB [{#DBNAME}]: Disk blocks read per second</name><type>DEPENDENT</type><key>pgsql.dbstat.blks_read.rate[&quot;{#DBNAME}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><description>Total number of disk blocks read per second in this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.blks_read</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>storage</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>0313d02ce8274bc9bcaee54d062300c8</uuid><name>DB [{#DBNAME}]: Disk blocks read time per second</name><type>DEPENDENT</type><key>pgsql.dbstat.blk_read_time.rate[&quot;{#DBNAME}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><units>s</units><description>Time spent reading data file blocks by backends per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.blk_read_time</parameter></parameters></step><step><type>MULTIPLIER</type><parameters><parameter>0.001</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>storage</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>e746a7760d554a0e9d41ba01c3be9db5</uuid><name>DB [{#DBNAME}]: Disk blocks write time</name><type>DEPENDENT</type><key>pgsql.dbstat.blk_write_time.rate[&quot;{#DBNAME}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><units>s</units><description>Time spent writing data file blocks by backends per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.blk_write_time</parameter></parameters></step><step><type>MULTIPLIER</type><parameters><parameter>0.001</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>storage</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>d44335162082498bbc42e29e938a4de7</uuid><name>DB [{#DBNAME}]: Checksum failures</name><type>DEPENDENT</type><key>pgsql.dbstat.checksum_failures.rate[&quot;{#DBNAME}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><description>Number of data page checksum failures detected in this database.</description><valuemap><name>PostgreSQL checksum failure status</name></valuemap><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.checksum_failures</parameter></parameters></step><step><type>MATCHES_REGEX</type><parameters><parameter>^\d*$</parameter></parameters><error_handler>CUSTOM_VALUE</error_handler><error_handler_params>-2</error_handler_params></step><step><type>CHANGE_PER_SECOND</type><error_handler>CUSTOM_VALUE</error_handler><error_handler_params>-1</error_handler_params></step></preprocessing><master_item><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>system</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags><trigger_prototypes><trigger_prototype><uuid>5995403b904349d296227647ca318f5b</uuid><expression>last(/PostgreSQL by Zabbix agent 2/pgsql.dbstat.checksum_failures.rate[&quot;{#DBNAME}&quot;])&gt;0</expression><name>DB [{#DBNAME}]: Checksum failures detected</name><priority>AVERAGE</priority><description>Data page checksum failures were detected on that database:
https://www.postgresql.org/docs/current/checksums.html</description><tags><tag><tag>scope</tag><value>availability</value></tag></tags></trigger_prototype></trigger_prototypes></item_prototype><item_prototype><uuid>4eb67f16bc2948a7927ed58c9d037466</uuid><name>DB [{#DBNAME}]: Detected conflicts per second</name><type>DEPENDENT</type><key>pgsql.dbstat.conflicts.rate[&quot;{#DBNAME}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><description>Total number of queries canceled due to conflicts with recovery in this database per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.conflicts</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags><trigger_prototypes><trigger_prototype><uuid>05ac4216e1a941df8880224ffd38b806</uuid><expression>min(/PostgreSQL by Zabbix agent 2/pgsql.dbstat.conflicts.rate[&quot;{#DBNAME}&quot;],5m) &gt; {$PG.CONFLICTS.MAX.WARN:&quot;{#DBNAME}&quot;}</expression><name>DB [{#DBNAME}]: Too many recovery conflicts</name><event_name>DB [{#DBNAME}]: Too many recovery conflicts (over {$PG.CONFLICTS.MAX.WARN:&quot;{#DBNAME}&quot;} in 5m)</event_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.
https://www.postgresql.org/docs/current/hot-standby.html#HOT-STANDBY-CONFLICT</description><tags><tag><tag>scope</tag><value>performance</value></tag></tags></trigger_prototype></trigger_prototypes></item_prototype><item_prototype><uuid>d53da0cc702f4fe381e4d13d454ec229</uuid><name>DB [{#DBNAME}]: Detected deadlocks per second</name><type>DEPENDENT</type><key>pgsql.dbstat.deadlocks.rate[&quot;{#DBNAME}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><description>Total number of detected deadlocks in this database per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.deadlocks</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>deadlocks</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags><trigger_prototypes><trigger_prototype><uuid>dd948e3ec19c419e8c9a62ace8d1695f</uuid><expression>min(/PostgreSQL by Zabbix agent 2/pgsql.dbstat.deadlocks.rate[&quot;{#DBNAME}&quot;],5m) &gt; {$PG.DEADLOCKS.MAX.WARN:&quot;{#DBNAME}&quot;}</expression><name>DB [{#DBNAME}]: Deadlock occurred</name><event_name>DB [{#DBNAME}]: Deadlock occurred (over {$PG.DEADLOCKS.MAX.WARN:&quot;{#DBNAME}&quot;} in 5m)</event_name><priority>HIGH</priority><description>Number of deadlocks detected per second exceeds {$PG.DEADLOCKS.MAX.WARN:&quot;{#DBNAME}&quot;} for 5m.</description><tags><tag><tag>scope</tag><value>availability</value></tag></tags></trigger_prototype></trigger_prototypes></item_prototype><item_prototype><uuid>7ebf1570bebe4b9cb82474fe5aea0562</uuid><name>DB [{#DBNAME}]: Get dbstat</name><type>DEPENDENT</type><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key><history>0</history><value_type>TEXT</value_type><description>Get dbstat metrics for database &quot;{#DBNAME}&quot;.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$['{#DBNAME}']</parameter></parameters><error_handler>DISCARD_VALUE</error_handler></step></preprocessing><master_item><key>pgsql.dbstat[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>raw</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>2e31986867d24bca930d141cc5d9cc0f</uuid><name>DB [{#DBNAME}]: Backends connected</name><type>DEPENDENT</type><key>pgsql.dbstat.numbackends[&quot;{#DBNAME}&quot;]</key><history>7d</history><description>Number of backends currently connected to this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.numbackends</parameter></parameters></step></preprocessing><master_item><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>backends</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>82a2f4b2dc4f4dfe9a0a42144f603a8a</uuid><name>DB [{#DBNAME}]: Temp_bytes written per second</name><type>DEPENDENT</type><key>pgsql.dbstat.temp_bytes.rate[&quot;{#DBNAME}&quot;]</key><history>7d</history><units>B</units><description>Total amount of data written to temporary files by queries in this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.temp_bytes</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>storage</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>480ffc23ca8d41e3ac86bb162007065f</uuid><name>DB [{#DBNAME}]: Temp_files created per second</name><type>DEPENDENT</type><key>pgsql.dbstat.temp_files.rate[&quot;{#DBNAME}&quot;]</key><history>7d</history><description>Total number of temporary files created by queries in this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.temp_files</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>storage</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>cf288751fb894e5291b2d539b4c1a6a1</uuid><name>DB [{#DBNAME}]: Tuples deleted per second</name><type>DEPENDENT</type><key>pgsql.dbstat.tup_deleted.rate[&quot;{#DBNAME}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><description>Total number of rows deleted by queries in this database per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.tup_deleted</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>a512a7a075244ccb90ab6824125a405e</uuid><name>DB [{#DBNAME}]: Tuples fetched per second</name><type>DEPENDENT</type><key>pgsql.dbstat.tup_fetched.rate[&quot;{#DBNAME}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><description>Total number of rows fetched by queries in this database per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.tup_fetched</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>2f24c195df5842f1bdf65a11dea3a315</uuid><name>DB [{#DBNAME}]: Tuples inserted per second</name><type>DEPENDENT</type><key>pgsql.dbstat.tup_inserted.rate[&quot;{#DBNAME}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><description>Total number of rows inserted by queries in this database per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.tup_inserted</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>175c5051ef0c4a31b76270cacbdd7ed5</uuid><name>DB [{#DBNAME}]: Tuples returned per second</name><type>DEPENDENT</type><key>pgsql.dbstat.tup_returned.rate[&quot;{#DBNAME}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><description>Number of rows returned by queries in this database per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.tup_returned</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>9888b495d3f04cceb373c341bd4f1941</uuid><name>DB [{#DBNAME}]: Tuples updated per second</name><type>DEPENDENT</type><key>pgsql.dbstat.tup_updated.rate[&quot;{#DBNAME}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><description>Total number of rows updated by queries in this database per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.tup_updated</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>5b0ecb9c928c49a6a01b5df6aec931dd</uuid><name>DB [{#DBNAME}]: Commits per second</name><type>DEPENDENT</type><key>pgsql.dbstat.xact_commit.rate[&quot;{#DBNAME}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><description>Number of transactions in this database that have been committed per second.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.xact_commit</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>transactions</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>1d280198e31649fcb053d4c87a0e869d</uuid><name>DB [{#DBNAME}]: Rollbacks per second</name><type>DEPENDENT</type><key>pgsql.dbstat.xact_rollback.rate[&quot;{#DBNAME}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><description>Total number of transactions in this database that have been rolled back.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.xact_rollback</parameter></parameters></step><step><type>CHANGE_PER_SECOND</type></step></preprocessing><master_item><key>pgsql.dbstat.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>transactions</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>8eb2bd907a0e4385bcac9e0f467f9748</uuid><name>DB [{#DBNAME}]: Num of accessexclusive locks</name><type>DEPENDENT</type><key>pgsql.locks.accessexclusive[&quot;{#DBNAME}&quot;]</key><history>7d</history><description>Number of accessexclusive locks for this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.accessexclusive</parameter></parameters></step></preprocessing><master_item><key>pgsql.locks.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>locks</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>5f783de0d6124fc0ae14522a4ad89189</uuid><name>DB [{#DBNAME}]: Num of accessshare locks</name><type>DEPENDENT</type><key>pgsql.locks.accessshare[&quot;{#DBNAME}&quot;]</key><history>7d</history><description>Number of accessshare locks for this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.accessshare</parameter></parameters></step></preprocessing><master_item><key>pgsql.locks.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>locks</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>3c754430815f411e9aa8dde593f6333a</uuid><name>DB [{#DBNAME}]: Num of exclusive locks</name><type>DEPENDENT</type><key>pgsql.locks.exclusive[&quot;{#DBNAME}&quot;]</key><history>7d</history><description>Number of exclusive locks for this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.exclusive</parameter></parameters></step></preprocessing><master_item><key>pgsql.locks.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>locks</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>2c7759f4c9e442cb80bd54ea3323501b</uuid><name>DB [{#DBNAME}]: Get locks</name><type>DEPENDENT</type><key>pgsql.locks.get_metrics[&quot;{#DBNAME}&quot;]</key><history>0</history><value_type>TEXT</value_type><description>Get locks metrics for database &quot;{#DBNAME}&quot;.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$['{#DBNAME}']</parameter></parameters><error_handler>DISCARD_VALUE</error_handler></step></preprocessing><master_item><key>pgsql.locks[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>component</tag><value>raw</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>b1ccea7698264d768da1299ec9d13738</uuid><name>DB [{#DBNAME}]: Num of rowexclusive locks</name><type>DEPENDENT</type><key>pgsql.locks.rowexclusive[&quot;{#DBNAME}&quot;]</key><history>7d</history><description>Number of rowexclusive locks for this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.rowexclusive</parameter></parameters></step></preprocessing><master_item><key>pgsql.locks.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>locks</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>b4b1402b99284f3bbf0ac0dff493449f</uuid><name>DB [{#DBNAME}]: Num of rowshare locks</name><type>DEPENDENT</type><key>pgsql.locks.rowshare[&quot;{#DBNAME}&quot;]</key><history>7d</history><description>Number of rowshare locks for this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.rowshare</parameter></parameters><error_handler>DISCARD_VALUE</error_handler></step></preprocessing><master_item><key>pgsql.locks.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>locks</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>15eb93e90c1241a99aaff834d69cc5be</uuid><name>DB [{#DBNAME}]: Num of sharerowexclusive locks</name><type>DEPENDENT</type><key>pgsql.locks.sharerowexclusive[&quot;{#DBNAME}&quot;]</key><history>7d</history><description>Number of total sharerowexclusive for this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.sharerowexclusive</parameter></parameters></step></preprocessing><master_item><key>pgsql.locks.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>locks</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>04e6cec0423f4dddb09e6643561bdf77</uuid><name>DB [{#DBNAME}]: Num of shareupdateexclusive locks</name><type>DEPENDENT</type><key>pgsql.locks.shareupdateexclusive[&quot;{#DBNAME}&quot;]</key><history>7d</history><description>Number of shareupdateexclusive locks for this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.shareupdateexclusive</parameter></parameters></step></preprocessing><master_item><key>pgsql.locks.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>locks</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>8a410cf1f0be41fbb5a976f368f07430</uuid><name>DB [{#DBNAME}]: Num of share locks</name><type>DEPENDENT</type><key>pgsql.locks.share[&quot;{#DBNAME}&quot;]</key><history>7d</history><description>Number of share locks for this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.share</parameter></parameters></step></preprocessing><master_item><key>pgsql.locks.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>locks</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>a982064d710644db85ebc1cde67bfe4d</uuid><name>DB [{#DBNAME}]: Num of locks total</name><type>DEPENDENT</type><key>pgsql.locks.total[&quot;{#DBNAME}&quot;]</key><history>7d</history><description>Total number of locks in this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.total</parameter></parameters></step></preprocessing><master_item><key>pgsql.locks.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>locks</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>75e704af5cb545fd9f83bec3f147dd04</uuid><name>DB [{#DBNAME}]: Get queries</name><type>DEPENDENT</type><key>pgsql.queries.get_metrics[&quot;{#DBNAME}&quot;]</key><history>0</history><value_type>TEXT</value_type><description>Get queries metrics for database &quot;{#DBNAME}&quot;.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$['{#DBNAME}']</parameter></parameters><error_handler>DISCARD_VALUE</error_handler></step></preprocessing><master_item><key>pgsql.queries[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;,&quot;{$PG.DATABASE}&quot;,&quot;{$PG.QUERY_ETIME.MAX.WARN}&quot;]</key></master_item><tags><tag><tag>component</tag><value>raw</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>4c8934820b7f46a195115c7214d4379c</uuid><name>DB [{#DBNAME}]: Queries slow maintenance count</name><type>DEPENDENT</type><key>pgsql.queries.mro.slow_count[&quot;{#DBNAME}&quot;]</key><history>7d</history><description>Slow maintenance query count for this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.mro_slow_count</parameter></parameters></step></preprocessing><master_item><key>pgsql.queries.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>612c8f83e228406f86e70e8486a51f9b</uuid><name>DB [{#DBNAME}]: Queries max maintenance time</name><type>DEPENDENT</type><key>pgsql.queries.mro.time_max[&quot;{#DBNAME}&quot;]</key><history>7d</history><units>s</units><description>Max maintenance query time for this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.mro_time_max</parameter></parameters></step></preprocessing><master_item><key>pgsql.queries.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>9cde2701b5814142b064696dc974f45d</uuid><name>DB [{#DBNAME}]: Queries sum maintenance time</name><type>DEPENDENT</type><key>pgsql.queries.mro.time_sum[&quot;{#DBNAME}&quot;]</key><history>7d</history><units>s</units><description>Sum maintenance query time for this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.mro_time_sum</parameter></parameters></step></preprocessing><master_item><key>pgsql.queries.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>9e1191f80c3a4e9aa0d3aba2b2740fef</uuid><name>DB [{#DBNAME}]: Queries slow query count</name><type>DEPENDENT</type><key>pgsql.queries.query.slow_count[&quot;{#DBNAME}&quot;]</key><history>7d</history><description>Slow query count for this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.query_slow_count</parameter></parameters></step></preprocessing><master_item><key>pgsql.queries.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags><trigger_prototypes><trigger_prototype><uuid>2bb34a2a7dee451cb5419a146d883601</uuid><expression>min(/PostgreSQL by Zabbix agent 2/pgsql.queries.query.slow_count[&quot;{#DBNAME}&quot;],5m)&gt;{$PG.SLOW_QUERIES.MAX.WARN:&quot;{#DBNAME}&quot;}</expression><name>DB [{#DBNAME}]: Too many slow queries</name><event_name>DB [{#DBNAME}]: Too many slow queries (over {$PG.SLOW_QUERIES.MAX.WARN:&quot;{#DBNAME}&quot;} in 5m)</event_name><priority>WARNING</priority><description>The number of detected slow queries exceeds the limit of {$PG.SLOW_QUERIES.MAX.WARN:&quot;{#DBNAME}&quot;}.</description><tags><tag><tag>scope</tag><value>performance</value></tag></tags></trigger_prototype></trigger_prototypes></item_prototype><item_prototype><uuid>73712df30d66494998bf11566eba409f</uuid><name>DB [{#DBNAME}]: Queries max query time</name><type>DEPENDENT</type><key>pgsql.queries.query.time_max[&quot;{#DBNAME}&quot;]</key><history>7d</history><units>s</units><description>Max query time for this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.query_time_max</parameter></parameters></step></preprocessing><master_item><key>pgsql.queries.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>ba95d84bc11b4df4aece8ddb51042339</uuid><name>DB [{#DBNAME}]: Queries sum query time</name><type>DEPENDENT</type><key>pgsql.queries.query.time_sum[&quot;{#DBNAME}&quot;]</key><history>7d</history><units>s</units><description>Sum query time for this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.query_time_sum</parameter></parameters></step></preprocessing><master_item><key>pgsql.queries.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>d31701d52f5941d5a24241c95db52373</uuid><name>DB [{#DBNAME}]: Queries slow transaction count</name><type>DEPENDENT</type><key>pgsql.queries.tx.slow_count[&quot;{#DBNAME}&quot;]</key><history>7d</history><description>Slow transaction query count for this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.tx_slow_count</parameter></parameters></step></preprocessing><master_item><key>pgsql.queries.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>ecc24b3143254dd4b2fc01c12cefb345</uuid><name>DB [{#DBNAME}]: Queries max transaction time</name><type>DEPENDENT</type><key>pgsql.queries.tx.time_max[&quot;{#DBNAME}&quot;]</key><history>7d</history><units>s</units><description>Max transaction query time for this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.tx_time_max</parameter></parameters></step></preprocessing><master_item><key>pgsql.queries.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype><item_prototype><uuid>178926a753614bb58206d82f68280097</uuid><name>DB [{#DBNAME}]: Queries sum transaction time</name><type>DEPENDENT</type><key>pgsql.queries.tx.time_sum[&quot;{#DBNAME}&quot;]</key><history>7d</history><units>s</units><description>Sum transaction query time for this database.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.tx_time_sum</parameter></parameters></step></preprocessing><master_item><key>pgsql.queries.get_metrics[&quot;{#DBNAME}&quot;]</key></master_item><tags><tag><tag>component</tag><value>queries</value></tag><tag><tag>database</tag><value>{#DBNAME}</value></tag></tags></item_prototype></item_prototypes><graph_prototypes><graph_prototype><uuid>af6eac83efc94d2a9f4a3501207fb5ce</uuid><name>DB [{#DBNAME}]: Locks</name><graph_items><graph_item><drawtype>GRADIENT_LINE</drawtype><color>199C0D</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.locks.total[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>1</sortorder><color>F63100</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.locks.accessexclusive[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>2</sortorder><color>00611C</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.locks.accessshare[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>3</sortorder><color>F7941D</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.locks.exclusive[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>4</sortorder><color>FC6EA3</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.locks.rowexclusive[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>5</sortorder><color>6C59DC</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.locks.rowshare[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>6</sortorder><color>C7A72D</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.locks.sharerowexclusive[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>7</sortorder><color>BA2A5D</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.locks.shareupdateexclusive[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>8</sortorder><color>F230E0</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.locks.share[&quot;{#DBNAME}&quot;]</key></item></graph_item></graph_items></graph_prototype><graph_prototype><uuid>9a518b4bf0f04609863bf9dc4c7f1ea2</uuid><name>DB [{#DBNAME}]: Number of bloating tables</name><graph_items><graph_item><drawtype>GRADIENT_LINE</drawtype><color>199C0D</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.db.bloating_tables[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;,&quot;{#DBNAME}&quot;]</key></item></graph_item></graph_items></graph_prototype><graph_prototype><uuid>4d46d39a1d1146c19a57b2b5b8086708</uuid><name>DB [{#DBNAME}]: pg_stat_database metrics</name><graph_items><graph_item><color>199C0D</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.dbstat.blks_hit.rate[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>1</sortorder><color>F63100</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.dbstat.blks_read.rate[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>2</sortorder><color>00611C</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.dbstat.conflicts.rate[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>3</sortorder><color>F7941D</color><item><host>PostgreSQL by Zabbix 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>PostgreSQL by Zabbix 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>PostgreSQL by Zabbix agent 2</host><key>pgsql.dbstat.temp_files.rate[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>6</sortorder><color>C7A72D</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.dbstat.tup_deleted.rate[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>7</sortorder><color>BA2A5D</color><item><host>PostgreSQL by Zabbix 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>PostgreSQL by Zabbix agent 2</host><key>pgsql.dbstat.tup_inserted.rate[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>9</sortorder><color>5CCD18</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.dbstat.tup_returned.rate[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>10</sortorder><color>BB2A02</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.dbstat.tup_updated.rate[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>11</sortorder><color>AC41A5</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.dbstat.xact_commit.rate[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>12</sortorder><color>89ABF8</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.dbstat.xact_rollback.rate[&quot;{#DBNAME}&quot;]</key></item></graph_item></graph_items></graph_prototype><graph_prototype><uuid>98f4c88e15b742fb80e1ecd8aeab970d</uuid><name>DB [{#DBNAME}]: Queries</name><ymin_type_1>FIXED</ymin_type_1><graph_items><graph_item><color>199C0D</color><yaxisside>RIGHT</yaxisside><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.queries.mro.time_max[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>1</sortorder><color>F63100</color><yaxisside>RIGHT</yaxisside><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.queries.query.time_max[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>2</sortorder><color>00611C</color><yaxisside>RIGHT</yaxisside><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.queries.tx.time_max[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>3</sortorder><drawtype>GRADIENT_LINE</drawtype><color>F7941D</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.queries.mro.time_sum[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>4</sortorder><drawtype>GRADIENT_LINE</drawtype><color>FC6EA3</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.queries.query.time_sum[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>5</sortorder><drawtype>GRADIENT_LINE</drawtype><color>6C59DC</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.queries.tx.time_sum[&quot;{#DBNAME}&quot;]</key></item></graph_item></graph_items></graph_prototype><graph_prototype><uuid>86853d8590344bad84aab1deb3d1cffc</uuid><name>DB [{#DBNAME}]: Size</name><graph_items><graph_item><drawtype>GRADIENT_LINE</drawtype><color>199C0D</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.db.size[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;,&quot;{#DBNAME}&quot;]</key></item></graph_item></graph_items></graph_prototype><graph_prototype><uuid>918a6fd8bd0e49c98f759778f44ab606</uuid><name>DB [{#DBNAME}]: Slow queries</name><ymin_type_1>FIXED</ymin_type_1><graph_items><graph_item><color>199C0D</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.queries.mro.slow_count[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>1</sortorder><color>F63100</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.queries.query.slow_count[&quot;{#DBNAME}&quot;]</key></item></graph_item><graph_item><sortorder>2</sortorder><color>00611C</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.queries.tx.slow_count[&quot;{#DBNAME}&quot;]</key></item></graph_item></graph_items></graph_prototype></graph_prototypes></discovery_rule><discovery_rule><uuid>e94f9017c06644a2bbcb48697381556d</uuid><name>Replication discovery</name><key>pgsql.replication.process.discovery[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key><delay>15m</delay><filter><evaltype>AND</evaltype><conditions><condition><macro>{#APPLICATION_NAME}</macro><value>{$PG.LLD.FILTER.APPLICATION}</value></condition></conditions></filter><description>Discovers replication lag metrics.</description><item_prototypes><item_prototype><uuid>a77e5e6702ff41af9defe102cbeeea74</uuid><name>Application [{#APPLICATION_NAME}]: Get replication</name><type>DEPENDENT</type><key>pgsql.replication.get_metrics[&quot;{#APPLICATION_NAME}&quot;]</key><history>0</history><value_type>TEXT</value_type><description>Collect metrics from the &quot;pg_stat_replication&quot; about the application &quot;{#APPLICATION_NAME}&quot; that is connected to this WAL sender, which contains information about the WAL sender process, showing statistics about replication to that sender's connected standby server.</description><preprocessing><step><type>JSONPATH</type><parameters><parameter>$['{#APPLICATION_NAME}']</parameter></parameters><error_handler>DISCARD_VALUE</error_handler></step></preprocessing><master_item><key>pgsql.replication.process[&quot;{$PG.CONNSTRING}&quot;,&quot;{$PG.USER}&quot;,&quot;{$PG.PASSWORD}&quot;]</key></master_item><tags><tag><tag>application</tag><value>{#APPLICATION_NAME}</value></tag><tag><tag>component</tag><value>raw</value></tag></tags></item_prototype><item_prototype><uuid>15b83330044042668e618501160c37e4</uuid><name>Application [{#APPLICATION_NAME}]: Replication flush lag</name><type>DEPENDENT</type><key>pgsql.replication.process.flush_lag[&quot;{#APPLICATION_NAME}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><units>s</units><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.flush_lag</parameter></parameters></step></preprocessing><master_item><key>pgsql.replication.get_metrics[&quot;{#APPLICATION_NAME}&quot;]</key></master_item><tags><tag><tag>application</tag><value>{#APPLICATION_NAME}</value></tag><tag><tag>component</tag><value>replication</value></tag></tags></item_prototype><item_prototype><uuid>0daf6e3c7843488cb3160a2bd6b09fbf</uuid><name>Application [{#APPLICATION_NAME}]: Replication replay lag</name><type>DEPENDENT</type><key>pgsql.replication.process.replay_lag[&quot;{#APPLICATION_NAME}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><units>s</units><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.replay_lag</parameter></parameters></step></preprocessing><master_item><key>pgsql.replication.get_metrics[&quot;{#APPLICATION_NAME}&quot;]</key></master_item><tags><tag><tag>application</tag><value>{#APPLICATION_NAME}</value></tag><tag><tag>component</tag><value>replication</value></tag></tags></item_prototype><item_prototype><uuid>2d96bc517d3a4c3fbcae8a7f1436bf72</uuid><name>Application [{#APPLICATION_NAME}]: Replication write lag</name><type>DEPENDENT</type><key>pgsql.replication.process.write_lag[&quot;{#APPLICATION_NAME}&quot;]</key><history>7d</history><value_type>FLOAT</value_type><units>s</units><preprocessing><step><type>JSONPATH</type><parameters><parameter>$.write_lag</parameter></parameters></step></preprocessing><master_item><key>pgsql.replication.get_metrics[&quot;{#APPLICATION_NAME}&quot;]</key></master_item><tags><tag><tag>application</tag><value>{#APPLICATION_NAME}</value></tag><tag><tag>component</tag><value>replication</value></tag></tags></item_prototype></item_prototypes><graph_prototypes><graph_prototype><uuid>e79dfe2d436d49da898772a9e7345825</uuid><name>Application [{#APPLICATION_NAME}]: Replication lag</name><graph_items><graph_item><color>199C0D</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.replication.process.flush_lag[&quot;{#APPLICATION_NAME}&quot;]</key></item></graph_item><graph_item><sortorder>1</sortorder><color>F63100</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.replication.process.replay_lag[&quot;{#APPLICATION_NAME}&quot;]</key></item></graph_item><graph_item><sortorder>2</sortorder><color>00611C</color><item><host>PostgreSQL by Zabbix agent 2</host><key>pgsql.replication.process.write_lag[&quot;{#APPLICATION_NAME}&quot;]</key></item></graph_item></graph_items></graph_prototype></graph_prototypes></discovery_rule></discovery_rules><tags><tag><tag>class</tag><value>database</value></tag><tag><tag>target</tag><value>postgresql</value></tag></tags><macros><macro><macro>{$PG.CONFLICTS.MAX.WARN}</macro><value>0</value><description>Maximum number of recovery conflicts for trigger expression.</description></macro><macro><macro>{$PG.CONNSTRING}</macro><value>tcp://localhost:5432</value><description>URI or named session of the PostgreSQL instance.</description></macro><macro><macro>{$PG.CONN_TOTAL_PCT.MAX.WARN}</macro><value>90</value><description>Maximum percentage of current connections for trigger expression.</description></macro><macro><macro>{$PG.DATABASE}</macro><value>postgres</value><description>Default PostgreSQL database for the connection.</description></macro><macro><macro>{$PG.DEADLOCKS.MAX.WARN}</macro><value>0</value><description>Maximum number of detected deadlocks for trigger expression.</description></macro><macro><macro>{$PG.LLD.FILTER.APPLICATION}</macro><value>.+</value><description>Filter of discoverable applications.</description></macro><macro><macro>{$PG.LLD.FILTER.DBNAME}</macro><value>.+</value><description>Filter of discoverable databases.</description></macro><macro><macro>{$PG.PASSWORD}</macro><value>&lt;Put the password here&gt;</value><description>PostgreSQL user password.</description></macro><macro><macro>{$PG.QUERY_ETIME.MAX.WARN}</macro><value>30</value><description>Execution time limit for count of slow queries.</description></macro><macro><macro>{$PG.SLOW_QUERIES.MAX.WARN}</macro><value>5</value><description>Slow queries count threshold for a trigger.</description></macro><macro><macro>{$PG.USER}</macro><value>zbx_monitor</value><description>PostgreSQL username.</description></macro></macros><dashboards><dashboard><uuid>e3ae726b06cc4663a3eef5a73909f796</uuid><name>PostgreSQL databases</name><pages><page><widgets><widget><type>graphprototype</type><width>36</width><height>5</height><fields><field><type>INTEGER</type><name>columns</name><value>1</value></field><field><type>GRAPH_PROTOTYPE</type><name>graphid.0</name><value><host>PostgreSQL by Zabbix agent 2</host><name>DB [{#DBNAME}]: pg_stat_database metrics</name></value></field><field><type>STRING</type><name>reference</name><value>AAAAA</value></field></fields></widget><widget><type>graphprototype</type><y>5</y><width>36</width><height>5</height><fields><field><type>INTEGER</type><name>columns</name><value>1</value></field><field><type>GRAPH_PROTOTYPE</type><name>graphid.0</name><value><host>PostgreSQL by Zabbix agent 2</host><name>DB [{#DBNAME}]: Size</name></value></field><field><type>STRING</type><name>reference</name><value>AAAAC</value></field></fields></widget><widget><type>graphprototype</type><y>10</y><width>36</width><height>5</height><fields><field><type>INTEGER</type><name>columns</name><value>1</value></field><field><type>GRAPH_PROTOTYPE</type><name>graphid.0</name><value><host>PostgreSQL by Zabbix agent 2</host><name>DB [{#DBNAME}]: Queries</name></value></field><field><type>STRING</type><name>reference</name><value>AAAAE</value></field></fields></widget><widget><type>graphprototype</type><x>36</x><width>36</width><height>5</height><fields><field><type>INTEGER</type><name>columns</name><value>1</value></field><field><type>GRAPH_PROTOTYPE</type><name>graphid.0</name><value><host>PostgreSQL by Zabbix agent 2</host><name>DB [{#DBNAME}]: Locks</name></value></field><field><type>STRING</type><name>reference</name><value>AAAAB</value></field></fields></widget><widget><type>graphprototype</type><x>36</x><y>5</y><width>36</width><height>5</height><fields><field><type>INTEGER</type><name>columns</name><value>1</value></field><field><type>GRAPH_PROTOTYPE</type><name>graphid.0</name><value><host>PostgreSQL by Zabbix agent 2</host><name>DB [{#DBNAME}]: Number of bloating tables</name></value></field><field><type>STRING</type><name>reference</name><value>AAAAD</value></field></fields></widget><widget><type>graphprototype</type><x>36</x><y>10</y><width>36</width><height>5</height><fields><field><type>INTEGER</type><name>columns</name><value>1</value></field><field><type>GRAPH_PROTOTYPE</type><name>graphid.0</name><value><host>PostgreSQL by Zabbix agent 2</host><name>DB [{#DBNAME}]: Slow queries</name></value></field><field><type>STRING</type><name>reference</name><value>AAAAF</value></field></fields></widget></widgets></page></pages></dashboard></dashboards><valuemaps><valuemap><uuid>cd2d975b0d7e4f8e89afb1033fce4ce2</uuid><name>PostgreSQL checksum failure status</name><mappings><mapping><value>-2</value><newvalue>null</newvalue></mapping></mappings></valuemap><valuemap><uuid>9f38c01c325248d4b538c0582432b541</uuid><name>PostgreSQL recovery role</name><mappings><mapping><value>0</value><newvalue>Master</newvalue></mapping><mapping><value>1</value><newvalue>Standby</newvalue></mapping></mappings></valuemap><valuemap><uuid>0fba38eefa4c4073b46d3f8579fda314</uuid><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></valuemap><valuemap><uuid>6619a58602a44e83950d3d4b5180c0e9</uuid><name>Service state</name><mappings><mapping><value>0</value><newvalue>Down</newvalue></mapping><mapping><value>1</value><newvalue>Up</newvalue></mapping></mappings></valuemap></valuemaps></template></templates></zabbix_export>