brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: set HEARTBEAT_URL and Beszel pings an outside monitor so you notice a dead hub

Beszel
~/tips/tip-beszel-heartbeat-url

environment:

Makes the Beszel hub send regular pings to an external service like Healthchecks.io.

I run Beszel on my Unraid server, and it is good at telling me when something else is in trouble. The awkward question is who tells me when Beszel itself is down. The hub has a built-in answer for that: a heartbeat to a service outside the box.

environment:
  HEARTBEAT_URL: https://hc-ping.com/your-uuid-here
  HEARTBEAT_INTERVAL: 60
  HEARTBEAT_METHOD: GET

These are environment variables for the hub container. The Beszel documentation names Healthchecks.io, BetterStack and Uptime Kuma as targets, and describes the idea as a dead man’s switch: if the pings stop arriving, the external service alerts you. The hub does not need to be reachable from the internet for this, because the pings go outwards.

The defaults are worth knowing. The feature is off while HEARTBEAT_URL is empty. HEARTBEAT_INTERVAL is 60 seconds by default, and HEARTBEAT_METHOD can be GET, POST or HEAD, with POST as the default. With POST the hub sends a JSON body with a status field, the counts of systems that are up, down, paused and pending, the names of the systems that are down, and the triggered alerts. Use GET or HEAD for a service that only needs a plain ping.

On the Healthchecks.io side the body is stored with the ping, so a failing check comes with a summary. Set the check’s period to something comfortably above the interval. The Healthchecks.io documentation also asks you not to ping a check more than 5 times per minute, which a 60 second interval respects.

Two caveats. When you set these values as environment variables, the documentation says they take precedence and the settings page in the hub becomes read-only. And a heartbeat only tells you the hub is alive, not that every monitored system is fine. The first is in the documentation. This tip was not run against a live hub.

Further reading: Beszel heartbeat monitoring, Beszel environment variables

Going deeper: Keep a domain pointed at your home with Cloudflare DDNS on Unraid

More Beszel tips beszel-agent: All Beszel tips (2) All topics

Link