Website/domain monitor – Google sheet and Apps Script

One of my websites was recently down for a couple of weeks without me noticing (it looks like the email notification got lost in the post). So to avoid this happening again I have created myself a website monitor using a Google Sheet and Apps Script.

The script runs once a night and does a few simple checks:

whether the site is accessible

whether the domain will expire soon (“soon” being configurable in the script)

Installation

Enter your own domains – Delete my domains and list your own (excluding any “www” or “http”) in the sheet

Set up the script properties(optional) – Go into the script editor (Tools > Script editor…) and then File > Project Properties > Script Properties. This step is optional, but you will obviously not receive email notifications and/or a link to the results sheet. Here add two rows:

EMAIL – with the email address you want the notifications sent to

SHEET_URL – the URL of your copy of the GSheet

Set up the trigger – Go to “Resources > Current project’s triggers” and add a trigger:

to run checkDomains()

time-driven

at whatever frequency you like – I use daily

and at whatever time – I run mine at 1am

You can also simply copy the script into your own sheet from the gist. There are a couple of things to note if you take this route: