18 Oct
2021
18 Oct
'21
6:07 a.m.
- Marc, 17.10.21 01:15
I have been trying to get a simple health check in haproxy to work. But somehome the haproxy request is differently handled then a curl request, which generates a socket error in haproxy. [...]
For stats, you can use "socat" to talk to haproxy's stat socket instead of using its HTTP interface. For example, with "stats socket /var/lib/haproxy/stats" in haproxy's config, you can then do:
echo "show stat" | socat - "UNIX-CONNECT:/var/lib/haproxy/stats"
Maybe there is a way to also expose your health check status on a local socket instead of an HTTP listener? This would at least eliminate having to deal with missing or superfluous CR/LFs, spaces, etc.
Just a thought.
HTH, Thomas