External check with c program

Please help guys , how can i use external check for an c program ?

You can use whatever you like, as long as whatever application you are calling returns zero on success and non-zero on failure:

Thaank’s luka for your answers,
it’s what i had did the program return either 1 or 0 , and when i restart the haproxy service i don’t get error , but when i execute i don’t get anything

Run your application manually in the shell and check the return code yourself (echo $?) after your program returns.

a lot of thank’s again to answer me,
i checked the program with echo hi returned 0 or 1 i tested it but i feel like there some bad configuration in haproxy.cfg it’s why i share the configuration with you, you find that’s it correct ?

Yes, I too think that there is something wrong, with the configuration and otherwise.

external-check path does not appear to point to an actual path. A path means a directory.
external-check command it is unclear if the configuration is really what you want.

Can you provide the output of the following commands, because I really struggle to understand what this configuration is supposed to do:

file /root/2script.c
file /root/2script.c/0
file /root/2script.c/1
/root/2script.c/0
echo $?
/root/2script.c/1
echo $?

ahh there is the first problem it is the same file 2script.c who give us either 0 or 1 the return of 2script.c is 0 or 1, in test i execute
/root/2script.c
i get 0 or 1 in return