External health check of backend services

So it seems that haproxy won’t close the port access.
( Is there a way to close a listener port when all backends went down? )

So what is the proper way of external health check?
How can I

  1. Configure haproxy to expose that information
  2. Check that with external application

Could anybody give me some pointers?

I see there is an ‘health_check’ directive which checks haproxy’s own availability.

…and there is an ‘external-check’ option which runs a command on the server:
https://cbonte.github.io/haproxy-dconv/configuration-1.6.html#option%20external-check

Regards:
Bence