Skip to content

Simple application to healthcheck http endpoints.

License

Notifications You must be signed in to change notification settings

jitesoft/http-healthcheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Http-HealthCheck

A simple program written in Go to allow healtchecks against a http endpoint.
To pass URI to the target, supply the uri as the first argument on invocation:

./http-healtcheck https://jitesoft.com

In case the page have an error (500) the call will exit with exit code 1, in case it does not have a 500 error, it will exit with exit code 0.
To specify a specific set of acceptable status codes, supply a go-compatible regular expression as the second argument:

./http-healtcheck https://jitesoft.com [2]{1}[0-9]{2} # Only accept 2xx responses!

The default regexp test is: [2-4]{1}[0-9]{2} which allows for any 2xx - 4xx page (just checking so that the server responds on http queries).

Development

Clone, there are no dependencies, so just go!

Building

The supplied makefile will (by invoking docker) build the binaries for linux, windows and darwin. The linux and darwin binaries are only built in amd64 version, while the linux binaries are built for amd64, arm64, ppc64le, s390x and 386 for both standard linux and linux distros using musl (like alpine linux). Binaries will be placed in the bin directory gzipped and ready for release! They are named as following: http-healthcheck-<OS>(-musl)-<ARCH>.tar.gz.

Examples:

bin/http-healthcheck-windows-amd64.tar.gz
bin/http-healthcheck-linux-arm64.tar.gz
bin/http-healthcheck-linux-musl-s390x.tar.gz
bin/http-healthcheck-dawrin-amd64.tar.gz