free website monitor using Google Spreadsheet | Winfred van Kuijk

free website monitor using Google Spreadsheet

By • Published: December 2, 2013 • Last updated: November 26, 2014 • Filed in: Software

Share
annotated text website monitor overview with menuIf you want to monitor multiple websites and get notified if your site is down, then you can use this solution that I created: a free website monitor which is based on Google spreadsheet.

The spreadsheet consists of a script that monitors your websites at a given interval (e.g. 1, 5 or 30 minutes). You can specify e-mail recipients and you will get an e-mail when the site goes down and also when the site is up again. All changes are stored in a log.

It will check for DNS issues and the most popular http errors, including page not found (404) or site not available (403).

The script only reads+writes the current spreadsheet and shares the results with only you.
See installation instructions, screenshots or more information about permissions.

Apr 2014: v1.1 has been published. Fixed bug sending mails, improved log format.

instructions

  1. website monitorDownload the spreadsheet
    You can download the website monitor spreadsheet from the Template Gallery.
  2. Enter the websites you want to monitor
    Fill in the name + URL of the site(s) you want to monitor in the yellow cells.
  3. Specify who you want to send the e-mail notifications to
    In the Settings sheet you can enter one or more e-mail addresses.
  4. Specify how often you want the website monitor to check your sites
    In the Settings sheet you can specify the interval. By default it checks every 5 minutes. You can choose from: 1, 5, 15, 30 minutes or 1, 6 or 12 hours. If the text is greyed out it means the automatic checking has not been enabled yet.
  5. First time: allow the script to read/write this spreadsheet, run in the background and send you mail
    See the permissions tab for details. After authorizing you will have to run the script again.
  6. Run the script manually
    Open the new menu website monitor at the top and run check websites.
  7. Or run it automatically
    Open the new menu website monitor and select add trigger to activate or remove time trigger to deactivate. The first time you will have to select [check trigger] so the script can check the status of the trigger. When automatic monitoring has been enabled, you will see when the most recent check was carried out and when the next check is scheduled (approximately).
  8. Check the results
    In the Sites sheet you see the most recent results. The message contains the response from the server. The timestamp is when the site first had an error. New errors are highlighted.
  9. Check the log
    The Log sheet shows the history of the checks. Every time a site has an error or comes back, a new line is added. When a site is back online then the duration is shown of the period that the site was unavailable.
  10. Check your e-mail
    When there is a change in status you will get an e-mail. Two types of mail: when a site becomes unavailable and when a site is back online. Click the link in the mail to open the spreadsheet for details.
  11. Updates of the script
    At the top of the Sites sheet you will be notified is there is a new version of the website monitor. If that is the case, download the new one and copy your sites, settings and log to the new spreadsheet.
  12. Limitations
    There are a couple of Google limitations. For regular Gmail users: you can have 10,000 checks per day. That’s checking about 7 websites every minute. You can send 500 notification mails (all recipients). The script can run in the background for 1 hour in total per day. In short: if you have more than 5 sites then the 1 minute interval might be too much, just select fewer sites or a higher interval.

screenshots

The main interface of the website monitor. Define your sites in the yellow cells. Run the script manually from the menu. Add the trigger for automatic checks.

The main interface of the website monitor. Define your sites in the yellow cells. Run the script manually from the menu. Add the trigger for automatic checks.

In the log sheet the website monitor stores the changes so you can see the various changes.

In the log sheet the website monitor stores the changes so you can see the various changes.

In the settings sheet you can specify who should receive the notification mails, and what the website check interval should be.

In the settings sheet you can specify who should receive the notification mails, and what the website check interval should be.

You will receive mail when a site becomes unavailable or available, with a link directly to the website monitor.

You will receive mail when a site becomes unavailable or available, with a link directly to the website monitor.

First time you run the script you will be asked to authorize the script.

First time you run the script you will be asked to authorize the script.

See permission tab for details. The permissions are needed for your sites and your notifications only.

See permissions tab for details. The permissions are needed for your sites and your notifications only.

permissions

When you see the Request for Permission popup window: scroll down to see the Accept button.

Request for permission.

The request for permission popup asks for several items. Here is an explanation of each item.
In short: the script needs to read data from your spreadsheet (only this one), it can run in the background, it will send you e-mail if there is a change.

Here is how you can make sure all of this is done only for you and only using this spreadsheet.
To see the source code, go to Tools > Script Editor…

  • View and manage your spreadsheets in Google Drive
    The script needs to read the spreadsheet to see what sites you would like to monitor, what your settings are, and needs to write the results in the overview and log sheet.
    To check: only getActiveSpreadsheet is used.
  • Allow this application to run when you are not present
    You can manually run the script (website monitor > check websites), or you can activate the trigger so the check is done at a specified interval. You do not have to have the spreadsheet open for this.
    To check: search for ScriptApp.newTrigger and see that it runs the function monitorSitesTrigger.
  • Send email as you
    When there is a change mail will be sent to the people specified in the Settings sheet.
    To check: search for Mail.App.sendEmail.
  • Connect to an external service
    The script tries to load the sites you specify. The content is not stored.
    To check: search for UrlFetchApp.fetch.

One Response to “free website monitor using Google Spreadsheet”

  1. Sathish Narayanan says:

    Hi Winfred,

    This is working super. But we need one option. Whenever site going down or up , how to get same as SMS alert? Can you, please tell us how to enable SMS feature.

Leave a Reply

« | Home | »