This program implements Antelope healthcheck for HAProxy over TCP.
You will need go-lang version 1.16
or later to compile the source.
compile with compile.sh
script
$ ./compile.sh
Execute ./compile.sh --help
to see all available flags to crosscompile for different systems/architectures.
run ./package.sh
to generate package. Debian (.deb) and FreeBSD are supported.
The protocol is simple and has 4 rules.
- Data is transmitted in
packets
encoded in ascii and ends with newline\n
. - There are two types of packages:
Request
andResponse
. EachRequest
has exactly oneResponse
. - Each parameter inside a
Request
is separated by|
- Each response contains exactly one
status code
(see below)
The following parameters are supported in a request and are ordered from first to last below:
# | Name | Required | Description |
---|---|---|---|
1 | api | Yes | Type of API to check against,v1 = standard, v2 = Hyperion, atomic = atomicassets |
2 | url | Yes (port default 80 ) |
http url to the api.http(s)://<ip-or-domain>(:<port>) |
3 | num_blocks | No (default 10 ) |
Number of blocks the api can drift before reported down |
4 | host | No (default from url ) |
Value to send in the HTTP Host Header to the API |
The api can respond with exactly one status code
.
See HAproxy documentation for more information
code | Description |
---|---|
up |
Api is healthy |
down |
Api is not healthy |
fail |
The program failed to read the status from the api. |
maint |
Api is set in maintenance mode (not used) |
ready |
Api is ready again after being in maint state (not used) |
stopped |
Api has been stopped manually (not used) |
Henrik Hautakoski - [email protected]