I have to setup haproxy with agent-check, the backend servers reporting themselves their weight ("28%" for example) over http. Seems like haproxy can't speak http with it's agents, which seems weird. Is there no way to do it ?

I've tried this :

   server X X:80 agent-check agent-port 80 agent-send "GET /some/url HTTP/1.0\r\n" check observe layer7

Which may or may not work, I actually have no idea. Is there any way to tell if the agent-check are succeeding or not ? The statistics page doesn't seem to change whether the url is valid or not. I'm guessing it's not working, because haproxy must be expecting just the value, not any of the http around it.


I agree I don't think it does understand HTTP although I'd be happy to be corrected... Anyone?

UPDATE: I tried this but even if what you request is simply a text file with "ready 88%" it doesn't appear to work... You'd get this back which I guess just confuses it:

HTTP/1.1 200 OK
Date: Sat, 28 Jul 2018 14:22:20 GMT
Server: Apache/2.4.6 (CentOS)
Last-Modified: Sat, 28 Jul 2018 14:14:31 GMT
ETag: "9-5720fd8d9795b"
Accept-Ranges: bytes
Content-Length: 9
Content-Type: text/plain; charset=UTF-8

ready 88%

HTTP compatibility would make a sensible feature request! Maybe something to take to the mailing list. I don't necessarily understand your exact use case but have you considered using a pre-built agent like this one:


The code is GPL so it could be modified to suit any requirements over and above what it does already.

|improve this answer|||||
  • Ended up making a xinetd service to query the http agents and report that number over regular tcp. Seems to work, although there is now a new problem for which I've created a new question. – Ulrar Jul 30 '18 at 8:43
  • Still, I'm leaving this open since technically, there is still no proper solution to get an agent check over http – Ulrar Jul 30 '18 at 8:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.