0

I'm trying to use the Option external-check and can't get it to work with an argument. It if I can't pass anything then that option becomes useless.

I've been trying for hours and nothing works. It only works with just the executable.

It gives me an error if I don't put quotes around the command but then it doesn't work at all. If I remove the IP then it works without the quotes.

here is an piece of code.

This works

.....
        bind *:15432
        option tcpka
        option external-check
        external-check path "/usr/bin:/bin"
        external-check command /bin/pg_check.py
.....

This does NOT work.

.....
        bind *:15432
        option tcpka
        option external-check
        external-check path "/usr/bin:/bin"
        external-check command /bin/pg_check.py 192.168.10.1
.....

This does NOT work

.....
        bind *:15432
        option tcpka
        option external-check
        external-check path "/usr/bin:/bin"
        external-check command "/bin/pg_check.py 192.168.10.1"
.....

How do I pass an argument?

Panama Jack
  • 121
  • 1
  • 6

1 Answers1

1

You don't explicitly configure arguments. HAProxy adds them automatically.

The arguments passed to the to the command are:

The and are derived from the first listener that is either IPv4, IPv6 or a UNIX socket. In the case of a UNIX socket listener the proxy_address will be the path of the socket and the will be the string "NOT_USED". In a backend section, it's not possible to determine a listener, and both and will have the string value "NOT_USED".

Some values are also provided through environment variables.

http://cbonte.github.io/haproxy-dconv/1.6/configuration.html#4.2-external-check%20command

Michael - sqlbot
  • 21,988
  • 1
  • 57
  • 81