A cron monitor (the Cron job type in the dashboard, also known as heartbeat monitoring) works the opposite way to the other monitors. LivePulser doesn't contact your system. Instead, your job sends a request to a private URL each time it finishes successfully, and LivePulser alerts you when that request doesn't arrive on time.
Use it for backups, report generation, data imports, cleanup tasks or anything else that runs on a timer, where "it quietly stopped running" is the failure you're worried about.
What LivePulser can and can't tell
A check-in carries one fact: a successful run finished at this time. From that, LivePulser knows when an expected run didn't report in. It doesn't know:
- whether the job started, how long it ran or what it printed;
- its exit code, or why it failed;
- whether the work was correct (a backup that wrote an empty file still sends its check-in).
There are no separate start or failure signals, so the only way LivePulser hears about a failure is the absence of a success. That's why the request must be sent only after the job succeeds.
Create a cron monitor
- Click New monitor and choose Cron job.
- Enter a Name, such as Nightly database backup, and optional Tags. Click Continue.
- On the Settings step, answer When does your job run? with Every interval or On a schedule (see below), and set the grace period. Click Continue.
- Choose where alerts go on the Alerts step, check the Review step, and click Create monitor.
- The completion screen shows Connect your job with your Ping URL and ready-made snippets. Click Copy and store the URL somewhere safe, such as your secrets manager or a root-only file on the server.
- Add the request to your job (see Add the check-in to your job) and run it once to confirm it works.
If the completion screen says Could not generate a ping URL, click Try again, or generate it later from the monitor page. The monitor's first deadline only starts once its URL is active.
Every interval or on a schedule
Every interval
For jobs that run on a steady rhythm, such as every 15 minutes or every 6 hours. Each check-in sets a new deadline: the interval plus the grace period from now. A check-in can arrive early; it simply starts the next countdown.
| Setting | Meaning | Default and range |
|---|---|---|
| How often should your job run? | The time between runs, in minutes, hours or days. | 1 day. From 1 minute to 30 days. |
| Grace period | Extra time allowed after the interval before a run counts as missed. Covers jobs that start late or run long. | 60 seconds. From 60 seconds to 1 hour. |
Example: a job runs every 15 minutes, with a 5-minute grace period. If it last checked in at 10:00 and nothing arrives by 10:20, LivePulser opens an incident.
The check-in is sent when the job finishes, so changes in how long the job takes shift the gap between check-ins. Make the grace period at least as long as the difference between your shortest and longest normal runs.
On a schedule
For jobs on a calendar, such as weekdays at 02:00 or the first Monday of each month. Each expected run must check in. You build the schedule from rules in the form; it doesn't take a cron expression. You can also describe the schedule in words in the Ask AI box and click the convert button (Convert with AI). Ask AI is on paid plans only. Check the rules it fills in, because AI can make mistakes; nothing is saved until you continue.
| Setting | Meaning |
|---|---|
| Timezone | The timezone the schedule is written in. Defaults to your browser's timezone. |
| Repeats | Every day, Weekly (pick days under On) or Monthly. Monthly can be A weekday of the month (1st to 5th or Last, plus a weekday) or Days of the month (1 to 31; months without that day are skipped). |
| Months | Every month, or chosen months from January to December. |
| Starts at | One or more start times in the day (up to 24). |
| Finishes | How long a run may take: At that time (the default), Within 5 minutes, 15 or 30 minutes, Within 1 hour, 2, 4, 8 or 12 hours, or Any time that day. |
| Grace after each run | How long after a run's window closes before it counts as missed. From 1 minute to 7 days. |
Use Add another rule for schedules that don't fit one rule, up to 10 rules.
A check-in counts for a run if it arrives between 5 minutes before the start time and the end of the run's window plus grace. Example: Starts at 02:00, Finishes Within 1 hour, and a 15-minute grace. A check-in between 01:55 and 03:15 counts; if none has arrived by 03:15, an incident opens.
Because the check-in comes at the end of the job, set Finishes to cover the job's longest normal run. With At that time, a 02:00 job that takes 10 minutes is already late when it checks in.
Late and unexpected runs
Two more choices apply to scheduled monitors:
| Setting | Options |
|---|---|
| When a missed run checks in late | Resolve the incident, marked late (default): a late check-in closes the incident, marked as late. Wait for the next scheduled run: the incident stays open until the job checks in during a scheduled run. |
| When the job runs outside its schedule | Record it (default): counts as a check-in, with no alert. Notify me: sends an "unexpected run" notice, at most one per hour, without opening an incident. |
A check-in outside every run window never counts toward the next scheduled run. A second check-in for a run that has already checked in also counts as outside the schedule.
Timezones and daylight saving
Scheduled monitors work in the timezone you choose, and LivePulser converts each run to an exact time, so a 02:00 job stays at 02:00 local time across daylight-saving changes. Avoid scheduling jobs in the hour when your timezone changes its clocks, because that local time is skipped or repeated once a year.
Make the monitor's timezone match the one your scheduler uses. cron normally uses the server's system timezone, so a server on UTC running a job "at 02:00" isn't the same as 02:00 in New York.
The ping URL
Your ping URL looks like this, with your monitor's ID and a 43-character secret:
https://hb.livepulser.com/v1/ping/<monitor-id>/<secret>Send a GET or POST to it. To keep the secret out of the URL (so it doesn't appear in proxy logs), send it in an Authorization header to the URL without the secret instead:
curl -fsS -m 10 --retry 3 -X POST \
-H "Authorization: Bearer <secret>" \
https://hb.livepulser.com/v1/ping/<monitor-id>| Response | Meaning |
|---|---|
| 204 | Accepted. |
| 404 | The monitor ID or secret is wrong, or the URL was rotated or revoked. Check that nothing was cut off when copying. |
| 405 | Wrong method. Only GET and POST are accepted; HEAD is not. |
| 413 | The request body is over 1 KiB. |
| 429 | Too many requests: more than 10 a second for one monitor, or a burst from one address. Retry a few seconds later. |
| 503 | The monitor is paused, or the service is busy. Retry after the Retry-After header (3 seconds). |
Request bodies up to 1 KiB are accepted but not stored, so don't send job output expecting to see it in LivePulser.
Retries and X-Heartbeat-Run-ID
If you retry a check-in, for example with curl's --retry, add an X-Heartbeat-Run-ID header (up to 128 characters) that stays the same across the retries. Requests with the same run ID within 5 minutes count as one check-in. Use a new ID for every run; a UUID works well. The dashboard snippets and the examples below do this.
Add the check-in to your job
The rule is the same everywhere: send the request after the job's real work, and only if it succeeded. The completion screen and the monitor page also have snippets in Shell, Crontab, Python, Node.js and PowerShell. The Crontab tab only suggests a crontab line that matches your monitor; LivePulser doesn't read your crontab.
Shell and cron
Chain the request with &&, so it only runs when the job exits with status 0:
/usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 -X POST \
-H "X-Heartbeat-Run-ID: $(uuidgen 2>/dev/null || cat /proc/sys/kernel/random/uuid)" \
'https://hb.livepulser.com/v1/ping/<monitor-id>/<secret>' > /dev/null-fmakes curl fail with a non-zero exit on an HTTP error such as 404, instead of treating it as success.-sShides the progress bar but still prints errors, so they reach cron's mail or log.-m 10gives up on an attempt after 10 seconds, so a network problem can't hang the job.--retry 3retries timeouts and temporary errors (including 429 and 503) up to three times.- The run ID uses
uuidgen, or the kernel's UUID file on Linux systems without it. It's created once, so curl's retries share it.
The same command works as one crontab line:
0 2 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 -X POST -H "X-Heartbeat-Run-ID: $(uuidgen 2>/dev/null || cat /proc/sys/kernel/random/uuid)" 'https://hb.livepulser.com/v1/ping/<monitor-id>/<secret>' > /dev/nullUse full paths in crontab, because cron runs with a minimal PATH. Don't use ; instead of &&: with backup.sh; curl …, the check-in is sent even when the backup fails, and LivePulser never alerts.
Inside a script
If the check-in is the last step of a script, make the script stop at the first failure:
#!/usr/bin/env bash
set -euo pipefail
pg_dump mydb | gzip > /backups/mydb.sql.gz
rclone copy /backups remote:backups
# Only reached if every command above succeeded
curl -fsS -m 10 --retry 3 -X POST \
-H "X-Heartbeat-Run-ID: $(uuidgen 2>/dev/null || cat /proc/sys/kernel/random/uuid)" \
'https://hb.livepulser.com/v1/ping/<monitor-id>/<secret>' > /dev/nullset -e has gaps that can let a failed job send its check-in:
- Without
pipefail, a pipeline only reports its last command, so a failedpg_dumppiped into a workinggziplooks like success. - Failures are ignored inside
ifconditions, in&&and||lists (except the last command), and in functions called from them. - Anything followed by
|| truenever fails.
When in doubt, make the job fail on purpose and confirm no check-in is sent.
Python
Raise an exception when the job fails, so the code never reaches the check-in:
import urllib.request
import uuid
PING_URL = "https://hb.livepulser.com/v1/ping/<monitor-id>/<secret>"
def main():
run_backup() # your job; it must raise an exception if it fails
request = urllib.request.Request(
PING_URL,
method="POST",
headers={"X-Heartbeat-Run-ID": str(uuid.uuid4())},
)
urllib.request.urlopen(request, timeout=10) # raises on an HTTP error
if __name__ == "__main__":
main()Node.js
fetch doesn't throw on an HTTP error, so check the response. This works in Node.js 18 or later, in an ES module (an .mjs file):
import { randomUUID } from "node:crypto"
const PING_URL = "https://hb.livepulser.com/v1/ping/<monitor-id>/<secret>"
await runBackup() // your job; it must throw if it fails
const res = await fetch(PING_URL, {
method: "POST",
headers: { "X-Heartbeat-Run-ID": randomUUID() },
signal: AbortSignal.timeout(10_000),
})
if (!res.ok) throw new Error(`Check-in failed: HTTP ${res.status}`)PowerShell
For an external program, check $LASTEXITCODE; it holds the program's exit code, and 0 means success. Invoke-RestMethod throws on an HTTP error.
& "C:\Jobs\backup.exe"
if ($LASTEXITCODE -eq 0) {
Invoke-RestMethod -Method Post -Uri 'https://hb.livepulser.com/v1/ping/<monitor-id>/<secret>' -TimeoutSec 10 -Headers @{ 'X-Heartbeat-Run-ID' = [guid]::NewGuid().ToString() }
}For a PowerShell script, if ($?) checks whether it succeeded. Make the script fail properly: start it with $ErrorActionPreference = 'Stop' so errors stop it, and end it with exit 1 on any failure you detect yourself. Otherwise many errors are printed but don't count as failure.
& "C:\Jobs\backup.ps1"
if ($?) {
Invoke-RestMethod -Method Post -Uri 'https://hb.livepulser.com/v1/ping/<monitor-id>/<secret>' -TimeoutSec 10 -Headers @{ 'X-Heartbeat-Run-ID' = [guid]::NewGuid().ToString() }
}In PowerShell 7 or later, add -MaximumRetryCount 3 -RetryIntervalSec 5 to retry a failed request; the retries reuse the same run ID.
Confirm it's working
After creation, the completion screen says Waiting for the first check-in from your job, and the monitor shows Waiting or Unknown until a check-in arrives. Send one by hand from the machine that runs the job. It should print 204:
curl -sS -o /dev/null -w '%{http_code}\n' -X POST 'https://hb.livepulser.com/v1/ping/<monitor-id>/<secret>'Then open the monitor. It should show Healthy with a Last check-in time. Interval monitors also show Expected every and the Next deadline; scheduled monitors show the Schedule and the Next run. A test check-in counts like a real one: outside a scheduled run it counts as an unexpected run, and sends a notice if Notify me is on.
| Status | Meaning |
|---|---|
| Healthy | Your job is checking in on schedule. |
| Waiting | No completed job has checked in yet. |
| Missed | The expected check-in is overdue; an incident is open. |
| Unknown | No check-in has arrived since the URL was issued, monitoring resumed or the settings changed. |
| Provisioning | LivePulser is applying the latest configuration, or the monitor has no active ping URL. |
| Maintenance | A maintenance window is active; alerts are held. |
| Paused | The monitor is paused and check-ins aren't evaluated. |
| Invalid schedule | The schedule can't be used. Fix it in Schedule. |
| Unavailable | The live state can't be read right now. Refresh to try again. |
When a check-in is missed
When the deadline passes without a check-in, LivePulser opens one incident and notifies the monitor's destinations. That includes a monitor that has never received a check-in at all. The incident timeline records Check-in missed, or Scheduled run missed for a monitor on a schedule. Further missed runs during the same outage don't open more incidents or send more alerts.
The next check-in that counts resolves the incident, records Check-in received, and sends a recovery notification. For interval monitors that's any check-in. For scheduled monitors, the When a missed run checks in late setting decides whether a check-in outside a run window counts. Runs that overlap a maintenance window are excused. See Incidents and recovery and Maintenance windows.
To change the schedule or grace later, use Schedule in the monitor's actions sidebar. Switching an interval monitor to a schedule starts watching from the next scheduled run.
Find or replace the URL later
Open the monitor and click Ping URL in the actions sidebar. It shows the URL with the secret masked, the snippets, and these buttons:
- Generate ping URL, when the monitor doesn't have one yet. Any team member can do this.
- Rotate ping URL (or Generate new ping URL after a revoke), then Rotate URL to confirm. Only admins and owners can do this. The new secret is shown once, and the old URL stops working once the change is applied.
- Manage API keys, which opens Account → API keys. See Monitor keys.
A revoked URL rejects pings, and no missed check-in alerts are sent until a new URL is generated.
Keep the URL secret
Anyone with the ping URL can send check-ins for your monitor and hide a real failure. Keep it out of public repositories and shared scripts, and rotate it if it leaks. A command line, including the URL, can be seen by other users on the same machine while it runs. To avoid that, put the header in a file only the job's user can read, and let curl read it:
# /etc/livepulser/backup.header (mode 0600), one line:
# Authorization: Bearer <secret>
/usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 -X POST \
-H @/etc/livepulser/backup.header \
https://hb.livepulser.com/v1/ping/<monitor-id> > /dev/null-H @file needs curl 7.55 or later.
Troubleshooting
| Problem | Likely cause | What to do |
|---|---|---|
| Missed, but the job ran | The check-in never reached LivePulser: curl failed, a firewall blocks outbound HTTPS, or the URL is wrong. | Run the test command above on the same machine and check for 204. Check cron's email or log for curl errors. |
| Missed or late at the wrong time | The monitor's timezone differs from the scheduler's, or Finishes is shorter than the job's real run time. | Match the timezone, and widen Finishes or the grace. |
| Missed now and then on an interval monitor | Run times vary, so the gap between check-ins sometimes exceeds the interval plus grace. | Raise the grace period. |
| No alert when the job failed | The check-in is sent unconditionally, for example after ; or at the end of a script without set -e. | Use && or set -euo pipefail, and test with a forced failure. |
| 404 from the ping URL | The ID or secret is wrong, or the URL was rotated or revoked. | Copy the current URL, or rotate it and update the job. |
| 405 from the ping URL | The request used HEAD or another method. | Use GET or POST. |
| 503 from the ping URL | The monitor is paused. | Resume the monitor. |
| Unexpected run notices | Notify me is on and the job ran outside its windows, or checked in twice for one run. | Fix the schedule rules, or choose Record it. |