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

template_app_haproxy_agent.yaml « haproxy_agent « app « templates - github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 17d52849a8ee92bf702ca525854178164620ac64 (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
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
zabbix_export:
  version: '6.2'
  date: '2022-04-06T19:54:30Z'
  groups:
    -
      uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
      name: Templates/Applications
  templates:
    -
      uuid: 812073bf8df143bcae2a84b32c3965e5
      template: 'HAProxy by Zabbix agent'
      name: 'HAProxy by Zabbix agent'
      description: |
        Get metrics from status page using Zabbix agent
        https://www.haproxy.com/blog/exploring-the-haproxy-stats-page/.
        Example configuration of HAProxy:
          frontend stats
              bind *:8404
              stats enable
              stats uri /stats
              stats refresh 10s
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/393527-discussion-thread-for-official-zabbix-template-haproxy
        
        Template tooling version used: 0.41
      groups:
        -
          name: Templates/Applications
      items:
        -
          uuid: ca85e2fda99b42a4ad2b373211a6b07d
          name: 'HAProxy: Get nodes'
          type: DEPENDENT
          key: haproxy.get.nodes
          delay: '0'
          history: '0'
          trends: '0'
          value_type: TEXT
          description: 'Array for LLD rules.'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - 'return JSON.stringify(JSON.parse(value),[''mode'',''pxname'',''svname''])'
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
          tags:
            -
              tag: component
              value: raw
        -
          uuid: 29381f1e0bdc4628a82ef1b7724f2e6f
          name: 'HAProxy: Uptime'
          type: DEPENDENT
          key: haproxy.uptime
          delay: '0'
          history: 7d
          value_type: FLOAT
          units: s
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  try {
                      var t = value.match(/(\d+)d (\d+)h(\d+)m(\d+)s/);
                      return t[1] * 86400 + t[2] * 3600 + t[3] * 60 + t[4] * 1;
                  }
                  catch (error) {
                      throw "HAProxy uptime is not found : " + error;
                  }
          master_item:
            key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH}"]'
          tags:
            -
              tag: component
              value: application
          triggers:
            -
              uuid: e76d5b82b0ad421ea62cd1dc069e036b
              expression: 'last(/HAProxy by Zabbix agent/haproxy.uptime)<10m'
              name: 'HAProxy: has been restarted'
              event_name: 'HAProxy: has been restarted (uptime < 10m)'
              priority: INFO
              description: 'Uptime is less than 10 minutes'
              manual_close: 'YES'
              tags:
                -
                  tag: scope
                  value: notice
        -
          uuid: e930e70fb1b44d9cbe673f35133c6e77
          name: 'HAProxy: Version'
          type: DEPENDENT
          key: haproxy.version
          delay: '0'
          trends: '0'
          value_type: CHAR
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'HAProxy version ([^,]*),'
                - \1
              error_handler: CUSTOM_ERROR
              error_handler_params: 'HAProxy version is not found'
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          master_item:
            key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH}"]'
          tags:
            -
              tag: component
              value: application
          triggers:
            -
              uuid: db6ef8f306f64f0f81a590e4b45b370c
              expression: 'last(/HAProxy by Zabbix agent/haproxy.version,#1)<>last(/HAProxy by Zabbix agent/haproxy.version,#2) and length(last(/HAProxy by Zabbix agent/haproxy.version))>0'
              name: 'HAProxy: Version has changed'
              event_name: 'HAProxy: Version has changed (new version: {ITEM.VALUE})'
              priority: INFO
              description: 'HAProxy version has changed. Ack to close.'
              manual_close: 'YES'
              tags:
                -
                  tag: scope
                  value: notice
        -
          uuid: c224cfe9b7474f9e80618dde78cfcb11
          name: 'HAProxy: Service response time'
          key: 'net.tcp.service.perf["{$HAPROXY.STATS.SCHEME}","{HOST.CONN}","{$HAPROXY.STATS.PORT}"]'
          history: 7d
          value_type: FLOAT
          units: s
          tags:
            -
              tag: component
              value: health
            -
              tag: component
              value: network
          triggers:
            -
              uuid: 4e881047bbd54c5984922d1189567ece
              expression: 'min(/HAProxy by Zabbix agent/net.tcp.service.perf["{$HAPROXY.STATS.SCHEME}","{HOST.CONN}","{$HAPROXY.STATS.PORT}"],5m)>{$HAPROXY.RESPONSE_TIME.MAX.WARN}'
              name: 'HAProxy: Service response time is too high'
              event_name: 'HAProxy: Service response time is too high (over {$HAPROXY.RESPONSE_TIME.MAX.WARN} for 5m)'
              priority: WARNING
              manual_close: 'YES'
              dependencies:
                -
                  name: 'HAProxy: Service is down'
                  expression: 'last(/HAProxy by Zabbix agent/net.tcp.service["{$HAPROXY.STATS.SCHEME}","{HOST.CONN}","{$HAPROXY.STATS.PORT}"])=0'
              tags:
                -
                  tag: scope
                  value: performance
        -
          uuid: 97e45c508f5a4df78fc783382088e233
          name: 'HAProxy: Service status'
          key: 'net.tcp.service["{$HAPROXY.STATS.SCHEME}","{HOST.CONN}","{$HAPROXY.STATS.PORT}"]'
          history: 7d
          valuemap:
            name: 'Service state'
          preprocessing:
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 10m
          tags:
            -
              tag: component
              value: health
            -
              tag: component
              value: network
          triggers:
            -
              uuid: 8d5c7940e5924b469b3e7804043ea7b6
              expression: 'last(/HAProxy by Zabbix agent/net.tcp.service["{$HAPROXY.STATS.SCHEME}","{HOST.CONN}","{$HAPROXY.STATS.PORT}"])=0'
              name: 'HAProxy: Service is down'
              priority: AVERAGE
              manual_close: 'YES'
              tags:
                -
                  tag: scope
                  value: availability
        -
          uuid: e70009bd4e3041a3952738673ebb5c29
          name: 'HAProxy: Get stats page'
          key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH}"]'
          history: '0'
          trends: '0'
          value_type: TEXT
          description: 'HAProxy Statistics Report HTML'
          tags:
            -
              tag: component
              value: raw
        -
          uuid: aabdb5706b6744379561f269e0709141
          name: 'HAProxy: Get stats'
          key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
          history: '0'
          trends: '0'
          value_type: TEXT
          description: 'HAProxy Statistics Report in CSV format'
          preprocessing:
            -
              type: REGEX
              parameters:
                - '# ([\s\S]*)'
                - \1
            -
              type: CSV_TO_JSON
              parameters:
                - ''
                - ''
                - '1'
          tags:
            -
              tag: component
              value: raw
      discovery_rules:
        -
          uuid: 9899f0a11ece4b9194ca44a8fc34b066
          name: 'Backend discovery'
          type: DEPENDENT
          key: haproxy.backend.discovery
          delay: '0'
          filter:
            evaltype: AND
            conditions:
              -
                macro: '{#SVNAME}'
                value: BACKEND
                formulaid: B
              -
                macro: '{#MODE}'
                value: http|tcp
                formulaid: A
          description: 'Discovery backends'
          item_prototypes:
            -
              uuid: 1ee660a3cfbd4e76a20a32524cdb707f
              name: 'HAProxy Backend {#PXNAME}: Number of active servers'
              type: DEPENDENT
              key: 'haproxy.backend.act[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              description: 'Number of active servers.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].act.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: servers
            -
              uuid: 6c4b8a679428455aadbd307162635e6e
              name: 'HAProxy Backend {#PXNAME}: Number of backup servers'
              type: DEPENDENT
              key: 'haproxy.backend.bck[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              description: 'Number of backup servers.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].bck.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: servers
            -
              uuid: 7d5a7b04e836417b96f2301d91fabab4
              name: 'HAProxy Backend {#PXNAME}: Incoming traffic'
              type: DEPENDENT
              key: 'haproxy.backend.bin.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              units: bps
              description: 'Number of bits received by the backend'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].bin.first()'
                -
                  type: MULTIPLIER
                  parameters:
                    - '8'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: network
            -
              uuid: fc353e7b680648698ecf949f784ca0ce
              name: 'HAProxy Backend {#PXNAME}: Outgoing traffic'
              type: DEPENDENT
              key: 'haproxy.backend.bout.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              units: bps
              description: 'Number of bits sent by the backend'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].bout.first()'
                -
                  type: MULTIPLIER
                  parameters:
                    - '8'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: network
            -
              uuid: 3df452e68f144fc3a8e5ff7644ace606
              name: 'HAProxy Backend {#PXNAME}: Responses denied per second'
              type: DEPENDENT
              key: 'haproxy.backend.dresp.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Responses denied due to security concerns (ACL-restricted).'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].dresp.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: responses
            -
              uuid: 5e315f24828d45b285e92971d5456234
              name: 'HAProxy Backend {#PXNAME}: Errors connection per second'
              type: DEPENDENT
              key: 'haproxy.backend.econ.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of requests that encountered an error attempting to connect to a backend server.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].econ.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: connections
            -
              uuid: f1ca728c571e4cf4ac9ebc36e96df27e
              name: 'HAProxy Backend {#PXNAME}: Response errors per second'
              type: DEPENDENT
              key: 'haproxy.backend.eresp.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of requests whose responses yielded an error'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].eresp.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: responses
              trigger_prototypes:
                -
                  uuid: 892d6f67eeff4520aadbf4f3841f8174
                  expression: 'min(/HAProxy by Zabbix agent/haproxy.backend.eresp.rate[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.BACK_ERESP.MAX.WARN}'
                  name: 'HAProxy backend {#PXNAME}: Number of responses with error is high'
                  event_name: 'HAProxy backend {#PXNAME}: Number of responses with error is more than {$HAPROXY.BACK_ERESP.MAX.WARN} for 5m'
                  priority: WARNING
                  description: 'Number of requests on backend, whose responses yielded an error, is more than {$HAPROXY.BACK_ERESP.MAX.WARN}.'
                  tags:
                    -
                      tag: scope
                      value: notice
            -
              uuid: a32d07355a9c4e9f9f63bac4ef2ef342
              name: 'HAProxy Backend {#PXNAME}: Number of responses with codes 1xx per second'
              type: DEPENDENT
              key: 'haproxy.backend.hrsp_1xx.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of informational HTTP responses per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].hrsp_1xx.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: responses
            -
              uuid: 2b02a86c01a245859ad4305d25569ab0
              name: 'HAProxy Backend {#PXNAME}: Number of responses with codes 2xx per second'
              type: DEPENDENT
              key: 'haproxy.backend.hrsp_2xx.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of successful HTTP responses per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].hrsp_2xx.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: responses
            -
              uuid: 24de211953f8480c9e1118abde731344
              name: 'HAProxy Backend {#PXNAME}: Number of responses with codes 3xx per second'
              type: DEPENDENT
              key: 'haproxy.backend.hrsp_3xx.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of HTTP redirections per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].hrsp_3xx.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: responses
            -
              uuid: 221ef133420f4140a17146eb976744eb
              name: 'HAProxy Backend {#PXNAME}: Number of responses with codes 4xx per second'
              type: DEPENDENT
              key: 'haproxy.backend.hrsp_4xx.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of HTTP client errors per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].hrsp_4xx.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: responses
            -
              uuid: 3a3f40a93c184673bdbd220add5ef458
              name: 'HAProxy Backend {#PXNAME}: Number of responses with codes 5xx per second'
              type: DEPENDENT
              key: 'haproxy.backend.hrsp_5xx.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of HTTP server errors per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].hrsp_5xx.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: responses
            -
              uuid: 389e5f77b422419386c2fa21db612697
              name: 'HAProxy Backend {#PXNAME}: Unassigned requests'
              type: DEPENDENT
              key: 'haproxy.backend.qcur[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              description: 'Current number of requests unassigned in queue.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].qcur.first()'
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: requests
              trigger_prototypes:
                -
                  uuid: 89ccc4b4a55349c7869c2202881dcb2a
                  expression: 'min(/HAProxy by Zabbix agent/haproxy.backend.qcur[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.BACK_QCUR.MAX.WARN}'
                  name: 'HAProxy backend {#PXNAME}: Current number of requests unassigned in queue is high'
                  event_name: 'HAProxy backend {#PXNAME}: Current number of requests unassigned in queue is more than {$HAPROXY.BACK_QCUR.MAX.WARN} for 5m'
                  priority: WARNING
                  description: 'Current number of requests on backend unassigned in queue is more than {$HAPROXY.BACK_QCUR.MAX.WARN}.'
                  tags:
                    -
                      tag: scope
                      value: notice
            -
              uuid: a58ff94387824acb81b27cab5cfc680a
              name: 'HAProxy Backend {#PXNAME}: Time in queue'
              type: DEPENDENT
              key: 'haproxy.backend.qtime[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              units: s
              description: 'Average time spent in queue (in ms) for the last 1,024 requests'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].qtime.first()'
                -
                  type: MULTIPLIER
                  parameters:
                    - '0.001'
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: requests
              trigger_prototypes:
                -
                  uuid: 1aff4be13f0f4aee8a512d4b962215a6
                  expression: 'min(/HAProxy by Zabbix agent/haproxy.backend.qtime[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.BACK_QTIME.MAX.WARN}'
                  name: 'HAProxy backend {#PXNAME}: Average time spent in queue is high'
                  event_name: 'HAProxy backend {#PXNAME}: Average time spent in queue is more than {$HAPROXY.BACK_QTIME.MAX.WARN} for 5m'
                  priority: WARNING
                  description: 'Average time spent in queue (in ms) for the last 1,024 requests is more than {$HAPROXY.BACK_QTIME.MAX.WARN}.'
                  tags:
                    -
                      tag: scope
                      value: performance
            -
              uuid: 7e801fd81fed448db7dd6c6eeaa398d5
              name: 'HAProxy Backend {#PXNAME}: Responses time'
              type: DEPENDENT
              key: 'haproxy.backend.rtime[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              units: s
              description: 'Average backend response time (in ms) for the last 1,024 requests'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].rtime.first()'
                -
                  type: MULTIPLIER
                  parameters:
                    - '0.001'
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: responses
              trigger_prototypes:
                -
                  uuid: e0dd27ac272a4fbf9495c09f3291db8f
                  expression: 'min(/HAProxy by Zabbix agent/haproxy.backend.rtime[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.BACK_RTIME.MAX.WARN}'
                  name: 'HAProxy backend {#PXNAME}: Average response time is high'
                  event_name: 'HAProxy backend {#PXNAME}: Average response time is more than {$HAPROXY.BACK_RTIME.MAX.WARN} for 5m'
                  priority: WARNING
                  description: 'Average backend response time (in ms) for the last 1,024 requests is more than {$HAPROXY.BACK_RTIME.MAX.WARN}.'
                  tags:
                    -
                      tag: scope
                      value: performance
            -
              uuid: 5826a63314314ef297c81749561574d2
              name: 'HAProxy Backend {#PXNAME}: Status'
              type: DEPENDENT
              key: 'haproxy.backend.status[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: |
                Possible values:
                UP - The server is reporting as healthy.
                DOWN - The server is reporting as unhealthy and unable to receive requests.
                NOLB - You've added http-check disable-on-404 to the backend and the health checked URL has returned an HTTP 404 response.
                MAINT - The server has been disabled or put into maintenance mode.
                DRAIN - The server has been put into drain mode.
                no check - Health checks are not enabled for this server.
              valuemap:
                name: 'Service state'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].status.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 10m
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: health
              trigger_prototypes:
                -
                  uuid: 51452fd94c12448fab0703e867f69fd2
                  expression: 'count(/HAProxy by Zabbix agent/haproxy.backend.status[{#PXNAME},{#SVNAME}],#5,"eq","DOWN")=5'
                  name: 'HAProxy backend {#PXNAME}: Server is DOWN'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: AVERAGE
                  description: 'Backend is not available.'
                  tags:
                    -
                      tag: scope
                      value: availability
            -
              uuid: d11c9b4c7027475e897456e712675cc9
              name: 'HAProxy Backend {#PXNAME}: Sessions per second'
              type: DEPENDENT
              key: 'haproxy.backend.stot.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Cumulative number of sessions (end-to-end connections) per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].stot.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: sessions
            -
              uuid: 21cc9c7a1b7042f0bb14eeab91464ae8
              name: 'HAProxy Backend {#PXNAME}: Weight'
              type: DEPENDENT
              key: 'haproxy.backend.weight[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              description: 'Total effective weight.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].weight.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: balancer
            -
              uuid: bebad9eb0731474db798eacde7771238
              name: 'HAProxy Backend {#PXNAME}: Redispatched requests per second'
              type: DEPENDENT
              key: 'haproxy.backend.wredis.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of times a request was redispatched to a different backend.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].wredis.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: requests
            -
              uuid: 0f09a6b800d747f4beed96a25b5cfa49
              name: 'HAProxy Backend {#PXNAME}: Retried connections per second'
              type: DEPENDENT
              key: 'haproxy.backend.wretr.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of times a connection was retried.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].wretr.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: backend
                  value: '{#PXNAME}'
                -
                  tag: component
                  value: connections
          graph_prototypes:
            -
              uuid: 70bf1a17304e495dae74b86b93ac9773
              name: 'HAProxy: Backend {#PXNAME} In/Out traffic'
              graph_items:
                -
                  drawtype: GRADIENT_LINE
                  color: 1A7C11
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.backend.bin.rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '1'
                  drawtype: GRADIENT_LINE
                  color: 2774A4
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.backend.bout.rate[{#PXNAME},{#SVNAME}]'
            -
              uuid: a8518997e8ce40339f5d2384a011f3ba
              name: 'HAProxy: Backend {#PXNAME} Redispatched requests and retried connections per second'
              graph_items:
                -
                  color: 1A7C11
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.backend.wredis.rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '1'
                  color: 2774A4
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.backend.wretr.rate[{#PXNAME},{#SVNAME}]'
            -
              uuid: 50d592985cd74d0a95904971dc40767d
              name: 'HAProxy: Backend {#PXNAME} Responses by HTTP code'
              type: STACKED
              graph_items:
                -
                  color: 1A7C11
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.backend.hrsp_1xx.rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '1'
                  color: 2774A4
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.backend.hrsp_2xx.rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '2'
                  color: F63100
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.backend.hrsp_3xx.rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '3'
                  color: A54F10
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.backend.hrsp_4xx.rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '4'
                  color: FC6EA3
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.backend.hrsp_5xx.rate[{#PXNAME},{#SVNAME}]'
          master_item:
            key: haproxy.get.nodes
          lld_macro_paths:
            -
              lld_macro: '{#PXNAME}'
              path: $.pxname
            -
              lld_macro: '{#SVNAME}'
              path: $.svname
            -
              lld_macro: '{#MODE}'
              path: $.mode
          overrides:
            -
              name: 'Discard HTTP status codes'
              step: '1'
              filter:
                conditions:
                  -
                    macro: '{#MODE}'
                    value: tcp
                    formulaid: A
              operations:
                -
                  operationobject: ITEM_PROTOTYPE
                  operator: LIKE
                  value: 'Number of responses with codes'
                  status: ENABLED
                  discover: NO_DISCOVER
        -
          uuid: 69264415d8644ef597affd3dc95d42b2
          name: 'Frontend discovery'
          type: DEPENDENT
          key: haproxy.frontend.discovery
          delay: '0'
          filter:
            evaltype: AND
            conditions:
              -
                macro: '{#SVNAME}'
                value: FRONTEND
                formulaid: B
              -
                macro: '{#MODE}'
                value: http|tcp
                formulaid: A
          description: 'Discovery frontends'
          item_prototypes:
            -
              uuid: 434f9c1dd63946d3a181c42bcee94e07
              name: 'HAProxy Frontend {#PXNAME}: Incoming traffic'
              type: DEPENDENT
              key: 'haproxy.frontend.bin.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              units: bps
              description: 'Number of bits received by the frontend'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].bin.first()'
                -
                  type: MULTIPLIER
                  parameters:
                    - '8'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: network
                -
                  tag: frontend
                  value: '{#PXNAME}'
            -
              uuid: 047ec4b444af4bc38f74eb7fabf2fb94
              name: 'HAProxy Frontend {#PXNAME}: Outgoing traffic'
              type: DEPENDENT
              key: 'haproxy.frontend.bout.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              units: bps
              description: 'Number of bits sent by the frontend'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].bout.first()'
                -
                  type: MULTIPLIER
                  parameters:
                    - '8'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: network
                -
                  tag: frontend
                  value: '{#PXNAME}'
            -
              uuid: 4542ee3da6334468b6a146083bfa1208
              name: 'HAProxy Frontend {#PXNAME}: Denied requests per second'
              type: DEPENDENT
              key: 'haproxy.frontend.dreq.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Requests denied due to security concerns (ACL-restricted) per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].dreq.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: requests
                -
                  tag: frontend
                  value: '{#PXNAME}'
              trigger_prototypes:
                -
                  uuid: 269d5e491e3d41b6be5257c8a8a85efb
                  expression: 'min(/HAProxy by Zabbix agent/haproxy.frontend.dreq.rate[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.FRONT_DREQ.MAX.WARN}'
                  name: 'HAProxy frontend {#PXNAME}: Number of requests denied is high'
                  event_name: 'HAProxy frontend {#PXNAME}: Number of requests denied is more than {$HAPROXY.FRONT_DREQ.MAX.WARN} for 5m'
                  priority: WARNING
                  description: 'Number of requests denied due to security concerns (ACL-restricted) is more than {$HAPROXY.FRONT_DREQ.MAX.WARN}.'
                  tags:
                    -
                      tag: scope
                      value: notice
            -
              uuid: 2da48ea7b7fb4432b041b9706017778e
              name: 'HAProxy Frontend {#PXNAME}: Request errors per second'
              type: DEPENDENT
              key: 'haproxy.frontend.ereq.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of request errors per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].ereq.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: requests
                -
                  tag: frontend
                  value: '{#PXNAME}'
              trigger_prototypes:
                -
                  uuid: 8361fb028aed4bd9bf3356249699d424
                  expression: 'min(/HAProxy by Zabbix agent/haproxy.frontend.ereq.rate[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.FRONT_EREQ.MAX.WARN}'
                  name: 'HAProxy frontend {#PXNAME}: Number of request errors is high'
                  event_name: 'HAProxy frontend {#PXNAME}: Number of request errors is more than {$HAPROXY.FRONT_EREQ.MAX.WARN} for 5m'
                  priority: WARNING
                  description: 'Number of request errors is more than {$HAPROXY.FRONT_EREQ.MAX.WARN}.'
                  tags:
                    -
                      tag: scope
                      value: notice
            -
              uuid: d4d6d7092c524a4aa9ac83f9506fcb44
              name: 'HAProxy Frontend {#PXNAME}: Number of responses with codes 1xx per second'
              type: DEPENDENT
              key: 'haproxy.frontend.hrsp_1xx.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of informational HTTP responses per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].hrsp_1xx.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: responses
                -
                  tag: frontend
                  value: '{#PXNAME}'
            -
              uuid: 34bb4142cb4c48678f1136ed7a582ff7
              name: 'HAProxy Frontend {#PXNAME}: Number of responses with codes 2xx per second'
              type: DEPENDENT
              key: 'haproxy.frontend.hrsp_2xx.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of successful HTTP responses per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].hrsp_2xx.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: responses
                -
                  tag: frontend
                  value: '{#PXNAME}'
            -
              uuid: 3d6966759c864b0d94daceead022e421
              name: 'HAProxy Frontend {#PXNAME}: Number of responses with codes 3xx per second'
              type: DEPENDENT
              key: 'haproxy.frontend.hrsp_3xx.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of HTTP redirections per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].hrsp_3xx.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: responses
                -
                  tag: frontend
                  value: '{#PXNAME}'
            -
              uuid: 3fe3871812254cf0a228b6607f02ea12
              name: 'HAProxy Frontend {#PXNAME}: Number of responses with codes 4xx per second'
              type: DEPENDENT
              key: 'haproxy.frontend.hrsp_4xx.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of HTTP client errors per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].hrsp_4xx.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: responses
                -
                  tag: frontend
                  value: '{#PXNAME}'
            -
              uuid: 85d7aa81598b48ee9d40ce3e5b7fc7ea
              name: 'HAProxy Frontend {#PXNAME}: Number of responses with codes 5xx per second'
              type: DEPENDENT
              key: 'haproxy.frontend.hrsp_5xx.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of HTTP server errors per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].hrsp_5xx.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: responses
                -
                  tag: frontend
                  value: '{#PXNAME}'
            -
              uuid: 24ee024f493e47f4b4405bc469976c8e
              name: 'HAProxy Frontend {#PXNAME}: Sessions rate'
              type: DEPENDENT
              key: 'haproxy.frontend.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              description: 'Number of sessions created per second'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].rate.first()'
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: sessions
                -
                  tag: frontend
                  value: '{#PXNAME}'
            -
              uuid: 2290bc0944774d54a89d5b6195f81ad4
              name: 'HAProxy Frontend {#PXNAME}: Requests rate'
              type: DEPENDENT
              key: 'haproxy.frontend.req_rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              description: 'HTTP requests per second'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].req_rate.first()'
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: requests
                -
                  tag: frontend
                  value: '{#PXNAME}'
            -
              uuid: b01d1b02b9da4609acaa278cf5f2ebbd
              name: 'HAProxy Frontend {#PXNAME}: Established sessions'
              type: DEPENDENT
              key: 'haproxy.frontend.scur[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              description: 'The current number of established sessions.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].scur.first()'
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: sessions
                -
                  tag: frontend
                  value: '{#PXNAME}'
            -
              uuid: 4ed338fd24e14aeda1f6058a36371455
              name: 'HAProxy Frontend {#PXNAME}: Session limits'
              type: DEPENDENT
              key: 'haproxy.frontend.slim[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              description: 'The most simultaneous sessions that are allowed, as defined by the maxconn setting in the frontend.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].slim.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: sessions
                -
                  tag: frontend
                  value: '{#PXNAME}'
            -
              uuid: 5a48a087c07c4cbbaf0332930d59244b
              name: 'HAProxy Frontend {#PXNAME}: Status'
              type: DEPENDENT
              key: 'haproxy.frontend.status[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: |
                Possible values: OPEN, STOP.
                When Status is OPEN, the frontend is operating normally and ready to receive traffic.
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].status.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: health
                -
                  tag: frontend
                  value: '{#PXNAME}'
            -
              uuid: 4aedda0904954ade92a4aad6460d759b
              name: 'HAProxy Frontend {#PXNAME}: Session utilization'
              type: CALCULATED
              key: 'haproxy.frontend.sutil[{#PXNAME},{#SVNAME}]'
              history: 7d
              value_type: FLOAT
              units: '%'
              params: 'last(//haproxy.frontend.scur[{#PXNAME},{#SVNAME}]) / last(//haproxy.frontend.slim[{#PXNAME},{#SVNAME}]) * 100'
              description: 'Percentage of sessions used (scur / slim * 100).'
              tags:
                -
                  tag: component
                  value: sessions
                -
                  tag: frontend
                  value: '{#PXNAME}'
              trigger_prototypes:
                -
                  uuid: 9af44a07b1a347979492063ee756b025
                  expression: 'min(/HAProxy by Zabbix agent/haproxy.frontend.sutil[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.FRONT_SUTIL.MAX.WARN}'
                  name: 'HAProxy frontend {#PXNAME}: Session utilization is high'
                  event_name: 'HAProxy frontend {#PXNAME}: Session utilization is more than {$HAPROXY.FRONT_SUTIL.MAX.WARN}% for 5m'
                  priority: WARNING
                  description: 'Alerting on this metric is essential to ensure your server has sufficient capacity to handle all concurrent sessions. Unlike requests, upon reaching the session limit HAProxy will deny additional clients until resource consumption drops. Furthermore, if you find your session usage percentage to be hovering above 80%, it could be time to either modify HAProxy''s configuration to allow more sessions, or migrate your HAProxy server to a bigger box.'
                  tags:
                    -
                      tag: scope
                      value: performance
          graph_prototypes:
            -
              uuid: 30141ef1c5bf4c4a9cca0f8ce2ea3373
              name: 'HAProxy: Frontend {#PXNAME} Errors and denials per second'
              graph_items:
                -
                  color: 1A7C11
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.frontend.ereq.rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '1'
                  color: 2774A4
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.frontend.dreq.rate[{#PXNAME},{#SVNAME}]'
            -
              uuid: f6a6bb900b4e45c9af863e6e0aa9af8a
              name: 'HAProxy: Frontend {#PXNAME} In/Out traffic'
              graph_items:
                -
                  drawtype: GRADIENT_LINE
                  color: 1A7C11
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.frontend.bin.rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '1'
                  drawtype: GRADIENT_LINE
                  color: 2774A4
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.frontend.bout.rate[{#PXNAME},{#SVNAME}]'
            -
              uuid: 065d1ef09a404cf1bcc67f0e987482ab
              name: 'HAProxy: Frontend {#PXNAME} Requests and sessions per second'
              graph_items:
                -
                  color: 1A7C11
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.frontend.req_rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '1'
                  color: 2774A4
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.frontend.rate[{#PXNAME},{#SVNAME}]'
            -
              uuid: 3ce6177d02a045219cec0d348b970860
              name: 'HAProxy: Frontend {#PXNAME} Responses by HTTP code'
              type: STACKED
              graph_items:
                -
                  color: 1A7C11
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.frontend.hrsp_1xx.rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '1'
                  color: 2774A4
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.frontend.hrsp_2xx.rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '2'
                  color: F63100
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.frontend.hrsp_3xx.rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '3'
                  color: A54F10
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.frontend.hrsp_4xx.rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '4'
                  color: FC6EA3
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.frontend.hrsp_5xx.rate[{#PXNAME},{#SVNAME}]'
          master_item:
            key: haproxy.get.nodes
          lld_macro_paths:
            -
              lld_macro: '{#PXNAME}'
              path: $.pxname
            -
              lld_macro: '{#SVNAME}'
              path: $.svname
            -
              lld_macro: '{#MODE}'
              path: $.mode
          overrides:
            -
              name: 'Discard HTTP status codes'
              step: '1'
              filter:
                conditions:
                  -
                    macro: '{#MODE}'
                    value: tcp
                    formulaid: A
              operations:
                -
                  operationobject: ITEM_PROTOTYPE
                  operator: LIKE
                  value: 'Number of responses with codes'
                  status: ENABLED
                  discover: NO_DISCOVER
        -
          uuid: a2f7f79b8f094afd93648f62f99d3369
          name: 'Server discovery'
          type: DEPENDENT
          key: haproxy.server.discovery
          delay: '0'
          filter:
            evaltype: AND
            conditions:
              -
                macro: '{#SVNAME}'
                value: FRONTEND|BACKEND
                operator: NOT_MATCHES_REGEX
                formulaid: B
              -
                macro: '{#MODE}'
                value: http|tcp
                formulaid: A
          description: 'Discovery servers'
          item_prototypes:
            -
              uuid: 82b1f8a01ba04818a990c336eb7154e3
              name: 'HAProxy {#PXNAME} {#SVNAME}: Server is active'
              type: DEPENDENT
              key: 'haproxy.server.act[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              description: 'Shows whether the server is active (marked with a Y) or a backup (marked with a -).'
              valuemap:
                name: 'Server mode'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].act.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: role
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
            -
              uuid: 3617492e9cfd49b6b5576ed231dc2614
              name: 'HAProxy {#PXNAME} {#SVNAME}: Server is backup'
              type: DEPENDENT
              key: 'haproxy.server.bck[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              description: 'Shows whether the server is a backup (marked with a Y) or active (marked with a -).'
              valuemap:
                name: 'Server mode'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].bck.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: role
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
            -
              uuid: 20d5a69a9aa24fc6abf21c1c317ac425
              name: 'HAProxy {#PXNAME} {#SVNAME}: Incoming traffic'
              type: DEPENDENT
              key: 'haproxy.server.bin.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              units: bps
              description: 'Number of bits received by the backend'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].bin.first()'
                -
                  type: MULTIPLIER
                  parameters:
                    - '8'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: network
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
            -
              uuid: 7fbc335144b74c08ba6a79a108e8e894
              name: 'HAProxy {#PXNAME} {#SVNAME}: Outgoing traffic'
              type: DEPENDENT
              key: 'haproxy.server.bout.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              units: bps
              description: 'Number of bits sent by the backend'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].bout.first()'
                -
                  type: MULTIPLIER
                  parameters:
                    - '8'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: network
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
            -
              uuid: c46228518a3a460b894aea999ca0feab
              name: 'HAProxy {#PXNAME} {#SVNAME}: Status of last health check'
              type: DEPENDENT
              key: 'haproxy.server.check_status[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: |
                Status of last health check, one of:
                UNK     -> unknown
                INI     -> initializing
                SOCKERR -> socket error
                L4OK    -> check passed on layer 4, no upper layers testing enabled
                L4TOUT  -> layer 1-4 timeout
                L4CON   -> layer 1-4 connection problem, for example "Connection refused" (tcp rst) or "No route to host" (icmp)
                L6OK    -> check passed on layer 6
                L6TOUT  -> layer 6 (SSL) timeout
                L6RSP   -> layer 6 invalid response - protocol error
                L7OK    -> check passed on layer 7
                L7OKC   -> check conditionally passed on layer 7, for example 404 with disable-on-404
                L7TOUT  -> layer 7 (HTTP/SMTP) timeout
                L7RSP   -> layer 7 invalid response - protocol error
                L7STS   -> layer 7 response error, for example HTTP 5xx
                Notice: If a check is currently running, the last known status will be reported, prefixed with "* ". e. g. "* L7OK".
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].check_status.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 10m
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: health
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
              trigger_prototypes:
                -
                  uuid: 1378f45ad65a498aae7b571a69547352
                  expression: 'find(/HAProxy by Zabbix agent/haproxy.server.check_status[{#PXNAME},{#SVNAME}],#3,"regexp","(?:L[4-7]OK|^$)")=0'
                  name: 'HAProxy {#PXNAME} {#SVNAME}: Health check error'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  description: 'Please check the server for faults.'
                  dependencies:
                    -
                      name: 'HAProxy {#PXNAME} {#SVNAME}: Server is DOWN'
                      expression: 'count(/HAProxy by Zabbix agent/haproxy.server.status[{#PXNAME},{#SVNAME}],#5,"eq","DOWN")=5'
                  tags:
                    -
                      tag: scope
                      value: notice
            -
              uuid: 537f0b807f784b6cba1032ff77fad499
              name: 'HAProxy {#PXNAME} {#SVNAME}: Responses denied per second'
              type: DEPENDENT
              key: 'haproxy.server.dresp.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Responses denied due to security concerns (ACL-restricted).'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].dresp.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: responses
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
            -
              uuid: f688e1e62fa94d1db1d59735094f0bc4
              name: 'HAProxy {#PXNAME} {#SVNAME}: Errors connection per second'
              type: DEPENDENT
              key: 'haproxy.server.econ.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of requests that encountered an error attempting to connect to a backend server.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].econ.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: connections
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
            -
              uuid: bdcac24a8b1e4dd5a441edb61ca13156
              name: 'HAProxy {#PXNAME} {#SVNAME}: Response errors per second'
              type: DEPENDENT
              key: 'haproxy.server.eresp.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of requests whose responses yielded an error.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].eresp.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: responses
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
              trigger_prototypes:
                -
                  uuid: 5a982a97f812468eb8e7163f06f0ee77
                  expression: 'min(/HAProxy by Zabbix agent/haproxy.server.eresp.rate[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.SERVER_ERESP.MAX.WARN}'
                  name: 'HAProxy {#PXNAME} {#SVNAME}: Number of responses with error is high'
                  event_name: 'HAProxy {#PXNAME} {#SVNAME}: Number of responses with error is more than {$HAPROXY.SERVER_ERESP.MAX.WARN} for 5m'
                  priority: WARNING
                  description: 'Number of requests on server, whose responses yielded an error, is more than {$HAPROXY.SERVER_ERESP.MAX.WARN}.'
                  tags:
                    -
                      tag: scope
                      value: notice
            -
              uuid: 71fbb982c23c498fb52b68b3f839c642
              name: 'HAProxy {#PXNAME} {#SVNAME}: Number of responses with codes 1xx per second'
              type: DEPENDENT
              key: 'haproxy.server.hrsp_1xx.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of informational HTTP responses per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].hrsp_1xx.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: responses
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
            -
              uuid: a1aa6301ea1445bdbc509ec31cc9ebfc
              name: 'HAProxy {#PXNAME} {#SVNAME}: Number of responses with codes 2xx per second'
              type: DEPENDENT
              key: 'haproxy.server.hrsp_2xx.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of successful HTTP responses per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].hrsp_2xx.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: responses
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
            -
              uuid: 5b5576604886429ca22db333c9886c25
              name: 'HAProxy {#PXNAME} {#SVNAME}: Number of responses with codes 3xx per second'
              type: DEPENDENT
              key: 'haproxy.server.hrsp_3xx.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of HTTP redirections per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].hrsp_3xx.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: responses
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
            -
              uuid: 3af9ae3041bb4cd588cc6048370d9be7
              name: 'HAProxy {#PXNAME} {#SVNAME}: Number of responses with codes 4xx per second'
              type: DEPENDENT
              key: 'haproxy.server.hrsp_4xx.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of HTTP client errors per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].hrsp_4xx.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: responses
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
            -
              uuid: 9f2f6e181dca47ab8e1ae9064ab9fe15
              name: 'HAProxy {#PXNAME} {#SVNAME}: Number of responses with codes 5xx per second'
              type: DEPENDENT
              key: 'haproxy.server.hrsp_5xx.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of HTTP server errors per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].hrsp_5xx.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: responses
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
            -
              uuid: 8a7257e803b84783a8c9964807a336a5
              name: 'HAProxy {#PXNAME} {#SVNAME}: Server was selected per second'
              type: DEPENDENT
              key: 'haproxy.server.lbtot.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of times that server was selected.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].lbtot.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: connections
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
            -
              uuid: 03c6d54204104fa0a320ff76204fc825
              name: 'HAProxy {#PXNAME} {#SVNAME}: Unassigned requests'
              type: DEPENDENT
              key: 'haproxy.server.qcur[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              description: 'Current number of requests unassigned in queue.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].qcur.first()'
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: requests
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
              trigger_prototypes:
                -
                  uuid: b88e0b4baa2e4738a161a7fc437d6e1c
                  expression: 'min(/HAProxy by Zabbix agent/haproxy.server.qcur[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.SERVER_QCUR.MAX.WARN}'
                  name: 'HAProxy {#PXNAME} {#SVNAME}: Current number of requests unassigned in queue is high'
                  event_name: 'HAProxy {#PXNAME} {#SVNAME}: Current number of requests unassigned in queue is more than {$HAPROXY.SERVER_QCUR.MAX.WARN} for 5m'
                  priority: WARNING
                  description: 'Current number of requests unassigned in queue is more than {$HAPROXY.SERVER_QCUR.MAX.WARN}.'
                  tags:
                    -
                      tag: scope
                      value: notice
            -
              uuid: 50a837b40d624492b0248324d8b62694
              name: 'HAProxy {#PXNAME} {#SVNAME}: Configured maxqueue'
              type: DEPENDENT
              key: 'haproxy.server.qlimit[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              description: 'Configured maxqueue for the server, or nothing in the value is 0 (default, meaning no limit).'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].qlimit.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
                -
                  type: MATCHES_REGEX
                  parameters:
                    - ^\d+$
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: queues
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
            -
              uuid: 58c074ebc26145a6847d425d51f7cbca
              name: 'HAProxy {#PXNAME} {#SVNAME}: Time in queue'
              type: DEPENDENT
              key: 'haproxy.server.qtime[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              units: s
              description: 'Average time spent in queue (in ms) for the last 1,024 requests.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].qtime.first()'
                -
                  type: MULTIPLIER
                  parameters:
                    - '0.001'
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: requests
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
              trigger_prototypes:
                -
                  uuid: abf3d9e3f6fa43d8bf722bcc58c37388
                  expression: 'min(/HAProxy by Zabbix agent/haproxy.server.qtime[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.SERVER_QTIME.MAX.WARN}'
                  name: 'HAProxy {#PXNAME} {#SVNAME}: Average time spent in queue is high'
                  event_name: 'HAProxy {#PXNAME} {#SVNAME}: Average time spent in queue is more than {$HAPROXY.SERVER_QTIME.MAX.WARN} for 5m'
                  priority: WARNING
                  description: 'Average time spent in queue (in ms) for the last 1,024 requests is more than {$HAPROXY.SERVER_QTIME.MAX.WARN}.'
                  tags:
                    -
                      tag: scope
                      value: performance
            -
              uuid: 25c22d3eca2d4eb7b83791d36edcf470
              name: 'HAProxy {#PXNAME} {#SVNAME}: Responses time'
              type: DEPENDENT
              key: 'haproxy.server.rtime[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              units: s
              description: 'Average server response time (in ms) for the last 1,024 requests.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].rtime.first()'
                -
                  type: MULTIPLIER
                  parameters:
                    - '0.001'
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: health
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
              trigger_prototypes:
                -
                  uuid: 51ae2aca459b453cb433c5cc0f043a25
                  expression: 'min(/HAProxy by Zabbix agent/haproxy.server.rtime[{#PXNAME},{#SVNAME}],5m)>{$HAPROXY.SERVER_RTIME.MAX.WARN}'
                  name: 'HAProxy {#PXNAME} {#SVNAME}: Average response time is high'
                  event_name: 'HAProxy {#PXNAME} {#SVNAME}: Average response time is more than {$HAPROXY.SERVER_RTIME.MAX.WARN} for 5m'
                  priority: WARNING
                  description: 'Average server response time (in ms) for the last 1,024 requests is more than {$HAPROXY.SERVER_RTIME.MAX.WARN}.'
                  tags:
                    -
                      tag: scope
                      value: performance
            -
              uuid: 973e886a54374bd4815f71d9f9174e80
              name: 'HAProxy {#PXNAME} {#SVNAME}: Status'
              type: DEPENDENT
              key: 'haproxy.server.status[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              valuemap:
                name: 'Service state'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].status.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 10m
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: health
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
              trigger_prototypes:
                -
                  uuid: ec64ec00aa164ac09faf90794264907a
                  expression: 'count(/HAProxy by Zabbix agent/haproxy.server.status[{#PXNAME},{#SVNAME}],#5,"eq","DOWN")=5'
                  name: 'HAProxy {#PXNAME} {#SVNAME}: Server is DOWN'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  description: 'Server is not available.'
                  tags:
                    -
                      tag: scope
                      value: avialability
            -
              uuid: 6f5c20d65ba34afbb47cd65af1d1b368
              name: 'HAProxy {#PXNAME} {#SVNAME}: Sessions per second'
              type: DEPENDENT
              key: 'haproxy.server.stot.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Cumulative number of sessions (end-to-end connections) per second.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].stot.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: sessions
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
            -
              uuid: 02605cd644e14e2398af89433a6d976d
              name: 'HAProxy {#PXNAME} {#SVNAME}: Weight'
              type: DEPENDENT
              key: 'haproxy.server.weight[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              description: 'Effective weight.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].weight.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: balancer
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
            -
              uuid: 606acc119e0d4d9c934e200e037434fe
              name: 'HAProxy {#PXNAME} {#SVNAME}: Redispatched requests per second'
              type: DEPENDENT
              key: 'haproxy.server.wredis.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of times a request was redispatched to a different backend.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].wredis.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: requests
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
            -
              uuid: 1e2188320b834562b6b33e96f90a5b44
              name: 'HAProxy {#PXNAME} {#SVNAME}: Retried connections per second'
              type: DEPENDENT
              key: 'haproxy.server.wretr.rate[{#PXNAME},{#SVNAME}]'
              delay: '0'
              history: 7d
              value_type: FLOAT
              description: 'Number of times a connection was retried.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.[?(@.pxname == ''{#PXNAME}'' && @.svname == ''{#SVNAME}'')].wretr.first()'
                -
                  type: CHANGE_PER_SECOND
                  parameters:
                    - ''
              master_item:
                key: 'web.page.get["{$HAPROXY.STATS.SCHEME}://{HOST.CONN}:{$HAPROXY.STATS.PORT}/{$HAPROXY.STATS.PATH};csv"]'
              tags:
                -
                  tag: component
                  value: connections
                -
                  tag: server
                  value: '{#PXNAME}'
                -
                  tag: service
                  value: '{#SVNAME}'
          graph_prototypes:
            -
              uuid: 15210cbf31ab459ca77d35206255f317
              name: 'HAProxy: {#PXNAME} {#SVNAME} In/Out traffic'
              graph_items:
                -
                  drawtype: GRADIENT_LINE
                  color: 1A7C11
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.server.bin.rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '1'
                  drawtype: GRADIENT_LINE
                  color: 2774A4
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.server.bout.rate[{#PXNAME},{#SVNAME}]'
            -
              uuid: 09fb856698f441b29103e3b8c8bcb8dd
              name: 'HAProxy: {#PXNAME} {#SVNAME} Responses by HTTP code'
              type: STACKED
              graph_items:
                -
                  color: 1A7C11
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.server.hrsp_1xx.rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '1'
                  color: 2774A4
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.server.hrsp_2xx.rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '2'
                  color: F63100
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.server.hrsp_3xx.rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '3'
                  color: A54F10
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.server.hrsp_4xx.rate[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '4'
                  color: FC6EA3
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.server.hrsp_5xx.rate[{#PXNAME},{#SVNAME}]'
            -
              uuid: e3e10b66deb14b33a436481cc34eeb84
              name: 'HAProxy: {#PXNAME} {#SVNAME} Response time and time in queue'
              graph_items:
                -
                  color: 1A7C11
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.server.rtime[{#PXNAME},{#SVNAME}]'
                -
                  sortorder: '1'
                  color: 2774A4
                  item:
                    host: 'HAProxy by Zabbix agent'
                    key: 'haproxy.server.qtime[{#PXNAME},{#SVNAME}]'
          master_item:
            key: haproxy.get.nodes
          lld_macro_paths:
            -
              lld_macro: '{#PXNAME}'
              path: $.pxname
            -
              lld_macro: '{#SVNAME}'
              path: $.svname
            -
              lld_macro: '{#MODE}'
              path: $.mode
          overrides:
            -
              name: 'Discard HTTP status codes'
              step: '1'
              filter:
                conditions:
                  -
                    macro: '{#MODE}'
                    value: tcp
                    formulaid: A
              operations:
                -
                  operationobject: ITEM_PROTOTYPE
                  operator: LIKE
                  value: 'Number of responses with codes'
                  status: ENABLED
                  discover: NO_DISCOVER
      tags:
        -
          tag: class
          value: software
        -
          tag: target
          value: haproxy
      macros:
        -
          macro: '{$HAPROXY.BACK_ERESP.MAX.WARN}'
          value: '10'
          description: 'Maximum of responses with error on BACKEND for trigger expression.'
        -
          macro: '{$HAPROXY.BACK_QCUR.MAX.WARN}'
          value: '10'
          description: 'Maximum number of requests on BACKEND unassigned in queue for trigger expression.'
        -
          macro: '{$HAPROXY.BACK_QTIME.MAX.WARN}'
          value: 10s
          description: 'Maximum of average time spent in queue on BACKEND for trigger expression.'
        -
          macro: '{$HAPROXY.BACK_RTIME.MAX.WARN}'
          value: 10s
          description: 'Maximum of average BACKEND response time for trigger expression.'
        -
          macro: '{$HAPROXY.FRONT_DREQ.MAX.WARN}'
          value: '10'
          description: 'The HAProxy maximum denied requests for trigger expression.'
        -
          macro: '{$HAPROXY.FRONT_EREQ.MAX.WARN}'
          value: '10'
          description: 'The HAProxy maximum number of request errors for trigger expression.'
        -
          macro: '{$HAPROXY.FRONT_SUTIL.MAX.WARN}'
          value: '80'
          description: 'Maximum of session usage percentage on frontend for trigger expression.'
        -
          macro: '{$HAPROXY.RESPONSE_TIME.MAX.WARN}'
          value: 10s
          description: 'The HAProxy stats page maximum response time in seconds for trigger expression.'
        -
          macro: '{$HAPROXY.SERVER_ERESP.MAX.WARN}'
          value: '10'
          description: 'Maximum of responses with error on server for trigger expression.'
        -
          macro: '{$HAPROXY.SERVER_QCUR.MAX.WARN}'
          value: '10'
          description: 'Maximum number of requests on server unassigned in queue for trigger expression.'
        -
          macro: '{$HAPROXY.SERVER_QTIME.MAX.WARN}'
          value: 10s
          description: 'Maximum of average time spent in queue on server for trigger expression.'
        -
          macro: '{$HAPROXY.SERVER_RTIME.MAX.WARN}'
          value: 10s
          description: 'Maximum of average server response time for trigger expression.'
        -
          macro: '{$HAPROXY.STATS.PATH}'
          value: stats
          description: 'The path of HAProxy stats page.'
        -
          macro: '{$HAPROXY.STATS.PORT}'
          value: '8404'
          description: 'The port of the HAProxy stats host or container.'
        -
          macro: '{$HAPROXY.STATS.SCHEME}'
          value: http
          description: 'The scheme of HAProxy stats page(http/https).'
      dashboards:
        -
          uuid: 6d515de988274ac6b31938eebd175973
          name: 'HAProxy Backend performance'
          pages:
            -
              widgets:
                -
                  type: GRAPH_PROTOTYPE
                  width: '24'
                  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:
                        name: 'HAProxy: Backend {#PXNAME} Redispatched requests and retried connections per second'
                        host: 'HAProxy by Zabbix agent'
                -
                  type: GRAPH_PROTOTYPE
                  'y': '5'
                  width: '24'
                  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:
                        name: 'HAProxy: Backend {#PXNAME} Responses by HTTP code'
                        host: 'HAProxy by Zabbix agent'
                -
                  type: GRAPH_PROTOTYPE
                  'y': '10'
                  width: '24'
                  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:
                        name: 'HAProxy: Backend {#PXNAME} In/Out traffic'
                        host: 'HAProxy by Zabbix agent'
        -
          uuid: 7c4decb2fefc4cfe9c4a3f8717d710ca
          name: 'HAProxy Frontend performance'
          pages:
            -
              widgets:
                -
                  type: GRAPH_PROTOTYPE
                  width: '24'
                  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:
                        name: 'HAProxy: Frontend {#PXNAME} Requests and sessions per second'
                        host: 'HAProxy by Zabbix agent'
                -
                  type: GRAPH_PROTOTYPE
                  'y': '5'
                  width: '24'
                  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:
                        name: 'HAProxy: Frontend {#PXNAME} Errors and denials per second'
                        host: 'HAProxy by Zabbix agent'
                -
                  type: GRAPH_PROTOTYPE
                  'y': '10'
                  width: '24'
                  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:
                        name: 'HAProxy: Frontend {#PXNAME} Responses by HTTP code'
                        host: 'HAProxy by Zabbix agent'
                -
                  type: GRAPH_PROTOTYPE
                  'y': '15'
                  width: '24'
                  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:
                        name: 'HAProxy: Frontend {#PXNAME} In/Out traffic'
                        host: 'HAProxy by Zabbix agent'
        -
          uuid: ebc5a517fa544fada42550059c014c5b
          name: 'HAProxy Server performance'
          pages:
            -
              widgets:
                -
                  type: GRAPH_PROTOTYPE
                  width: '24'
                  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:
                        name: 'HAProxy: {#PXNAME} {#SVNAME} Response time and time in queue'
                        host: 'HAProxy by Zabbix agent'
                -
                  type: GRAPH_PROTOTYPE
                  'y': '5'
                  width: '24'
                  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:
                        name: 'HAProxy: {#PXNAME} {#SVNAME} Responses by HTTP code'
                        host: 'HAProxy by Zabbix agent'
                -
                  type: GRAPH_PROTOTYPE
                  'y': '10'
                  width: '24'
                  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:
                        name: 'HAProxy: {#PXNAME} {#SVNAME} In/Out traffic'
                        host: 'HAProxy by Zabbix agent'
      valuemaps:
        -
          uuid: bf2e9463450d4f4899abcac85cde0a92
          name: 'Server mode'
          mappings:
            -
              value: '0'
              newvalue: '-'
            -
              value: '1'
              newvalue: 'Y'
        -
          uuid: 4980ec41c6644ecb9d5b52027a381fd8
          name: 'Service state'
          mappings:
            -
              value: '0'
              newvalue: Down
            -
              value: '1'
              newvalue: Up