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

template_db_postgresql.yaml « postgresql « db « templates - github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6967ac859be2b037a5cc82bab39eb116f4338c8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
zabbix_export:
  version: '6.2'
  date: '2022-06-07T19:36:38Z'
  template_groups:
    -
      uuid: 748ad4d098d447d492bb935c907f652f
      name: Templates/Databases
  templates:
    -
      uuid: 399bd1ee587245ecac6f39beaa99886f
      template: 'PostgreSQL by Zabbix agent'
      name: 'PostgreSQL by Zabbix agent'
      description: |
        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
        
        Template tooling version used: 0.41
      groups:
        -
          name: Templates/Databases
      items:
        -
          uuid: d17c6c15154d40d1afa5b1eafb2ed93e
          name: 'Bgwriter: Buffers allocated per second'
          type: DEPENDENT
          key: pgsql.bgwriter.buffers_alloc.rate
          delay: '0'
          history: 7d
          value_type: FLOAT
          units: Bps
          description: 'Number of buffers allocated'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.buffers_alloc
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'pgsql.bgwriter["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: bgwriter
        -
          uuid: 2c3ee691d4a54fb6b566739a3a648df4
          name: 'Bgwriter: Buffers written directly by a backend per second'
          type: DEPENDENT
          key: pgsql.bgwriter.buffers_backend.rate
          delay: '0'
          history: 7d
          value_type: FLOAT
          units: Bps
          description: 'Number of buffers written directly by a backend'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.buffers_backend
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'pgsql.bgwriter["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: bgwriter
        -
          uuid: 77e1eb202a6346ce9df0f1bb2c078688
          name: 'Bgwriter: Buffers backend fsync per second'
          type: DEPENDENT
          key: pgsql.bgwriter.buffers_backend_fsync.rate
          delay: '0'
          history: 7d
          value_type: FLOAT
          description: 'Number of times a backend had to execute its own fsync call (normally the background writer handles those even when the backend does its own write)'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.buffers_backend_fsync
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'pgsql.bgwriter["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: bgwriter
        -
          uuid: e29d26a48d0143579bf3acc6655cd659
          name: 'Bgwriter: Buffers written during checkpoints per second'
          type: DEPENDENT
          key: pgsql.bgwriter.buffers_checkpoint.rate
          delay: '0'
          history: 7d
          value_type: FLOAT
          units: Bps
          description: 'Number of buffers written during checkpoints'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.buffers_checkpoint
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'pgsql.bgwriter["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: bgwriter
        -
          uuid: 5151183461a54d2bbfaad04b8cab3798
          name: 'Bgwriter: Buffers written by the background writer per second'
          type: DEPENDENT
          key: pgsql.bgwriter.buffers_clean.rate
          delay: '0'
          history: 7d
          value_type: FLOAT
          units: Bps
          description: 'Number of buffers written by the background writer'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.buffers_clean
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'pgsql.bgwriter["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: bgwriter
        -
          uuid: ff290c0602b9447e87240c1ecf467050
          name: 'Bgwriter: Requested checkpoints per second'
          type: DEPENDENT
          key: pgsql.bgwriter.checkpoints_req.rate
          delay: '0'
          history: 7d
          value_type: FLOAT
          description: 'Number of requested checkpoints that have been performed'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.checkpoints_req
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'pgsql.bgwriter["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: bgwriter
          triggers:
            -
              uuid: 65e7954489854ad3ad1698dead7c4c02
              expression: 'last(/PostgreSQL by Zabbix agent/pgsql.bgwriter.checkpoints_req.rate) > {$PG.CHECKPOINTS_REQ.MAX.WARN}'
              name: 'PostgreSQL: Required checkpoints occurs too frequently'
              event_name: 'PostgreSQL: Required checkpoints occurs too frequently (over {$PG.CHECKPOINTS_REQ.MAX.WARN})'
              priority: AVERAGE
              description: |
                Checkpoints are points in the sequence of transactions at which it is guaranteed that the heap and index data files have been updated with all information written before that checkpoint. At checkpoint time, all dirty data pages are flushed to disk and a special checkpoint record is written to the log file.
                https://www.postgresql.org/docs/current/wal-configuration.html
              tags:
                -
                  tag: scope
                  value: performance
        -
          uuid: a5271230be8b431cb96580180e099b98
          name: 'Bgwriter: Scheduled checkpoints per second'
          type: DEPENDENT
          key: pgsql.bgwriter.checkpoints_timed.rate
          delay: '0'
          history: 7d
          value_type: FLOAT
          description: 'Number of scheduled checkpoints that have been performed'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.checkpoints_timed
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'pgsql.bgwriter["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: bgwriter
        -
          uuid: 782d2368763b48ad8663aa9fb75c3326
          name: 'Bgwriter: Checkpoint sync time'
          type: DEPENDENT
          key: pgsql.bgwriter.checkpoint_sync_time
          delay: '0'
          history: 7d
          value_type: FLOAT
          units: s
          description: 'Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.checkpoint_sync_time
            -
              type: MULTIPLIER
              parameters:
                - '0.001'
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'pgsql.bgwriter["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: bgwriter
        -
          uuid: b5e5f463978c46dd9401963f48ea72eb
          name: 'Bgwriter: Checkpoint write time'
          type: DEPENDENT
          key: pgsql.bgwriter.checkpoint_write_time
          delay: '0'
          history: 7d
          value_type: FLOAT
          units: s
          description: 'Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk, in milliseconds'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.checkpoint_write_time
            -
              type: MULTIPLIER
              parameters:
                - '0.001'
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'pgsql.bgwriter["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: bgwriter
        -
          uuid: f273c71f92bf4ac0b6ec5a0a88d1239c
          name: 'Bgwriter: Max written per second'
          type: DEPENDENT
          key: pgsql.bgwriter.maxwritten_clean.rate
          delay: '0'
          history: 7d
          value_type: FLOAT
          description: 'Number of times the background writer stopped a cleaning scan because it had written too many buffers'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.maxwritten_clean
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'pgsql.bgwriter["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: bgwriter
        -
          uuid: 1fc5ba48a0974bd7bf965b5f130deded
          name: 'PostgreSQL: Get bgwriter'
          key: 'pgsql.bgwriter["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          history: 1h
          trends: '0'
          value_type: TEXT
          description: 'Statistics about the background writer process''s activity'
          tags:
            -
              tag: component
              value: raw
          triggers:
            -
              uuid: 768d28b9360b46cda3065f5082ba97ac
              expression: 'nodata(/PostgreSQL by Zabbix agent/pgsql.bgwriter["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"],30m) = 1'
              name: 'PostgreSQL: Failed to get items'
              event_name: 'PostgreSQL: Failed to get items (no data for 30m)'
              priority: WARNING
              description: 'Zabbix has not received data for items for the last 30 minutes'
              dependencies:
                -
                  name: 'PostgreSQL: Service is down'
                  expression: 'last(/PostgreSQL by Zabbix agent/pgsql.ping["{$PG.HOST}","{$PG.PORT}"]) = 0'
              tags:
                -
                  tag: scope
                  value: availability
        -
          uuid: 70a7581fabd14e05bda762b79811187c
          name: 'Status: Cache hit ratio %'
          key: 'pgsql.cache.hit["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          history: 7d
          value_type: FLOAT
          units: '%'
          description: 'Cache hit ratio'
          tags:
            -
              tag: component
              value: cache
          triggers:
            -
              uuid: 4d87cc71b40f4b59ad27f30f33b15a69
              expression: 'max(/PostgreSQL by Zabbix agent/pgsql.cache.hit["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"],5m) < {$PG.CACHE_HITRATIO.MIN.WARN}'
              name: 'PostgreSQL: Cache hit ratio too low'
              event_name: 'PostgreSQL: Cache hit ratio too low (under {$PG.CACHE_HITRATIO.MIN.WARN} in 5m)'
              priority: WARNING
              tags:
                -
                  tag: scope
                  value: performance
        -
          uuid: 248cbe5067324b9ca435f2aced5e2a5f
          name: 'Status: Config hash'
          key: 'pgsql.config.hash["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          delay: 15m
          history: 7d
          trends: '0'
          value_type: TEXT
          description: 'PostgreSQL configuration hash'
          preprocessing:
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          tags:
            -
              tag: component
              value: application
          triggers:
            -
              uuid: b727cfa6d3de4063b6a2dcb6cc84e27b
              expression: 'last(/PostgreSQL by Zabbix agent/pgsql.config.hash["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"],#1)<>last(/PostgreSQL by Zabbix agent/pgsql.config.hash["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"],#2) and length(last(/PostgreSQL by Zabbix agent/pgsql.config.hash["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]))>0'
              name: 'PostgreSQL: Configuration has changed'
              priority: INFO
              tags:
                -
                  tag: scope
                  value: notice
        -
          uuid: c78116d3acf24e6990ed27ba8008728c
          name: 'Connections sum: Active'
          type: DEPENDENT
          key: pgsql.connections.sum.active
          delay: '0'
          history: 7d
          description: 'Total number of connections executing a query'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.active
          master_item:
            key: 'pgsql.connections.sum["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: connections
        -
          uuid: be6eb6ecbfad420b889c58d1f1550b23
          name: 'Connections sum: Idle'
          type: DEPENDENT
          key: pgsql.connections.sum.idle
          delay: '0'
          history: 7d
          description: 'Total number of connections waiting for a new client command'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.idle
          master_item:
            key: 'pgsql.connections.sum["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: connections
        -
          uuid: 6471d014722c4072ae045df4c69578e3
          name: 'Connections sum: Idle in transaction'
          type: DEPENDENT
          key: pgsql.connections.sum.idle_in_transaction
          delay: '0'
          history: 7d
          description: 'Total number of connections in a transaction state, but not executing a query'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.idle_in_transaction
          master_item:
            key: 'pgsql.connections.sum["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: connections
        -
          uuid: 197cc14f55db485b891614c7b7ee2a51
          name: 'Connections sum: Prepared'
          type: DEPENDENT
          key: pgsql.connections.sum.prepared
          delay: '0'
          history: 7d
          description: |
            Total number of prepared transactions
            https://www.postgresql.org/docs/current/sql-prepare-transaction.html
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.prepared
          master_item:
            key: 'pgsql.connections.sum["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: connections
        -
          uuid: 24d23377c7cd4cc5b63f98a261c2501c
          name: 'Connections sum: Total'
          type: DEPENDENT
          key: pgsql.connections.sum.total
          delay: '0'
          history: 7d
          description: 'Total number of connections'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.total
          master_item:
            key: 'pgsql.connections.sum["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: connections
        -
          uuid: 488050d9aa8e4c2ea5b3e991ec5ddacc
          name: 'Connections sum: Total %'
          type: DEPENDENT
          key: pgsql.connections.sum.total_pct
          delay: '0'
          history: 7d
          units: '%'
          description: 'Total number of connections in percentage'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.total_pct
          master_item:
            key: 'pgsql.connections.sum["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: connections
          triggers:
            -
              uuid: 54ef12b8ff1e4383a3097c71478ceefa
              expression: 'min(/PostgreSQL by Zabbix agent/pgsql.connections.sum.total_pct,5m) > {$PG.CONN_TOTAL_PCT.MAX.WARN}'
              name: 'PostgreSQL: Total number of connections is too high'
              event_name: 'PostgreSQL: Total number of connections is too high (over {$PG.CONN_TOTAL_PCT.MAX.WARN} in 5m)'
              priority: AVERAGE
              tags:
                -
                  tag: scope
                  value: performance
        -
          uuid: fadd1333189c4ed29db57cf2acd158d0
          name: 'Connections sum: Waiting'
          type: DEPENDENT
          key: pgsql.connections.sum.waiting
          delay: '0'
          history: 7d
          description: |
            Total number of waiting connections
            https://www.postgresql.org/docs/current/monitoring-stats.html#WAIT-EVENT-TABLE
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.waiting
          master_item:
            key: 'pgsql.connections.sum["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: connections
        -
          uuid: b0da0c4856a645ca8ef03405d2d8d4a5
          name: 'PostgreSQL: Get connections sum'
          key: 'pgsql.connections.sum["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          history: 1h
          trends: '0'
          value_type: TEXT
          description: |
            Collect all metrics from pg_stat_activity
            https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW
          tags:
            -
              tag: component
              value: raw
        -
          uuid: b44f263fb33e461e8c3d700fb7688c7b
          name: 'PostgreSQL: Get dbstat'
          key: 'pgsql.dbstat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          history: 1h
          trends: '0'
          value_type: TEXT
          description: |
            Collect all metrics from pg_stat_database per database
            https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-DATABASE-VIEW
          tags:
            -
              tag: component
              value: raw
        -
          uuid: 7cee21f6225340ef80e9cdef7ce20b10
          name: 'PostgreSQL: Get locks'
          key: 'pgsql.locks["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          history: 1h
          trends: '0'
          value_type: TEXT
          description: |
            Collect all metrics from pg_locks per database
            https://www.postgresql.org/docs/current/explicit-locking.html#LOCKING-TABLES
          tags:
            -
              tag: component
              value: raw
        -
          uuid: f42bd73b3af6451b8a3a6113dcc1b675
          name: 'Status: Ping time'
          key: 'pgsql.ping.time["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          history: 7d
          value_type: FLOAT
          units: s
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'Time:\s+(\d+\.\d+)\s+ms'
                - \1
            -
              type: MULTIPLIER
              parameters:
                - '0.001'
          tags:
            -
              tag: component
              value: application
            -
              tag: component
              value: health
          triggers:
            -
              uuid: e19b5630737b4c63886b5df77a3c748c
              expression: 'min(/PostgreSQL by Zabbix agent/pgsql.ping.time["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"],5m) > {$PG.PING_TIME.MAX.WARN}'
              name: 'PostgreSQL: Response too long'
              event_name: 'PostgreSQL: Response too long (over {$PG.PING_TIME.MAX.WARN})'
              priority: AVERAGE
              dependencies:
                -
                  name: 'PostgreSQL: Service is down'
                  expression: 'last(/PostgreSQL by Zabbix agent/pgsql.ping["{$PG.HOST}","{$PG.PORT}"]) = 0'
              tags:
                -
                  tag: scope
                  value: availability
                -
                  tag: scope
                  value: performance
        -
          uuid: f5bd615243b344cb88dac1e83436cc85
          name: 'Status: Ping'
          key: 'pgsql.ping["{$PG.HOST}","{$PG.PORT}"]'
          history: 7d
          valuemap:
            name: 'Service state'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - 'return value.search(/accepting connections/)>0 ? 1 : 0'
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          tags:
            -
              tag: component
              value: application
            -
              tag: component
              value: health
          triggers:
            -
              uuid: 6d9c2b5353ce4f6baeeb0f254fb7d1e2
              expression: 'last(/PostgreSQL by Zabbix agent/pgsql.ping["{$PG.HOST}","{$PG.PORT}"]) = 0'
              name: 'PostgreSQL: Service is down'
              priority: HIGH
              tags:
                -
                  tag: scope
                  value: availability
        -
          uuid: 47bf580e1e4e48cf9c0e94fcf90288ac
          name: 'PostgreSQL: Get queries'
          key: 'pgsql.queries["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}","{$PG.QUERY_ETIME.MAX.WARN}"]'
          history: 1h
          trends: '0'
          value_type: TEXT
          description: 'Collect all metrics by query execution time'
          tags:
            -
              tag: component
              value: raw
        -
          uuid: d8a509bd011a4ecda5d439295e257e9d
          name: 'Replication: standby count'
          key: 'pgsql.replication.count["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          history: 7d
          description: 'Number of standby servers'
          tags:
            -
              tag: component
              value: replication
        -
          uuid: 21f8bea1141249c7a4dfafad5bc3ef41
          name: 'Replication: lag in seconds'
          key: 'pgsql.replication.lag.sec["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          history: 7d
          units: s
          description: 'Replication lag with Master in seconds'
          tags:
            -
              tag: component
              value: replication
          triggers:
            -
              uuid: 11831c52e86445498eed42de6a629b65
              expression: 'min(/PostgreSQL by Zabbix agent/pgsql.replication.lag.sec["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"],5m) > {$PG.REPL_LAG.MAX.WARN}'
              name: 'PostgreSQL: Streaming lag with {#MASTER} is too high'
              event_name: 'PostgreSQL: Streaming lag with {#MASTER} is too high (over {$PG.REPL_LAG.MAX.WARN} in 5m)'
              priority: AVERAGE
              tags:
                -
                  tag: scope
                  value: availability
                -
                  tag: scope
                  value: performance
        -
          uuid: 09f696124fca4c5b844bf66c9c912b87
          name: 'Replication: recovery role'
          key: 'pgsql.replication.recovery_role["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          history: 7d
          description: 'Replication role: 1 — recovery is still in progress (standby mode), 0 — master mode.'
          valuemap:
            name: 'PostgreSQL recovery role'
          tags:
            -
              tag: component
              value: replication
        -
          uuid: d449017462704508a4aad51a6b45fb30
          name: 'Replication: status'
          key: 'pgsql.replication.status["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          history: 7d
          description: 'Replication status: 0 — streaming is down, 1 — streaming is up, 2 — master mode'
          valuemap:
            name: 'PostgreSQL replication status'
          tags:
            -
              tag: component
              value: replication
          triggers:
            -
              uuid: aef1e1d2bab540f8ab738b4a3fad863c
              expression: 'max(/PostgreSQL by Zabbix agent/pgsql.replication.status["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"],5m)=0'
              name: 'PostgreSQL: Replication is down'
              priority: AVERAGE
              tags:
                -
                  tag: scope
                  value: availability
        -
          uuid: 4883717865c84c19b48d46f009317de2
          name: 'Transactions: Max active transaction time'
          type: DEPENDENT
          key: pgsql.transactions.active
          delay: '0'
          history: 7d
          value_type: FLOAT
          units: s
          description: 'Current max active transaction time'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.active
          master_item:
            key: 'pgsql.transactions["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: transactions
        -
          uuid: 4c89121d71a14c15b6169417ea69d0a3
          name: 'Transactions: Max idle transaction time'
          type: DEPENDENT
          key: pgsql.transactions.idle
          delay: '0'
          history: 7d
          value_type: FLOAT
          units: s
          description: 'Current max idle transaction time'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.idle
          master_item:
            key: 'pgsql.transactions["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: transactions
        -
          uuid: 0ee43ddd9da246d19097107b45e4c8e8
          name: 'Transactions: Max prepared transaction time'
          type: DEPENDENT
          key: pgsql.transactions.prepared
          delay: '0'
          history: 7d
          value_type: FLOAT
          units: s
          description: 'Current max prepared transaction time'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.prepared
          master_item:
            key: 'pgsql.transactions["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: transactions
        -
          uuid: da341b2011714a1f994ecbe96bd52155
          name: 'Transactions: Max waiting transaction time'
          type: DEPENDENT
          key: pgsql.transactions.waiting
          delay: '0'
          history: 7d
          value_type: FLOAT
          units: s
          description: 'Current max waiting transaction time'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.waiting
          master_item:
            key: 'pgsql.transactions["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: transactions
        -
          uuid: ff26a1c256bd40978f49a7a025538aa1
          name: 'PostgreSQL: Get transactions'
          key: 'pgsql.transactions["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          history: 1h
          trends: '0'
          value_type: TEXT
          description: 'Collect metrics by transaction execution time'
          tags:
            -
              tag: component
              value: raw
        -
          uuid: 6418a2f286e64ecabf2295fca063f8af
          name: 'Status: Uptime'
          key: 'pgsql.uptime["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          history: 7d
          units: uptime
          tags:
            -
              tag: component
              value: application
          triggers:
            -
              uuid: 85565aba402740868a16c0e4639a98fc
              expression: 'last(/PostgreSQL by Zabbix agent/pgsql.uptime["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]) < 10m'
              name: 'PostgreSQL: Service has been restarted'
              event_name: 'PostgreSQL: Service has been restarted (uptime < 10m)'
              priority: INFO
              description: 'PostgreSQL uptime is less than 10 minutes'
              tags:
                -
                  tag: scope
                  value: notice
        -
          uuid: 321525ebcea44396922e96deec2e8ad1
          name: 'Status: Version'
          key: 'pgsql.version["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          delay: 15m
          history: 7d
          trends: '0'
          value_type: CHAR
          description: 'PostgreSQL version'
          preprocessing:
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          tags:
            -
              tag: component
              value: application
          triggers:
            -
              uuid: 8111eb42b0e74fffb43da474677ebc2f
              expression: 'last(/PostgreSQL by Zabbix agent/pgsql.version["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"],#1)<>last(/PostgreSQL by Zabbix agent/pgsql.version["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"],#2) and length(last(/PostgreSQL by Zabbix agent/pgsql.version["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]))>0'
              name: 'PostgreSQL: Version has changed'
              event_name: 'PostgreSQL: Version has changed (new version value received: {ITEM.VALUE})'
              priority: INFO
              tags:
                -
                  tag: scope
                  value: notice
        -
          uuid: 5385ec7d39514039a641d18cba335ddc
          name: 'WAL: Segments count'
          type: DEPENDENT
          key: pgsql.wal.count
          delay: '0'
          history: 7d
          description: 'Number of WAL segments'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.count
          master_item:
            key: 'pgsql.wal.stat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: wal
        -
          uuid: 7cd6c524ecab41f9a22489866d503361
          name: 'PostgreSQL: Get WAL'
          key: 'pgsql.wal.stat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          delay: 5m
          history: 1h
          trends: '0'
          value_type: TEXT
          description: 'Master item to collect WAL metrics'
          tags:
            -
              tag: component
              value: raw
        -
          uuid: 5cc9c67621cc46e0a42b1eb79bda83b3
          name: 'WAL: Bytes written'
          type: DEPENDENT
          key: pgsql.wal.write
          delay: '0'
          history: 7d
          units: B
          description: 'WAL write in bytes'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.write
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'pgsql.wal.stat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          tags:
            -
              tag: component
              value: wal
      discovery_rules:
        -
          uuid: 5c4c658507394f5bb362e601f7c59d63
          name: 'Database discovery'
          key: 'pgsql.discovery.db["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
          delay: 1h
          filter:
            conditions:
              -
                macro: '{#DBNAME}'
                value: '{$PG.LLD.FILTER.DBNAME}'
                formulaid: A
          item_prototypes:
            -
              uuid: 69575e9785184ef5be2502e3cc282220
              name: 'DB {#DBNAME}: Database size'
              key: 'pgsql.db.size["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}","{#DBNAME}"]'
              delay: 15m
              history: 7d
              units: B
              description: 'Database size'
              tags:
                -
                  tag: component
                  value: storage
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: 615e6567a85e421bb06ab8cac0eaba69
              name: 'DB {#DBNAME}: Blocks hit per second'
              type: DEPENDENT
              key: 'pgsql.dbstat.blks_hit.rate["{#DBNAME}"]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Total number of times disk blocks were found already in the buffer cache, so that a read was not necessary'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].blks_hit'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'pgsql.dbstat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
              tags:
                -
                  tag: component
                  value: cache
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: 9136517d08b447869e5b8f5fd684c3b9
              name: 'DB {#DBNAME}: Disk blocks read per second'
              type: DEPENDENT
              key: 'pgsql.dbstat.blks_read.rate["{#DBNAME}"]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Total number of disk blocks read in this database'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].blks_read'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'pgsql.dbstat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
              tags:
                -
                  tag: component
                  value: storage
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: a76f6d28995441ff9fe28bbc09445e64
              name: 'DB {#DBNAME}: Detected conflicts per second'
              type: DEPENDENT
              key: 'pgsql.dbstat.conflicts.rate["{#DBNAME}"]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Total number of queries canceled due to conflicts with recovery in this database'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].conflicts'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'pgsql.dbstat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
              tags:
                -
                  tag: component
                  value: queries
                -
                  tag: database
                  value: '{#DBNAME}'
              trigger_prototypes:
                -
                  uuid: 3b51f02258bd4e02829f04ca016dd01d
                  expression: 'min(/PostgreSQL by Zabbix agent/pgsql.dbstat.conflicts.rate["{#DBNAME}"],5m) > {$PG.CONFLICTS.MAX.WARN:"{#DBNAME}"}'
                  name: 'DB {#DBNAME}: Too many recovery conflicts'
                  event_name: 'DB {#DBNAME}: Too many recovery conflicts (over {$PG.CONFLICTS.MAX.WARN:"{#DBNAME}"} in 5m)'
                  priority: AVERAGE
                  description: |
                    The primary and standby servers are in many ways loosely connected. Actions on the primary will have an effect on the standby. As a result, there is potential for negative interactions or conflicts between them.
                    https://www.postgresql.org/docs/current/hot-standby.html#HOT-STANDBY-CONFLICT
                  tags:
                    -
                      tag: scope
                      value: performance
            -
              uuid: b874cc2dd80643208c2479ad25fae0ac
              name: 'DB {#DBNAME}: Detected deadlocks per second'
              type: DEPENDENT
              key: 'pgsql.dbstat.deadlocks.rate["{#DBNAME}"]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Total number of detected deadlocks in this database'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].deadlocks'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'pgsql.dbstat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
              tags:
                -
                  tag: component
                  value: deadlocks
                -
                  tag: database
                  value: '{#DBNAME}'
              trigger_prototypes:
                -
                  uuid: 3bee63fa04d94586937e22aafab9bdd8
                  expression: 'min(/PostgreSQL by Zabbix agent/pgsql.dbstat.deadlocks.rate["{#DBNAME}"],5m) > {$PG.DEADLOCKS.MAX.WARN:"{#DBNAME}"}'
                  name: 'DB {#DBNAME}: Deadlock occurred'
                  event_name: 'DB {#DBNAME}: Deadlock occurred (over {$PG.DEADLOCKS.MAX.WARN:"{#DBNAME}"} in 5m)'
                  priority: HIGH
                  tags:
                    -
                      tag: scope
                      value: availability
            -
              uuid: d235ead54c8b41f9a91398c75383e5d7
              name: 'DB {#DBNAME}: Temp_bytes written per second'
              type: DEPENDENT
              key: 'pgsql.dbstat.temp_bytes.rate["{#DBNAME}"]'
              delay: '0'
              history: 7d
              units: B
              description: 'Total amount of data written to temporary files by queries in this database'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].temp_bytes'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'pgsql.dbstat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
              tags:
                -
                  tag: component
                  value: storage
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: af4e35eee1764d3f97d9c1218867f885
              name: 'DB {#DBNAME}: Temp_files created per second'
              type: DEPENDENT
              key: 'pgsql.dbstat.temp_files.rate["{#DBNAME}"]'
              delay: '0'
              history: 7d
              description: 'Total number of temporary files created by queries in this database'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].temp_files'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'pgsql.dbstat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
              tags:
                -
                  tag: component
                  value: storage
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: 35c6f93aefe4439bbc36f2f358440b16
              name: 'DB {#DBNAME}: Tuples deleted per second'
              type: DEPENDENT
              key: 'pgsql.dbstat.tup_deleted.rate["{#DBNAME}"]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Total number of rows deleted by queries in this database'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].tup_deleted'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'pgsql.dbstat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
              tags:
                -
                  tag: component
                  value: queries
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: 92f33d96f8a348088cdba593c0e66929
              name: 'DB {#DBNAME}: Tuples fetched per second'
              type: DEPENDENT
              key: 'pgsql.dbstat.tup_fetched.rate["{#DBNAME}"]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Total number of rows fetched by queries in this database'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].tup_fetched'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'pgsql.dbstat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
              tags:
                -
                  tag: component
                  value: queries
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: 8c03c87a44fe43928c32087ca7561e88
              name: 'DB {#DBNAME}: Tuples inserted per second'
              type: DEPENDENT
              key: 'pgsql.dbstat.tup_inserted.rate["{#DBNAME}"]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Total number of rows inserted by queries in this database'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].tup_inserted'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'pgsql.dbstat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
              tags:
                -
                  tag: component
                  value: queries
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: f6d378f4e38e455fa5a12467fe977657
              name: 'DB {#DBNAME}: Tuples returned per second'
              type: DEPENDENT
              key: 'pgsql.dbstat.tup_returned.rate["{#DBNAME}"]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Total number of rows updated by queries in this database'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].tup_returned'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'pgsql.dbstat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
              tags:
                -
                  tag: component
                  value: queries
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: 4c8de8c1064d43ffa18c4f37fead37f7
              name: 'DB {#DBNAME}: Tuples updated per second'
              type: DEPENDENT
              key: 'pgsql.dbstat.tup_updated.rate["{#DBNAME}"]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Total number of rows updated by queries in this database'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].tup_updated'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'pgsql.dbstat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
              tags:
                -
                  tag: component
                  value: queries
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: 81c33f5b3c31475fa5f28f4ad149a328
              name: 'DB {#DBNAME}: Commits per second'
              type: DEPENDENT
              key: 'pgsql.dbstat.xact_commit.rate["{#DBNAME}"]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of transactions in this database that have been committed'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].xact_commit'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'pgsql.dbstat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
              tags:
                -
                  tag: component
                  value: transactions
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: 8e5080186d034323be21473099b0b0ce
              name: 'DB {#DBNAME}: Rollbacks per second'
              type: DEPENDENT
              key: 'pgsql.dbstat.xact_rollback.rate["{#DBNAME}"]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Total number of transactions in this database that have been rolled back'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].xact_rollback'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'pgsql.dbstat["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
              tags:
                -
                  tag: component
                  value: transactions
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: df9dd9bac2a54f1085b29fb22b394a1f
              name: 'DB {#DBNAME}: Frozen XID before avtovacuum %'
              type: DEPENDENT
              key: 'pgsql.frozenxid.prc_before_av["{#DBNAME}"]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              units: '%'
              description: |
                reventing Transaction ID Wraparound Failures
                https://www.postgresql.org/docs/current/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.prc_before_av
              master_item:
                key: 'pgsql.frozenxid["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]'
              tags:
                -
                  tag: component
                  value: transactions
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: 44ddd66ea37449cb8fab6979b98dfd3c
              name: 'DB {#DBNAME}: Frozen XID before stop %'
              type: DEPENDENT
              key: 'pgsql.frozenxid.prc_before_stop["{#DBNAME}"]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              units: '%'
              description: |
                Preventing Transaction ID Wraparound Failures
                https://www.postgresql.org/docs/current/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.prc_before_stop
              master_item:
                key: 'pgsql.frozenxid["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]'
              tags:
                -
                  tag: component
                  value: transactions
                -
                  tag: database
                  value: '{#DBNAME}'
              trigger_prototypes:
                -
                  uuid: 709df9c1e29a4ff68a3de9423ff7ae58
                  expression: 'last(/PostgreSQL by Zabbix agent/pgsql.frozenxid.prc_before_stop["{#DBNAME}"])<{$PG.FROZENXID_PCT_STOP.MIN.HIGH:"{#DBNAME}"}'
                  name: 'DB {#DBNAME}: VACUUM FREEZE is required to prevent wraparound'
                  event_name: 'DB {#DBNAME}: VACUUM FREEZE is required to prevent wraparound (frozen XID less than {$PG.FROZENXID_PCT_STOP.MIN.HIGH:"{#DBNAME}"} %)'
                  priority: AVERAGE
                  description: |
                    Preventing Transaction ID Wraparound Failures
                    https://www.postgresql.org/docs/current/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND
                  tags:
                    -
                      tag: scope
                      value: availability
            -
              uuid: ddf6d0b7b5fe4cbbb540687051b8e5f5
              name: 'DB {#DBNAME}: Get frozen XID'
              key: 'pgsql.frozenxid["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]'
              history: 1h
              trends: '0'
              value_type: TEXT
              tags:
                -
                  tag: component
                  value: raw
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: 3d0acf4b45fc4a72bb2a214222f93f2a
              name: 'DB {#DBNAME}: Locks total'
              type: DEPENDENT
              key: 'pgsql.locks.total["{#DBNAME}"]'
              delay: '0'
              history: 7d
              description: 'Total number of locks in the database'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].total'
              master_item:
                key: 'pgsql.locks["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
              tags:
                -
                  tag: component
                  value: locks
                -
                  tag: database
                  value: '{#DBNAME}'
              trigger_prototypes:
                -
                  uuid: ef7d3c9866df44aa9b378e7f125a34de
                  expression: 'min(/PostgreSQL by Zabbix agent/pgsql.locks.total["{#DBNAME}"],5m)>{$PG.LOCKS.MAX.WARN:"{#DBNAME}"}'
                  name: 'DB {#DBNAME}: Number of locks is too high'
                  event_name: 'DB {#DBNAME}: Number of locks is too high (over {$PG.LOCKS.MAX.WARN:"{#DBNAME}"} in 5m)'
                  priority: WARNING
                  tags:
                    -
                      tag: scope
                      value: availability
            -
              uuid: 939ab05c71ed4be9979662203ebba980
              name: 'DB {#DBNAME}: Queries slow maintenance count'
              type: DEPENDENT
              key: 'pgsql.queries.mro.slow_count["{#DBNAME}"]'
              delay: '0'
              history: 7d
              description: 'Slow maintenance query count'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].mro_slow_count'
              master_item:
                key: 'pgsql.queries["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}","{$PG.QUERY_ETIME.MAX.WARN}"]'
              tags:
                -
                  tag: component
                  value: queries
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: bbc8f9bf86394cf28e0c2db44ee4711d
              name: 'DB {#DBNAME}: Queries max maintenance time'
              type: DEPENDENT
              key: 'pgsql.queries.mro.time_max["{#DBNAME}"]'
              delay: '0'
              history: 7d
              units: s
              description: 'Max maintenance query time'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].mro_time_max'
              master_item:
                key: 'pgsql.queries["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}","{$PG.QUERY_ETIME.MAX.WARN}"]'
              tags:
                -
                  tag: component
                  value: queries
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: f1427228bfa14ad3b7bb9d63bcfaec59
              name: 'DB {#DBNAME}: Queries sum maintenance time'
              type: DEPENDENT
              key: 'pgsql.queries.mro.time_sum["{#DBNAME}"]'
              delay: '0'
              history: 7d
              units: s
              description: 'Sum maintenance query time'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].mro_time_sum'
              master_item:
                key: 'pgsql.queries["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}","{$PG.QUERY_ETIME.MAX.WARN}"]'
              tags:
                -
                  tag: component
                  value: queries
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: 5d937f46f4684f1e8253ec62e0f75379
              name: 'DB {#DBNAME}: Queries slow query count'
              type: DEPENDENT
              key: 'pgsql.queries.query.slow_count["{#DBNAME}"]'
              delay: '0'
              history: 7d
              description: 'Slow query count'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].query_slow_count'
              master_item:
                key: 'pgsql.queries["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}","{$PG.QUERY_ETIME.MAX.WARN}"]'
              tags:
                -
                  tag: component
                  value: queries
                -
                  tag: database
                  value: '{#DBNAME}'
              trigger_prototypes:
                -
                  uuid: facc8f6976664da4ad5567d270f0f311
                  expression: 'min(/PostgreSQL by Zabbix agent/pgsql.queries.query.slow_count["{#DBNAME}"],5m)>{$PG.SLOW_QUERIES.MAX.WARN:"{#DBNAME}"}'
                  name: 'DB {#DBNAME}: Too many slow queries'
                  event_name: 'DB {#DBNAME}: Too many slow queries (over {$PG.SLOW_QUERIES.MAX.WARN:"{#DBNAME}"} in 5m)'
                  priority: WARNING
                  tags:
                    -
                      tag: scope
                      value: performance
            -
              uuid: 044cc16d0a2f46b28d88eff86c33b30b
              name: 'DB {#DBNAME}: Queries max query time'
              type: DEPENDENT
              key: 'pgsql.queries.query.time_max["{#DBNAME}"]'
              delay: '0'
              history: 7d
              units: s
              description: 'Max query time'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].query_time_max'
              master_item:
                key: 'pgsql.queries["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}","{$PG.QUERY_ETIME.MAX.WARN}"]'
              tags:
                -
                  tag: component
                  value: queries
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: c6232400b39c4564a30a403859ffb4ee
              name: 'DB {#DBNAME}: Queries sum query time'
              type: DEPENDENT
              key: 'pgsql.queries.query.time_sum["{#DBNAME}"]'
              delay: '0'
              history: 7d
              units: s
              description: 'Sum query time'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].query_time_sum'
              master_item:
                key: 'pgsql.queries["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}","{$PG.QUERY_ETIME.MAX.WARN}"]'
              tags:
                -
                  tag: component
                  value: queries
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: f7099043ea6345f0a5531f70f9573a3e
              name: 'DB {#DBNAME}: Queries slow transaction count'
              type: DEPENDENT
              key: 'pgsql.queries.tx.slow_count["{#DBNAME}"]'
              delay: '0'
              history: 7d
              description: 'Slow transaction query count'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].tx_slow_count'
              master_item:
                key: 'pgsql.queries["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}","{$PG.QUERY_ETIME.MAX.WARN}"]'
              tags:
                -
                  tag: component
                  value: queries
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: c6800ca30a564766ba745e875cb4e929
              name: 'DB {#DBNAME}: Queries max transaction time'
              type: DEPENDENT
              key: 'pgsql.queries.tx.time_max["{#DBNAME}"]'
              delay: '0'
              history: 7d
              units: s
              description: 'Max transaction query time'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].tx_time_max'
              master_item:
                key: 'pgsql.queries["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}","{$PG.QUERY_ETIME.MAX.WARN}"]'
              tags:
                -
                  tag: component
                  value: queries
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: 0eda974576794768ac9ddc592ff27e19
              name: 'DB {#DBNAME}: Queries sum transaction time'
              type: DEPENDENT
              key: 'pgsql.queries.tx.time_sum["{#DBNAME}"]'
              delay: '0'
              history: 7d
              units: s
              description: 'Sum transaction query time'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[''{#DBNAME}''].tx_time_sum'
              master_item:
                key: 'pgsql.queries["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}","{$PG.QUERY_ETIME.MAX.WARN}"]'
              tags:
                -
                  tag: component
                  value: queries
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: cafcc00cce824c33a321da0e9ecc7f6e
              name: 'DB {#DBNAME}: Index scans per second'
              type: DEPENDENT
              key: 'pgsql.scans.idx.rate["{#DBNAME}"]'
              delay: '0'
              history: 7d
              description: 'Number of index scans in the database'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.idx
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'pgsql.scans["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]'
              tags:
                -
                  tag: component
                  value: scans
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: f07396ca9d224e1b819f22efe6c4259d
              name: 'DB {#DBNAME}: Sequential scans per second'
              type: DEPENDENT
              key: 'pgsql.scans.seq.rate["{#DBNAME}"]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of sequential scans in the database'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.seq
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'pgsql.scans["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]'
              tags:
                -
                  tag: component
                  value: scans
                -
                  tag: database
                  value: '{#DBNAME}'
            -
              uuid: 4bf92e4b0fed4d32b808b299d9e1fb0c
              name: 'DB {#DBNAME}: Get scans'
              key: 'pgsql.scans["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAME}"]'
              history: 1h
              trends: '0'
              value_type: TEXT
              description: 'Number of scans done for table/index in the database'
              tags:
                -
                  tag: component
                  value: raw
                -
                  tag: database
                  value: '{#DBNAME}'
          graph_prototypes:
            -
              uuid: 3f8124b817f2437096c620d62ec2e055
              name: 'DB {#DBNAME}: Block hit/read'
              ymin_type_1: FIXED
              graph_items:
                -
                  color: 1A7C11
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.dbstat.blks_hit.rate["{#DBNAME}"]'
                -
                  sortorder: '1'
                  color: 2774A4
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.dbstat.blks_read.rate["{#DBNAME}"]'
            -
              uuid: 6bd0a0d65b8d43ad946b145cf8a8b533
              name: 'DB {#DBNAME}: Database size'
              ymin_type_1: FIXED
              graph_items:
                -
                  color: 1A7C11
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.db.size["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}","{#DBNAME}"]'
            -
              uuid: 41e765d906324595a396d8985b204ff5
              name: 'DB {#DBNAME}: Events'
              ymin_type_1: FIXED
              graph_items:
                -
                  drawtype: GRADIENT_LINE
                  color: 1A7C11
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.dbstat.xact_commit.rate["{#DBNAME}"]'
                -
                  sortorder: '1'
                  color: 2774A4
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.dbstat.conflicts.rate["{#DBNAME}"]'
                -
                  sortorder: '2'
                  color: F63100
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.dbstat.deadlocks.rate["{#DBNAME}"]'
                -
                  sortorder: '3'
                  color: A54F10
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.dbstat.xact_rollback.rate["{#DBNAME}"]'
            -
              uuid: 2b260fdf7623476095429434b5c79041
              name: 'DB {#DBNAME}: Locks'
              ymin_type_1: FIXED
              graph_items:
                -
                  color: 1A7C11
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.locks.total["{#DBNAME}"]'
            -
              uuid: 8a60a92b41b146f49145b86bab559b2e
              name: 'DB {#DBNAME}: Queries'
              ymin_type_1: FIXED
              graph_items:
                -
                  color: 1A7C11
                  yaxisside: RIGHT
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.queries.mro.time_max["{#DBNAME}"]'
                -
                  sortorder: '1'
                  color: 2774A4
                  yaxisside: RIGHT
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.queries.query.time_max["{#DBNAME}"]'
                -
                  sortorder: '2'
                  color: F63100
                  yaxisside: RIGHT
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.queries.tx.time_max["{#DBNAME}"]'
                -
                  sortorder: '3'
                  drawtype: GRADIENT_LINE
                  color: A54F10
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.queries.mro.time_sum["{#DBNAME}"]'
                -
                  sortorder: '4'
                  drawtype: GRADIENT_LINE
                  color: FC6EA3
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.queries.query.time_sum["{#DBNAME}"]'
                -
                  sortorder: '5'
                  drawtype: GRADIENT_LINE
                  color: 6C59DC
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.queries.tx.time_sum["{#DBNAME}"]'
            -
              uuid: 93518b06f71e46ada3dabefa1726b867
              name: 'DB {#DBNAME}: Slow queries'
              ymin_type_1: FIXED
              graph_items:
                -
                  color: 1A7C11
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.queries.mro.slow_count["{#DBNAME}"]'
                -
                  sortorder: '1'
                  color: 2774A4
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.queries.query.slow_count["{#DBNAME}"]'
                -
                  sortorder: '2'
                  color: F63100
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.queries.tx.slow_count["{#DBNAME}"]'
            -
              uuid: 779b872280ad46c7a6cdf95c2df7c646
              name: 'DB {#DBNAME}: Temp files'
              graph_items:
                -
                  drawtype: GRADIENT_LINE
                  color: 1A7C11
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.dbstat.temp_bytes.rate["{#DBNAME}"]'
                -
                  sortorder: '1'
                  color: 2774A4
                  yaxisside: RIGHT
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.dbstat.temp_files.rate["{#DBNAME}"]'
            -
              uuid: f10be22e3bac4d66936c34ec99446c64
              name: 'DB {#DBNAME}: Tuples'
              ymin_type_1: FIXED
              graph_items:
                -
                  color: 1A7C11
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.dbstat.tup_deleted.rate["{#DBNAME}"]'
                -
                  sortorder: '1'
                  color: 2774A4
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.dbstat.tup_fetched.rate["{#DBNAME}"]'
                -
                  sortorder: '2'
                  color: F63100
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.dbstat.tup_inserted.rate["{#DBNAME}"]'
                -
                  sortorder: '3'
                  color: A54F10
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.dbstat.tup_returned.rate["{#DBNAME}"]'
                -
                  sortorder: '4'
                  color: FC6EA3
                  item:
                    host: 'PostgreSQL by Zabbix agent'
                    key: 'pgsql.dbstat.tup_updated.rate["{#DBNAME}"]'
      tags:
        -
          tag: class
          value: database
        -
          tag: target
          value: postgresql
      macros:
        -
          macro: '{$PG.CACHE_HITRATIO.MIN.WARN}'
          value: '90'
        -
          macro: '{$PG.CHECKPOINTS_REQ.MAX.WARN}'
          value: '5'
        -
          macro: '{$PG.CONFLICTS.MAX.WARN}'
          value: '0'
        -
          macro: '{$PG.CONN_IDLE_IN_TRANS.MAX.WARN}'
          value: '5'
        -
          macro: '{$PG.CONN_TOTAL_PCT.MAX.WARN}'
          value: '90'
        -
          macro: '{$PG.CONN_WAIT.MAX.WARN}'
          value: '0'
        -
          macro: '{$PG.DB}'
          value: postgres
        -
          macro: '{$PG.DEADLOCKS.MAX.WARN}'
          value: '0'
        -
          macro: '{$PG.FROZENXID_PCT_STOP.MIN.HIGH}'
          value: '75'
        -
          macro: '{$PG.HOST}'
          value: 127.0.0.1
        -
          macro: '{$PG.LLD.FILTER.DBNAME}'
          value: '(.*)'
        -
          macro: '{$PG.LOCKS.MAX.WARN}'
          value: '100'
        -
          macro: '{$PG.PASSWORD}'
          description: 'Please set user''s password in this macro.'
        -
          macro: '{$PG.PING_TIME.MAX.WARN}'
          value: 1s
        -
          macro: '{$PG.PORT}'
          value: '5432'
        -
          macro: '{$PG.QUERY_ETIME.MAX.WARN}'
          value: '30'
        -
          macro: '{$PG.REPL_LAG.MAX.WARN}'
          value: 10m
        -
          macro: '{$PG.SLOW_QUERIES.MAX.WARN}'
          value: '5'
        -
          macro: '{$PG.TRANS_ACTIVE.MAX.WARN}'
          value: 30s
        -
          macro: '{$PG.TRANS_IDLE.MAX.WARN}'
          value: 30s
        -
          macro: '{$PG.TRANS_WAIT.MAX.WARN}'
          value: 30s
        -
          macro: '{$PG.USER}'
          value: zbx_monitor
      dashboards:
        -
          uuid: d95f29826778497a9ed265e0c335fd0f
          name: 'PostgreSQL databases'
          pages:
            -
              widgets:
                -
                  type: GRAPH_PROTOTYPE
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '2'
                    -
                      type: INTEGER
                      name: columns
                      value: '1'
                    -
                      type: INTEGER
                      name: rows
                      value: '1'
                    -
                      type: GRAPH_PROTOTYPE
                      name: graphid
                      value:
                        host: 'PostgreSQL by Zabbix agent'
                        name: 'DB {#DBNAME}: Tuples'
                -
                  type: GRAPH_PROTOTYPE
                  x: '12'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '2'
                    -
                      type: INTEGER
                      name: columns
                      value: '1'
                    -
                      type: INTEGER
                      name: rows
                      value: '1'
                    -
                      type: GRAPH_PROTOTYPE
                      name: graphid
                      value:
                        host: 'PostgreSQL by Zabbix agent'
                        name: 'DB {#DBNAME}: Events'
                -
                  type: GRAPH_PROTOTYPE
                  'y': '5'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '2'
                    -
                      type: INTEGER
                      name: columns
                      value: '1'
                    -
                      type: INTEGER
                      name: rows
                      value: '1'
                    -
                      type: GRAPH_PROTOTYPE
                      name: graphid
                      value:
                        host: 'PostgreSQL by Zabbix agent'
                        name: 'DB {#DBNAME}: Block hit/read'
                -
                  type: GRAPH_PROTOTYPE
                  x: '12'
                  'y': '5'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '2'
                    -
                      type: INTEGER
                      name: columns
                      value: '1'
                    -
                      type: INTEGER
                      name: rows
                      value: '1'
                    -
                      type: GRAPH_PROTOTYPE
                      name: graphid
                      value:
                        host: 'PostgreSQL by Zabbix agent'
                        name: 'DB {#DBNAME}: Temp files'
                -
                  type: GRAPH_PROTOTYPE
                  'y': '10'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '2'
                    -
                      type: INTEGER
                      name: columns
                      value: '1'
                    -
                      type: INTEGER
                      name: rows
                      value: '1'
                    -
                      type: GRAPH_PROTOTYPE
                      name: graphid
                      value:
                        host: 'PostgreSQL by Zabbix agent'
                        name: 'DB {#DBNAME}: Locks'
                -
                  type: GRAPH_PROTOTYPE
                  x: '12'
                  'y': '10'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '2'
                    -
                      type: INTEGER
                      name: columns
                      value: '1'
                    -
                      type: INTEGER
                      name: rows
                      value: '1'
                    -
                      type: GRAPH_PROTOTYPE
                      name: graphid
                      value:
                        host: 'PostgreSQL by Zabbix agent'
                        name: 'DB {#DBNAME}: Database size'
                -
                  type: GRAPH_PROTOTYPE
                  'y': '15'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '2'
                    -
                      type: INTEGER
                      name: columns
                      value: '1'
                    -
                      type: INTEGER
                      name: rows
                      value: '1'
                    -
                      type: GRAPH_PROTOTYPE
                      name: graphid
                      value:
                        host: 'PostgreSQL by Zabbix agent'
                        name: 'DB {#DBNAME}: Queries'
                -
                  type: GRAPH_PROTOTYPE
                  x: '12'
                  'y': '15'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '2'
                    -
                      type: INTEGER
                      name: columns
                      value: '1'
                    -
                      type: INTEGER
                      name: rows
                      value: '1'
                    -
                      type: GRAPH_PROTOTYPE
                      name: graphid
                      value:
                        host: 'PostgreSQL by Zabbix agent'
                        name: 'DB {#DBNAME}: Slow queries'
        -
          uuid: f2ceabf59fd64ca9828ea55e9b9668bd
          name: 'PostgreSQL stat'
          pages:
            -
              widgets:
                -
                  type: GRAPH_CLASSIC
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        host: 'PostgreSQL by Zabbix agent'
                        name: 'PostgreSQL connections'
                -
                  type: GRAPH_CLASSIC
                  x: '12'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        host: 'PostgreSQL by Zabbix agent'
                        name: 'PostgreSQL transactions'
                -
                  type: GRAPH_CLASSIC
                  'y': '5'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        host: 'PostgreSQL by Zabbix agent'
                        name: 'PostgreSQL ping'
                -
                  type: GRAPH_CLASSIC
                  x: '12'
                  'y': '5'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        host: 'PostgreSQL by Zabbix agent'
                        name: 'PostgreSQL uptime'
                -
                  type: GRAPH_CLASSIC
                  'y': '10'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        host: 'PostgreSQL by Zabbix agent'
                        name: 'PostgreSQL replication lag'
                -
                  type: GRAPH_CLASSIC
                  x: '12'
                  'y': '10'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        host: 'PostgreSQL by Zabbix agent'
                        name: 'PostgreSQL WAL'
                -
                  type: GRAPH_CLASSIC
                  'y': '15'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        host: 'PostgreSQL by Zabbix agent'
                        name: 'PostgreSQL bgwriter'
                -
                  type: GRAPH_CLASSIC
                  x: '12'
                  'y': '15'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        host: 'PostgreSQL by Zabbix agent'
                        name: 'PostgreSQL checkpoints'
      valuemaps:
        -
          uuid: 2e376ee568d04e7bbe98cbae4181f313
          name: 'PostgreSQL recovery role'
          mappings:
            -
              value: '0'
              newvalue: Master
            -
              value: '1'
              newvalue: Standby
        -
          uuid: 7f553f18ef6544ceaa4b50c4ebf0e583
          name: 'PostgreSQL replication status'
          mappings:
            -
              value: '0'
              newvalue: Down
            -
              value: '1'
              newvalue: Up
            -
              value: '2'
              newvalue: Master
        -
          uuid: 372bc939f3924aafa13c4821b83a9276
          name: 'Service state'
          mappings:
            -
              value: '0'
              newvalue: Down
            -
              value: '1'
              newvalue: Up
  graphs:
    -
      uuid: 6b4b92c62cb94e10b11f218ed35f6211
      name: 'PostgreSQL bgwriter'
      ymin_type_1: FIXED
      graph_items:
        -
          color: 1A7C11
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.bgwriter.buffers_alloc.rate
        -
          sortorder: '1'
          color: 2774A4
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.bgwriter.buffers_clean.rate
        -
          sortorder: '2'
          color: F63100
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.bgwriter.buffers_backend.rate
        -
          sortorder: '3'
          color: A54F10
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.bgwriter.buffers_checkpoint.rate
        -
          sortorder: '4'
          color: FC6EA3
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.bgwriter.maxwritten_clean.rate
        -
          sortorder: '5'
          color: 6C59DC
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.bgwriter.buffers_backend_fsync.rate
    -
      uuid: 4a105d193df64be7898ac19a2f07faa4
      name: 'PostgreSQL checkpoints'
      ymin_type_1: FIXED
      graph_items:
        -
          color: 1A7C11
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.bgwriter.checkpoints_timed.rate
        -
          sortorder: '1'
          color: 2774A4
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.bgwriter.checkpoints_req.rate
        -
          sortorder: '2'
          color: F63100
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.bgwriter.checkpoint_sync_time
        -
          sortorder: '3'
          color: A54F10
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.bgwriter.checkpoint_write_time
    -
      uuid: 8d41d719832049a5a1fcd6f4da67fb6a
      name: 'PostgreSQL connections'
      ymin_type_1: FIXED
      graph_items:
        -
          drawtype: GRADIENT_LINE
          color: 1A7C11
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.connections.sum.total
        -
          sortorder: '1'
          color: 2774A4
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.connections.sum.total_pct
        -
          sortorder: '2'
          color: F63100
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.connections.sum.active
        -
          sortorder: '3'
          color: A54F10
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.connections.sum.idle
        -
          sortorder: '4'
          color: FC6EA3
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.connections.sum.idle_in_transaction
        -
          sortorder: '5'
          color: 6C59DC
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.connections.sum.prepared
        -
          sortorder: '6'
          color: AC8C14
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.connections.sum.waiting
    -
      uuid: 1e9a55ee61824779a9f46f42ec21abef
      name: 'PostgreSQL ping'
      ymin_type_1: FIXED
      graph_items:
        -
          drawtype: GRADIENT_LINE
          color: 1A7C11
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: 'pgsql.ping["{$PG.HOST}","{$PG.PORT}"]'
        -
          sortorder: '1'
          color: 2774A4
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: 'pgsql.ping.time["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
    -
      uuid: d8cf31fc39584a63b9384d9c3ebf40ee
      name: 'PostgreSQL replication lag'
      ymin_type_1: FIXED
      graph_items:
        -
          color: 1A7C11
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: 'pgsql.replication.lag.sec["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
    -
      uuid: 10d1de74e9d848399ca038055e5cc8ce
      name: 'PostgreSQL transactions'
      ymin_type_1: FIXED
      graph_items:
        -
          color: 1A7C11
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.transactions.active
        -
          sortorder: '1'
          color: 2774A4
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.transactions.idle
        -
          sortorder: '2'
          color: F63100
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.transactions.prepared
        -
          sortorder: '3'
          color: A54F10
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.transactions.waiting
    -
      uuid: 45fe7967596741129b4f2462922636bf
      name: 'PostgreSQL uptime'
      show_triggers: 'NO'
      ymin_type_1: FIXED
      graph_items:
        -
          color: 1A7C11
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: 'pgsql.uptime["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
        -
          sortorder: '1'
          color: 2774A4
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: 'pgsql.cache.hit["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DB}"]'
    -
      uuid: 93ca2dc7a3ff4a458c45e2a56390ce72
      name: 'PostgreSQL WAL'
      ymin_type_1: FIXED
      graph_items:
        -
          color: 1A7C11
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.wal.write
        -
          sortorder: '1'
          color: 2774A4
          yaxisside: RIGHT
          item:
            host: 'PostgreSQL by Zabbix agent'
            key: pgsql.wal.count