Monitor a cron job or scheduled task
When logged into OnlineOrNot, navigate your way to the heartbeats dashboard to see your list of monitors.
If it's your first time using OnlineOrNot, this list will be empty, so let's create our first one.
First, click on the Add heartbeat button, and enter a name, reporting period, and grace period for your cron job or scheduled task.
The field under the label "Expect a heartbeat every" is called the reporting period. Enter how often you expect your cron job or scheduled task to run.
For example, if I have a database backup that runs every day, I would enter
The Grace period field configures how late the cron job is allowed to be, before OnlineOrNot sends an alert.
For example, if I know that my database backup can run up to 30 minutes late without a problem, I would enter
At the bottom of the form, hit Save, and you will be redirected to your newly created check.
You will see the URL for the check you just added, and it will be ready to receive requests.
For example, if my cron job is a shell script called
backup_db_to_r2, I can add a
curl to the job to start sending heartbeats to OnlineOrNot:
# my crontab30 18 * * * backup_db_to_r2 && curl https://oonchk.com/xxxxxxxxx