Healthchecks

Valmiera, Latvia
2015
  |  By Pēteris Caune
In this post I’m comparing cron monitoring features of four services: Cronitor, Healthchecks.io, Uptime Robot, Sentry. How I picked the services for comparison: I searched for “cron monitoring” on Google and picked the top results in their order of appearance. Disclaimer: I run Healthchecks.io, so I’m a biased source. I’ve tried to get the facts right, but choosing what features to compare, and what differences to highlight, is of course subjective.
  |  By Pēteris Caune
Healthchecks recently gained a new feature: check auto-provisioning. When you send a ping request to a slug URL, and a check with the specified slug does not exist, Healthchecks can now automatically create the missing check. This feature requires opt-in: to use it, add a?create=1 query parameter to the ping URL.
  |  By Pēteris Caune
In this guide, I will deploy a Healthchecks instance on a VPS. Here’s the plan.
  |  By Pēteris Caune
Let’s say you want to get an email notification when the free disk space on your server drops below some threshold level. There are many ways to go about this, but here is one that does not require you to install anything new on the system and is easy to audit (it’s a 4-line shell script).
  |  By Pēteris Caune
Let’s say you have a script that works when run in an interactive session, but does not produce expected results when run from cron. What could be the problem? Some potential culprits include: Or it could be something else. How to troubleshoot this then, and where to start? Instead of trying fixes at random, I prefer to start by looking at logs.
  |  By Pēteris Caune
When a cron job does not run on time, Healthchecks can notify you using various methods. One of the supported methods is Signal messages. Signal is an end-to-end encrypted messenger app run by a non-profit Signal Foundation. Signal’s mobile client, desktop client, and server are free and open-source software (with some exceptions–read on!).
  |  By Pēteris Caune
Healthchecks.io recently got a new feature: run IDs. Run IDs are client-chosen UUID values that the client can optionally add as a “rid” query parameter to any ping URL (success, /start, /fail, /log, /{exitcode}). What are run IDs useful for? Healthchecks.io uses them to group events from a single “run”, and calculate correct run durations. This is most important in cases where multiple instances of the same job can run simultaneously, and partially or fully overlap.
  |  By Pēteris Caune
The crontab man page (“man 5 crontab” or read online) contains this bit: What does it mean precisely? If you specify both the day of month and the day of week field, then cron will run the command when either of the fields match. In other words, there’s a logical OR relationship between the two fields.
  |  By Pēteris Caune
The article Healthchecks.io Hosting Setup, 2022 Edition was recently on Hacker News. I was answering questions in the comments section. Here’s a recap of some of the questions and my answers. I’ve edited some of the questions for clarity.
  |  By Pēteris Caune
When clients make HTTP POST requests to ping URLs, Healthchecks captures and stores request body data. You can use this feature to log a command’s output and have it available for inspection later: Same thing, using runitor instead of curl: You can view the request body data in the web UI: Healthchecks also captures and stores email messages, when pinging by email.

Monitor cron jobs and get notified when they fail. Healthchecks.io monitors the heartbeat messages sent by your cron jobs, services and APIs. Get immediate alerts you when they don't arrive on schedule.

Make HTTP requests to the Ping URL at regular intervals. When the URL is not pinged on time, Healthchecks.io will send you an alert. You can monitor any service that can make HTTP requests or send emails.

What Can I Monitor With Healthchecks.io?

  • Cron Jobs: Healthchecks.io monitoring is a great fit for cron jobs and cron-like systems (systemd timers, Jenkins build jobs, Windows Scheduled Tasks, wp-cron, uwsgi cron-like interface, Heroku Scheduler, ...). A failed cron job often has no immediate visible consequences, and can go unnoticed for a long time.
  • Processes, Services, Servers: Healthchecks.io monitoring can be used for lightweight server monitoring: ensuring a particular system service, or the server as a whole is alive and healthy. Write a shell script that checks for a specific condition, and pings Healthchecks.io if successful. Run the shell script regularly.

Detect silent failures before your customers do.