Service availability checker - poor man's downforeveryoneorjustme.com
casual way, via browser:
- connect to
{server_name}:{port}and type it - type
{server_name}:{port}/{website_you_want_to_check}, you'll be automatically redirected to status checker
pr0 way, via json api:
- send POST data to
{server_name}:{port}/api/- disclaimer: flask will automatically redirect non-POST data sent to API to normal checking endpoint
- with
application/jsoncontent-type - all you need to send is just
{"url": "{url or host or full address}"} - and you'll receive
{"description": "Server is up", "status": "UP", "url": "8.8.8.8"}
SLOW- when server responded but with a delay between 10-30 secsDOWN- when server is down or responded with delay larger than 30 secsFLAPPY- when server doesn't answer all of our probesUP- when everything is OKHTTP_4xx- when server returned HTTP 4xx errorHTTP_5xx- when server returned HTTP 5xx errorCONN_ERR- when we cannot reach host, e.g. it's not in our DNS
- Python 3.6 (should work with 3.3+ but not tested)
- *nix preffered, not tested on Windows
git clonethis repo &&cdinto itpython3 -m venv envpip install -r requirements.txtexport FLASK_APP_ENVIRONMENT=Developmentpython3 wsgi.py
- set environmental variable
FLASK_APP_ENVIRONMENTto a class name of settings class inconfig.py - use your favourite wsgi server and point it to
wsgi.py::app - enjoy

