Skip to content

Know when a host goes dark

You’ll get: an incident when a server, NAS or Raspberry Pi stops checking in — whether it crashed, lost power, or lost the network — instead of you finding out when you next try to use it.

Create a heartbeat monitor for the host (see Heartbeat monitors) and set its expected interval and grace period to match how often you’ll ping it — for example, an interval of 5 minutes with a couple of minutes’ grace, so one missed network blip doesn’t open an incident. Copy the monitor’s key, shaped like iik_hb_….

From cron, on the host you want watched:

*/5 * * * * curl -fsS -m 10 --retry 3 https://infrainbox.example.com/v1/heartbeats/iik_hb_XXXXXXXXXXXX >/dev/null 2>&1

Or, without cron, a systemd timer:

/etc/systemd/system/infrainbox-heartbeat.service
[Unit]
Description=Ping InfraInbox heartbeat
[Service]
Type=oneshot
ExecStart=/usr/bin/curl -fsS -m 10 --retry 3 https://infrainbox.example.com/v1/heartbeats/iik_hb_XXXXXXXXXXXX
/etc/systemd/system/infrainbox-heartbeat.timer
[Unit]
Description=Ping InfraInbox every 5 minutes
[Timer]
OnBootSec=2min
OnUnitActiveSec=5min
[Install]
WantedBy=timers.target
Terminal window
sudo systemctl enable --now infrainbox-heartbeat.timer

A plain ping like this is always a success: it doesn’t matter which form you use, as long as it arrives before the interval and grace period run out.

  • The monitor shows Up in the dashboard within a few minutes of setting this up.
  • Stop the timer (or unplug the host, if you’re brave): once the interval plus grace period elapses with no ping, the monitor flips to Down and an incident opens.
  • Bring it back: the next ping resolves the incident automatically.