Make a HTTP GET request to this address from your cron job, daemon, script or long running task. When this address is not requested for a set time period, you will get alerted. Below are snippets that are ready to be copy/pasted into your own scripts.
# m h dom mon dow command
8 6 * * * /home/user/backup.sh && curl -fsS --retry 3 https://health.plehnmedia.com/ping/2be4eb25-4a58-4aac-a7d6-fb16df49456e > /dev/null
# using curl:
# (make sure it is installed on your system!)
curl --retry 3 https://health.plehnmedia.com/ping/2be4eb25-4a58-4aac-a7d6-fb16df49456e
# using wget:
wget https://health.plehnmedia.com/ping/2be4eb25-4a58-4aac-a7d6-fb16df49456e -O /dev/null
# urllib with python 3.x:
import urllib.request
urllib.request.urlopen("https://health.plehnmedia.com/ping/2be4eb25-4a58-4aac-a7d6-fb16df49456e")
# urllib with python 2.x:
import urllib
urllib.urlopen("https://health.plehnmedia.com/ping/2be4eb25-4a58-4aac-a7d6-fb16df49456e")
# using requests:
import requests
requests.get("https://health.plehnmedia.com/ping/2be4eb25-4a58-4aac-a7d6-fb16df49456e")
require 'net/http'
require 'uri'
Net::HTTP.get(URI.parse('https://health.plehnmedia.com/ping/2be4eb25-4a58-4aac-a7d6-fb16df49456e'))
var https = require('https');
https.get("https://health.plehnmedia.com/ping/2be4eb25-4a58-4aac-a7d6-fb16df49456e");
file_get_contents('https://health.plehnmedia.com/ping/2be4eb25-4a58-4aac-a7d6-fb16df49456e');
// the server returns appropriate CORS headers so cross-domain AJAX requests should work:
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://health.plehnmedia.com/ping/2be4eb25-4a58-4aac-a7d6-fb16df49456e', true);
xhr.send(null);
# inside a PowerShell script:
Invoke-RestMethod https://health.plehnmedia.com/ping/2be4eb25-4a58-4aac-a7d6-fb16df49456e
# Without an underlying script, passing the command to PowerShell directly:
powershell.exe -command &{Invoke-RestMethod https://health.plehnmedia.com/ping/2be4eb25-4a58-4aac-a7d6-fb16df49456e}
As an alternative to HTTP/HTTPS requests, you can "ping" this check by sending an email message to 2be4eb25-4a58-4aac-a7d6-fb16df49456e@health.plehnmedia.com
A list of your checks, one for each Cron job, daemon or periodically running task you want to monitor.
Give names to your checks to easily recognize them later. Adjust Period and Grace time to match the periodicity and duration of your tasks.
| New. A check that has been created, but has not received any pings yet. | |
| Up. Time since last ping has not exceeded Period. | |
| Late. Time since last ping has exceeded Period, but has not yet exceeded Period + Grace. | |
| Down. Time since last ping has exceeded Period + Grace. When check goes from "Late" to "Down", plehnmedia healthcheck sends you a notification. |
Alternatively, you can define the expected ping dates and times using a cron expression. See Cron Syntax Cheatsheet for the supported syntax features.
Grace Time specifies how "late" a ping can be before you will be alerted. Set it to be a little above the expected duration of your cron job.