Heartbeat Monitoring

How to send regular HTTP requests?

Heartbeat monitoring is a great way to monitor intranet servers/computers/devices which are connected to the internet.

And, besides that, it also allows us to monitor the health of the regular actions (cron jobs, background processes..) our website/app/system performs.

It works in an opposite way compared to the other monitoring types as it requires the monitor to send the requests so that Uptime Robot can decide if it is up or down.

And, for sending these regular HTTP requests you can setup:

It is needed to use the crontab command for creating and maanging crons jobs.

In order to create/edit a cron job:

  • connect to the server/computer with SSH
  • type crontab -e
  • select the editor of choice from the displayed list
  • Append the entry like:
    */5 * * * * wget --spider "https://heartbeat.uptimerobot.com/m1616982-1d6f73e6a50d64d3491db9b3e7009b4af279d1at" >/dev/null 2>&1
    by replacing the URL with the URL of the heartbeat monitor and also replacing the /5 part with the interval value of the monitor
  • save and close the file (no need to restart)

This built-in Windows feature allows triggering actions and programs every x minutes. Window's Powershell can easily send HTTP requests and they can both be used in combination to send regular HTTP requests with steps:

  • open the task scheduler app and create a new task
  • make sure the task will run even if no user is logged-in:
    Windows Cron Job - Step 1

  • create a new trigger that will run every x minutes (where x must be the interval of the monitor):
    Windows Cron Job - Step 2

  • create a new action that will run Powershell to send HTTP requests and please enter the values:
    • Program/script: powershell.exe
    • Add Arguments: -Command "Invoke-WebRequest https://heartbeat.uptimerobot.com/m1616982-1d6f73e6a50d64d3491db9b3e7009b4af279d1at" (by replacing this URL with the URL of the heartbeat monitor)

    Windows Cron Job - Step 3

  • click ok and save the scheduled task