Monitor Python scripts and jobs with HookPulse
Call the check-in URL with the standard library when the script ends, and the failure URL when it raises.
Updated
1Create the monitor
Add a routine named python-job and set how often the job runs. Its page shows the check-in URL: use it in place of https://hookpulse.net/in/YOUR_ID.
2Check in at the end of the script
Put your job in run_job. urllib is in the standard library.
import urllib.request
HOOKPULSE_URL = "https://hookpulse.net/in/YOUR_ID"
def check_in(path=""):
urllib.request.urlopen(HOOKPULSE_URL + path, timeout=10)
try:
run_job()
check_in()
except Exception:
check_in("/fail")
raise3Run it once
Run the script once with python3. The routine shows the first check-in. From then on, a missed or failed run sends the alert.