Skip to content

Instantly share code, notes, and snippets.

@elyscape
Last active November 3, 2023 03:59
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elyscape/7e8c1ea7ae186fd780c59e8cbf87181d to your computer and use it in GitHub Desktop.
Save elyscape/7e8c1ea7ae186fd780c59e8cbf87181d to your computer and use it in GitHub Desktop.
Systemd configuration for healthchecks.io heartbeat
ENDPOINT=https://whatever
[Unit]
Description=Heartbeat
After=network.target network-online.target
Requisite=network.target network-online.target
[Service]
Type=oneshot
EnvironmentFile=/etc/default/heartbeat
ExecStart=/usr/bin/curl -fsS -m 10 --retry 3 ${ENDPOINT}
StandardOutput=null
DynamicUser=true
[Unit]
Description=Send heartbeat every 5 minutes
[Timer]
OnCalendar=*-*-* *:00/5:00
Persistent=true
[Install]
WantedBy=timers.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment