HAProxy community

Detect code 200 ( http-check expect )

Hi!

I have the following configuration to detect a status 200 after an script executes:

listen ReadWrite
    bind *:5000
    option httpchk
    http-check expect status 200
    default-server inter 3s fall 3 rise 2 on-marked-down shutdown-sessions
    server psql01 psql01:5432 maxconn 100 check port 23267
    server psql02 psql02:5432 maxconn 100 check port 23267

My script contains this lines to output this code 200

/bin/echo -e “HTTP/1.1 200 OK\r\n”
/bin/echo -e “Content-Type: Content-Type: text/plain\r\n”
/bin/echo -e “\r\n”
/bin/echo “Primary”
/bin/echo -e “\r\n”

This is the correct way to print the output?
Actuallly I see the Statistics Report all in red.

Any idea to debug this error?

Thanks!

curl -vv it.

thanks! I see errors abut permisions with my script.