Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Deploy a scheduled task for monitoring a URL
ResourceFunction["URLMonitor"][url,timespec] deploys a ScheduledTask to a new anonymous cloud object, that monitors url on the schedule defined by timespec. | |
ResourceFunction["URLMonitor"][HTTPRequest[…], timespec] deploys a ScheduledTask to a new anonymous cloud object that monitors the HTTPRequest. | |
ResourceFunction["URLMonitor"][req, timespec, CloudObject[…]] deploys a ScheduledTask to the specified cloud object. |
| period | run once every period |
| {period} | run once after the period |
| {period,count} | run only count times ever |
| "Hourly" | run once an hour |
| "Daily" | run once a day |
| "Weekly" | run once a week |
| "Monthly" | run once a month |
| "Yearly" | run once a year |
| Quantity[…] | run at a specified time interval |
| "Recipients" | Automatic | string or list containing emails to which error logs will be sent |
| "FailureTypes" | Automatic | list of numbers representing http codes that are classified as errors that will be logged |
| "EventLog" | None | CloudObject to which all logs (failure or success) will be written |
| "AlertOnChange" | False | whether to send an email when the monitor detects a change in response status |
| TimeConstraint | Infinity | maximum allotted time in seconds to finish URL request |
| "LogTemplate" | "`date`: URL `url` returned status code `status`" | message template used for logging all monitor requests |
| "ErrorMessageSubject" | "Monitor Error Detected" | email subject for an error alert |
| "ErrorTemplate" | "URL `url` generated a `status` error at `date`" | message template used for error logging |
| "ChangeNotificationSubject" | "Monitor Change Detected" | email subject for a status change alert |
| "ChangeNotificationTemplate" | "`date`: URL `url` change from `previousStatus` to `status`" | message template used for status change alerts |
Deploy a monitor for an example URL as a CloudObject, running every hour starting now:
| In[1]:= |
| Out[1]= |
Delete the scheduled task created in the previous line:
| In[2]:= |
| Out[2]= |
Deploy a monitor that tests a URL daily as a CloudObject, sending error reports to a specific email address:
| In[3]:= |
| Out[3]= |
Delete the task:
| In[4]:= |
| Out[4]= |
Deploy a monitor to a named CloudObject (either existing or new):
| In[5]:= |
| Out[5]= |
Delete the task:
| In[6]:= |
| Out[6]= |
URLMonitor can be passed an HTTPRequest instead of a URL string:
| In[7]:= | ![]() |
| Out[8]= |
Delete the task:
| In[9]:= |
| Out[9]= |
Wolfram Language 13.0 (December 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License