{% extends "base.html" %} {% load staticfiles %} {% block title %}Documentation - healthchecks.io{% endblock %} {% block content %}
Each check you create in My Checks page has an unique "ping" URL. Whenever you access this URL, the "Last Ping" value of corresponding check is updated.
When a certain amount of time passes since last received ping, the check is considered "late", and Health Checks sends an email alert. It is all very simple, really.
At the end of your batch job, add a bit of code to request one of your ping URLs.
The response will have status code "200 OK" and response body will be a short and simple string "OK".
In bash scripts, you can use wget
or curl
to run the requests:
curl {{ ping_endpoint }}{uuid-goes-here}
Each check has a configurable Period parameter, with the default value of one day. For periodic tasks, this is the expected time gap between two runs.
Additionally, each check has a Grace parameter, with default value of one hour. You can use this parameter to account for run time variance of tasks. For example, if a backup task completes in 50 seconds one day, and completes in 60 seconds the following day, you might not want to get alerted because the backups are 10 seconds late.
Each check can be in one of the following states:
New. A check that has been created, but has not received any pings yet. | |
Up. Time since last ping has not exceeded Period. | |
Late. Time since last ping has exceeded Period, but has not yet exceeded Period + Grace. | |
Down. Time since last ping has exceeded Period + Grace. When check goes from "Late" to "Down", healthchecks.io sends you an email alert. |