@@ -6,7 +6,17 @@ Overview
66
77This check shows you an *abundance of metrics that cover the health of your HAProxy server, current request rates, response times, and more. These metrics give you granular data on a per-frontend, backend, and server basis. You need to add a stats enable directive, which is typically put into its own frontend section. * (from https://www.haproxy.com/blog/exploring-the-haproxy-stats-page/).
88
9- HAProxy config example:
9+ HAProxy provides the ability to use Unix sockets for statistics. In monitoring setups where checks can be run locally on the system running HAProxy, this provides an easy and secure way to monitor without exposing the stats frontend to the network.
10+
11+ To make **HAProxy listen on a Unix domain socket **, you need to configure the stats socket option, typically within the global section of your ``haproxy.cfg `` file:
12+
13+ .. code-block :: text
14+
15+ global
16+ # Other global settings ...
17+ stats socket /run/haproxy.sock mode 600 level admin
18+
19+ To make **HAProxy listen on a TCP port instead **, configure HAProxy as follows:
1020
1121.. code-block :: text
1222
5666 --lengthy Extended reporting.
5767 --no-proxy Do not use a proxy. Default: False
5868 -p, --password PASSWORD
59- HAProxy Stats Auth password.
69+ HAProxy Stats Auth password (not needed for socket
70+ access).
6071 --test TEST For unit tests. Needs "path-to-stdout-file,path-to-
6172 stderr-file,expected-retc".
6273 --timeout TIMEOUT Network timeout in seconds. Default: 3 (seconds)
63- -u, --url URL HAProxy Stats URI. Default: http://localhost/server-
64- status
65- --username USERNAME HAProxy Stats Auth username. Default: haproxy-stats
74+ -u, --url URL HAProxy Stats URI. Can be either
75+ `unix:///path/to/haproxy.sock` or an URL like
76+ `https://webserver:8443/server-status`. Default:
77+ unix:///run/haproxy.sock
78+ --username USERNAME HAProxy Stats Auth username (not needed for socket
79+ access). Default: haproxy-stats
6680 -w, --warning WARN Set the WARN threshold as a percentage. Default: >= 80
6781
6882
@@ -77,23 +91,20 @@ Output:
7791
7892.. code-block :: text
7993
80- frontend-https FRONTEND: 2666 sessions (88.9%) [WARNING], frontend-https-8443 FRONTEND: STOP, rabbitmq-35671-5672 BACKEND: DOWN, srvvcs01-80 srvvcs01: NOLB, srvvcs01-80 BACKEND: MAINT, srvvcs01-5050 srvvcs01: DRAIN, srvapp01-6080 srvapp01: 8 queued connections (80.0%) [WARNING], stats FRONTEND: 8 sessions over the last second (rate 80.0%) [WARNING]
81-
82- Proxy name Server name Status Sessions RqBytes RspBytes Rsp5xx Rq/s
83- ---------- ----------- ------ -------- ------- -------- ------ ----
84- frontend-https FRONTEND OPEN 2.7K/3.0K [WARNING] 220.9MiB 438.8MiB 588.0 1
85- frontend-https-8443 FRONTEND STOP [WARNING] 0.0/3.0K 1004.3KiB 14.8MiB 72.0 0
86- rabbitmq-35671-5672 FRONTEND OPEN 0.0/3.0K 0.0B 0.0B 0
87- rabbitmq-35671-5672 srvmq01 UP 0.0 0.0B 0.0B
88- rabbitmq-35671-5672 BACKEND DOWN [WARNING] 0.0/300.0 0.0B 0.0B
89- srvvcs01-80 srvvcs01 NOLB [WARNING] 0.0 111.1MiB 361.4MiB 5.0
90- srvvcs01-80 BACKEND MAINT [WARNING] 0.0/300.0 111.2MiB 361.4MiB 96.0
91- srvvcs01-5050 srvvcs01 DRAIN [WARNING] 0.0 103.8MiB 92.5KiB 0.0
92- srvvcs01-5050 BACKEND no check 0.0/300.0 103.8MiB 92.5KiB 0.0
93- srvlog01-9000 srvlog01 UP 0.0 990.1KiB 14.7MiB 0.0
94- srvlog01-9000 BACKEND UP 0.0/300.0 990.1KiB 14.7MiB 0.0
95- stats FRONTEND OPEN 1.0/3.0K 70.7KiB 1.7MiB 3.0 1
96- stats BACKEND UP 0.0/300.0 70.7KiB 1.7MiB 3.0
94+ static static: DOWN, static BACKEND: DOWN, app app1: DOWN, app app2: DOWN, app app3: DOWN, app app4: DOWN, app BACKEND: DOWN
95+
96+ Proxy name ! Server name ! Sessions ! RqBytes ! RspBytes ! Rsp5xx ! Rq/s ! Status
97+ -----------+-------------+----------+----------+----------+--------+------+---------------
98+ main ! FRONTEND ! 0/3000 ! 0.0B ! 0.0B ! 0 ! 0 ! OPEN
99+ static ! static ! 0 ! 0.0B ! 0.0B ! 0 ! ! DOWN [WARNING]
100+ static ! BACKEND ! 0/300 ! 0.0B ! 0.0B ! 0 ! ! DOWN [WARNING]
101+ app ! app1 ! 0 ! 0.0B ! 0.0B ! 0 ! ! DOWN [WARNING]
102+ app ! app2 ! 0 ! 0.0B ! 0.0B ! 0 ! ! DOWN [WARNING]
103+ app ! app3 ! 0 ! 0.0B ! 0.0B ! 0 ! ! DOWN [WARNING]
104+ app ! app4 ! 0 ! 0.0B ! 0.0B ! 0 ! ! DOWN [WARNING]
105+ app ! BACKEND ! 0/300 ! 0.0B ! 0.0B ! 0 ! ! DOWN [WARNING]
106+ stats ! FRONTEND ! 0/3000 ! 443.2KiB ! 8.6MiB ! 733 ! 0 ! OPEN
107+ stats ! BACKEND ! 0/300 ! 443.2KiB ! 8.6MiB ! 733 ! ! UP
97108
98109 .. code-block :: bash
99110
@@ -103,23 +114,20 @@ Output:
103114
104115.. code-block :: text
105116
106- frontend-https FRONTEND: 2666 sessions (88.9%) [WARNING], frontend-https-8443 FRONTEND: STOP, rabbitmq-35671-5672 BACKEND: DOWN, srvvcs01-80 srvvcs01: NOLB, srvvcs01-80 BACKEND: MAINT, srvvcs01-5050 srvvcs01: DRAIN, srvapp01-6080 srvapp01: 8 queued connections (80.0%) [WARNING], stats FRONTEND: 8 sessions over the last second (rate 80.0%) [WARNING]
107-
108- Proxy name Server name Status Queued Sessions RqBytes RspBytes RqLB Rate Rsp2xx Rsp4xx Rsp5xx Rq/s LastReq RqRspTime
109- ---------- ----------- ------ ------ -------- ------- -------- ---- ---- ------ ------ ------ ---- ------- ---------
110- frontend-https FRONTEND OPEN 2.7K/3.0K [WARNING] 220.9MiB 438.8MiB 0/0 172.2K 228.0 588.0 1
111- frontend-https-8443 FRONTEND STOP [WARNING] 0.0/3.0K 1004.3KiB 14.8MiB 0/0 8.3K 732.0 72.0 0
112- rabbitmq-35671-5672 FRONTEND OPEN 0.0/3.0K 0.0B 0.0B 0/0 0
113- rabbitmq-35671-5672 srvmq01 UP 0 0.0 0.0B 0.0B 0.0 0 0
114- rabbitmq-35671-5672 BACKEND DOWN [WARNING] 0 0.0/300.0 0.0B 0.0B 0.0 0 0
115- srvvcs01-80 srvvcs01 NOLB [WARNING] 0 0.0 111.1MiB 361.4MiB 138.1K 1 134.0K 6.0 5.0 0.00s 2889
116- srvvcs01-80 BACKEND MAINT [WARNING] 0 0.0/300.0 111.2MiB 361.4MiB 138.1K 1 134.0K 6.0 96.0 0.00s 2889
117- srvvcs01-5050 srvvcs01 DRAIN [WARNING] 0 0.0 103.8MiB 92.5KiB 195.0 0 164.0 31.0 0.0 2m 24s 71
118- srvvcs01-5050 BACKEND no check 0 0.0/300.0 103.8MiB 92.5KiB 195.0 0 164.0 31.0 0.0 2m 24s 71
119- srvlog01-9000 srvlog01 UP 0 0.0 990.1KiB 14.7MiB 8.3K 0 8.3K 0.0 0.0 52s 4121
120- srvlog01-9000 BACKEND UP 0 0.0/300.0 990.1KiB 14.7MiB 8.3K 0 8.3K 0.0 0.0 52s 4121
121- stats FRONTEND OPEN 1.0/3.0K 70.7KiB 1.7MiB 8/10 [WARNING] 202.0 1.0 3.0 1
122- stats BACKEND UP 0 0.0/300.0 70.7KiB 1.7MiB 0.0 0 0.0 0.0 3.0 0.00s 71
117+ static static: DOWN, static BACKEND: DOWN, app app1: DOWN, app app2: DOWN, app app3: DOWN, app app4: DOWN, app BACKEND: DOWN
118+
119+ Proxy name ! Server name ! Queued ! Sessions ! RqBytes ! RspBytes ! RqLB ! Rate ! Rsp2xx ! Rsp4xx ! Rsp5xx ! Rq/s ! LastReq ! RqRspTime ! Status
120+ -----------+-------------+--------+----------+----------+----------+------+------+--------+--------+--------+------+---------+-----------+---------------
121+ main ! FRONTEND ! ! 0/3000 ! 0.0B ! 0.0B ! ! 0/0 ! 0 ! 0 ! 0 ! 0 ! ! ! OPEN
122+ static ! static ! 0 ! 0 ! 0.0B ! 0.0B ! 0 ! 0 ! 0 ! 0 ! 0 ! ! ! 0 ! DOWN [WARNING]
123+ static ! BACKEND ! 0 ! 0/300 ! 0.0B ! 0.0B ! 0 ! 0 ! 0 ! 0 ! 0 ! ! ! 0 ! DOWN [WARNING]
124+ app ! app1 ! 0 ! 0 ! 0.0B ! 0.0B ! 0 ! 0 ! 0 ! 0 ! 0 ! ! ! 0 ! DOWN [WARNING]
125+ app ! app2 ! 0 ! 0 ! 0.0B ! 0.0B ! 0 ! 0 ! 0 ! 0 ! 0 ! ! ! 0 ! DOWN [WARNING]
126+ app ! app3 ! 0 ! 0 ! 0.0B ! 0.0B ! 0 ! 0 ! 0 ! 0 ! 0 ! ! ! 0 ! DOWN [WARNING]
127+ app ! app4 ! 0 ! 0 ! 0.0B ! 0.0B ! 0 ! 0 ! 0 ! 0 ! 0 ! ! ! 0 ! DOWN [WARNING]
128+ app ! BACKEND ! 0 ! 0/300 ! 0.0B ! 0.0B ! 0 ! 0 ! 0 ! 0 ! 0 ! ! ! 0 ! DOWN [WARNING]
129+ stats ! FRONTEND ! ! 0/3000 ! 443.2KiB ! 8.6MiB ! ! 0/0 ! 2397 ! 0 ! 733 ! 0 ! ! ! OPEN
130+ stats ! BACKEND ! 0 ! 0/300 ! 443.2KiB ! 8.6MiB ! 0 ! 0 ! 0 ! 0 ! 733 ! ! 3m 22s ! 0 ! UP
123131
124132
125133 States
0 commit comments