Easycheck is a lightweight HTTP server designed to monitor and report the status of the server it operates on. It achieves this by offering a single endpoint that users can query to check the server’s health.
- Periodic Checks: Easycheck performs regular checks on specific services, such as an HTTP endpoint or a TCP socket, running on the host system.
- Determining Availability: If any of these checks fail, Easycheck marks the server as "unavailable." Consequently, when the endpoint is queried, the server responds with a status code "503" (Service Unavailable).
- Successful Checks: If all checks pass, the server is considered healthy, and the endpoint returns the status code "200" (OK).
- Maintenance Override: You can manually override the checks by creating a special maintenance file. When this file is present, the server will always be reported as "unavailable," regardless of the actual check results.
This setup ensures that the server is monitored and can be marked as unavailable in case a backend service is no longer responding, for example, in a load balancer.
Easycheck can be configured with command line parameters or environment variables.
Command Line Option | Environment Variable | Required | Default | Description |
---|---|---|---|---|
--bind |
EASYCHECK_BIND_HOST |
Yes | Sets the bind host for the HTTP endpoint. Format: ip:port (or for ipv6 addresses: [ip]:port |
|
--revalidation-interval |
EASYCHECK_REVALIDATE_INTERVAL |
No | 5 | The interval between check executions in seconds. Must be positive. |
--mtc-file-path |
EASYCHECK_MTC_FILE_PATH |
No | easycheck.disabled |
Defines the path where the maintenance file is located. Can be an absolute or relative path. |
--socket-addr |
EASYCHECK_SOCKET_ADDR |
No | Defines the socket address to check regularly if still responding. Easycheck connects to the socket, sends a QUIT message and tries to receive a response. The check if successful if the connection succeeds and a response is received. |
|
--http-url |
EASYCHECK_HTTP_URL |
No | Defines the http address to check regularly. Further configuration can be done with the other http options. Format: http[s]://<host>:[port]/[path] |
|
--http-method |
EASYCHECK_HTTP_METHOD |
No | Defines the http method to use for executing the http status check. Only has effect if an http url is given to check. | |
--http-status-codes |
EASYCHECK_HTTP_STATUS_CODES |
No | Defines the numerical http status codes that should be considered as a successful check. |
- Clone this repository
- If you're on Linux you might need to install
build-essentials
- Make sure you have Cargo installed and
run
cargo build --release
- Take the final file from
target/release/easycheck[.extension]
The binaries for easycheck are pre-compiled available attached to each release. These are currently pre-compiled for the following targets:
Target | Architectures |
---|---|
Apple | x64, x86, aarch64 |
Linux | x64, x86, aarch64 |