While working on home server automation, I came across the awesome Open Source project healthchecks.

I had been looking for a simple way to monitoring my Ansible home automation setup that is triggered via cron and send me alerts if my home automation takes longer than a set interval or just fails.

healthchecks.io, the service for healthchecks project, is an extremely simple dashboard for setting up monitoring. It also has integration with alerting systems as well as commonly used communication tools such as Teams, Slack, Signal and numerous others.

From project’s website:

Healthchecks.io works as a dead man’s switch for processes that need to run continuously or on a regular, known schedule.

That means if the results are received within given amount of time at regular intervals, the check is considered healthy, if not the check has failed.

Results can be submitted using curl command embedded within your script.

# Add at the end of your script
# check-uuid - custom uuid generated for your check
curl https://hc-ping.com/check-uuid

It also supports signals such as start to indicate start of script or a job and fail to indicate failure.

# Beginning of your script
curl https://hc-ping.com/check-uuid/start

##################
# YOUR TASKS HERE
##################

# Towards the end of the script

if [ $? -eq 0 ]
then 
    # Post success
    curl https://hc-ping.com/check-uuid
else 
    # Post failure
    curl https://hc-ping.com/check-uuid/fail
fi

A full range of supported API calls can be found here.

healthchecks.io also supports submitting logs which can then be part of the alert message.

healthchecks.io is trivial to setup and easy to management. Initial setup is extremely simple, it has great range of features and documentation is well written. Here’s a link to Ansible callback plugin that I’m using to integrate with healthchecks.io.