Read a Random Post

Use Google Docs to Get Free SMS and Email Alerts When your Website is Down

Written by

Topics: Tips & Tricks

Web has shrunk the world. Even personal views of an individual from the remote part of the world can reach worldwide thanks to the internet. Social Networking sites and blogs have made it possible. It does not cost you a penny to start a blog or website, there are many services who offer it for free. Some write in blogs as a hobby while others do it as a professional or a part time job. If you own a website you might be interested in monitoring its availability around the clock and getting notified when your site is not accessible. When you involve yourself totally on it making it your profession,then it becomes even more important to monitor your site constantly.

There are many free website monitoring sites that lets us do this job. But they are only trial version or come with some limitations. For example Pingdom lets you track only one website and offers only 20 SMS alerts for a free account. So why not build your own website monitoring service? Google Docs helps you do this. I recently came across an article in Digital Inspiration where Amit had demonstrated how to use Google Docs to monitor your website and get email alerts for free. So I thought why not extend the script to allow Google Docs to send you free SMS alerts too when your site is down. Also the current script was supporting the ability to monitor only single site, you had to create mutiple copies to track many sites. So I have also updated the script to support monitoring of many sites with a single doc itself.

Get Free SMS Alerts When your Website is Down with Google Docs

How to Use Google Docs to Monitor Multiple Sites and Get Free Downtime SMS Alerts

Google Calendar will be aiding Google Docs to send free SMS notification when site is down. Whereas the actual monitoring is done by Google Docs.

  • Configuring Google Calendar for Phone Notification

1. Log in to Google Calendar

2. Click on the Gears icon on the top right and select settings.
setup for mobile alerts in Google Calendar

3. Now click on the Mobile Setup tab.

4. Select Country, enter your Phone number and now click Send Verification Code. Now enter the code you got on your mobile and verify your number. If you don’t receive the code check if your carriers fall under supported mobile providers.
configur phone notification in Google Calendar

5. Now in Notifications select SMS as your default notification channel and save it.
select SMS notification as default in Google Calendar

Now you are done with the Google Calendar configuration part. All that is left is to copy the Google Docs provided below and set the polling frequencies.

  • Configuring Google Docs To Monitor your Sites

1. Log in to Google Docs

2. Click here to make copy of the Google Spreadsheet.

3. In F3 to F6 cell you can enter the URL of the sites you want to monitor. Currently supports up to four sites. You can tweak the code to support many more.

4. In cell F8 enter your Email Address into which you want to get alerts. Entering phone number is not required as it will be picked up from Google Calendar.

5. Now select Tools-> Script editor.

6. Select Resources-> Current script’s triggers. Under Run select “isMySiteDown” then in Event select Time-Driven, Minutes timer and Every minute and save it. Now click the Authorize button and then Grant Access. Save the trigger again.

Set Google Docs Trigger Timer

Now on Google Docs will be polling and monitoring all the sites you have entered every minute. You will be getting SMS alert, Email alert when any of the mentioned site is DOWN, the exception/error details will be logged in ‘C’ column and URL will be logged in ‘B’ column helping you identify which site was actually down. Similarly you will be getting alerts once the site which was DOWN is UP again.

If you are interested you can find the source code here. Feel free to modify and tweak it.

So, go ahead and try it out, monitor multiple sites Uptime for free with Google Docs. Did it workout for you? Have any suggestions? Found any bugs? Do report it!

115 Comments For This Post I'd Love to Hear Yours!

  1. OlegT says:

    Here is a way of obtaining SMS alert from gmail.com using Google Calendar
    http://gmail2sms.blogspot.com/2012/03/how-to-get-sms-notification-of-new-mail.html

  2. Agnes says:

    I’m happy to read your blog

  3. farey says:

    how can i set up google docs to send me mobile notification ( SMS ) for when there is a change in one of my doc. Like, i have submission for and when someone submits something with that form, i would like to get sms notification to my mobile. Is this possible?

    • Shunmugha Sundaram says:

      @farey

      Yes, it is very much possible. Here’s how to do it.

      Set up mobile notification in Google Calendar as mentioned in the article.

      1. Go to the concerned Google doc(Form) then select Tools-> Script editor. And paste the below code and save it.

      function sendsmsonformsubmit(e)
      {

      var subject = “Contact Us Form Submitted”;

      CalendarApp.createEvent(subject,
      new Date(now+20000),
      new Date(now+20000)).addSmsReminder(0);

      }

      2. Now Select Resources-> Current script’s triggers. Under Run select “sendsmsonformsubmit” then in Event select “From spreadsheet” then “On form submit” and save the trigger.

      3. Save the script again.

      That’s it. You will be getting a SMS notification when someone submits that form. Hope it was useful.

      Cheers!

      • farey says:

        Hi Shunmugha Sundaram, in script editor when i try to save it, it says illegal character in line 4. What seems to be this?

        • Shunmugha Sundaram says:

          Farey,

          Problem is with double quotes. This usually happens when we are copying pasting the code from web. Just remove the quotes surrounding Contact Us Form Submitted and manually type in double quotes. Then save it you should not be getting any error.

      • farey says:

        Hello, Thanks for your great tip. I still have error as “ReferenceError: “now” is not defined. (line 8)”… can you please tell me how to fix it?

        • Shunmugha Sundaram says:

          Sorry about that farey! Here is the updated version. Replace double quotes manually as you did before.

          function sendsmsonformsubmit(e)
          {
          var now = new Date().getTime();
          var subject = “Contact Us Form Submitted”;

          CalendarApp.createEvent(subject,
          new Date(now+20000),
          new Date(now+20000)).addSmsReminder(0);

          }

  4. Hi,

    Thanks for providing such a wonderful trick. Was looking for such from past few days. Thank you very much.

    Regards
    Henry
    Techglimpse.com

  5. agileadam says:

    I’ve made some improvements to your code/spreadsheet. Thanks for your hard work improving the original script! http://agileadam.com/google-docs-uptime-monitor

    • Shunmugha Sundaram says:

      You are most welcome. Happy that my effort did not go waste :) Checked your script, looks great.

  6. Zit says:

    Hi, wonderful work man, I love it,
    I was wondering instead of it checking the website, is there a way I can have it send me email & SMS when for example Cell B18 is greater than lets say 10 or cell B18 changes.

    Thanks

    • Shunmugha Sundaram says:

      Thanks zit. Here we go. I have create a sample spreadsheet to demonstrate the requirement you asked for. Make a copy of it and set the trigger (Tools-> Script Editor then Resource-> Current Script Triggers->From Spreadsheet , On Edit. Then change your email id and set up Google Calendar as per instructions in the article.

      Get Email, SMS alerts when a Spreadsheet cell is modified via Google Apps Script

      Do share the article. Cheers!

      • Zit says:

        Thanks man your script works way I described it
        but I had to make some modification
        I don’t want it to send me everytime it is greater than 10
        so I changed formula to
        if(value=10)

        and I have one problem, script only works if I change the value manually but clicking into the cell.

        in Cell B18 I have formula
        =if(B15>3,”10″,”9″)

        so if B15 is greater than 3 than B18=10 then I want script to send me email.

        Plz help me fix this.

        Thanks alot

        • Shunmugha Sundaram says:

          You mean two conditions should be satisfied in order to get an email? B15>3 and B18=10 rite?

          We can use nested if to check it. I have updated the same spreadsheet, do check it.

          If you found this article useful, do share and like it :)

  7. farey says:

    I am wondering if there is any way that it can be possible, like i have google docs “form submit” link at the bottom of every blog post ( blogger ) and when visitor clicks that link, “submit form”, it will take to form submission page and i want post title to be automatically fetched into one of the field in submission form. Is it possible? any help will be highly appreciated.

    • Shunmugha Sundaram says:

      Farey,

      I suggest you to use ImportXML. Trying fetching the title tag and assign it to the field.

      XML Parsing tutorial: https://developers.google.com/apps-script/articles/XML_tutorial

  8. farey says:

    Thank you for your suggestion. But since i have very less knowledge on xml and html, i could not understand the concept. can u explain it or get me the codes plz.

  9. Mohamed says:

    Hello there,

    Thank you very much for this great article :) It’s really very useful for me. I have some questions please :

    1-Why does it show MY email address in the SMS message? It doesn’t show the sender’s or the editor’s address.

    2-Is it possible to shorten the date format a bit? So that I can see more of the actual content in the message?

    3-Regarding the chart limit of 119 I think I have WAY Less limit, can this be caused by arabic letters in the message?

    Thanks very much!!

  10. AJIT says:

    hello Shunmugha Sundaram

    my problem.. not getting sms alert.

    i did all ur points stepwise. i get message of 1 line into my gmail inbox from the senders email address. iam using url address of the firm in the google docs script section. shud i use email id of sender instead?. Iam not getting the messages got into my gmail account, as sms to my mobile ?.where am i wrong, i dont know. i assure u, i have not missed any of ur points while doing settings.

    • Shunmugha Sundaram says:

      Ajit,

      You are trying to get alerts for emails rite? Then the article you should refer is this:

      http://techawakening.org/free-sms-alerts-new-email-on-gmail-with-google-docs/1130/

      • Rohit says:

        I am having a great time with ur above script for email alert on mobile.

        But suddenly today it is not giving any alert for any email

        can i knew what may be wrong with it?

        I really need very urgently to solve this problem

        Thanks in Advance

        Regards
        Rohit

  11. ajit says:

    thanks for the reply. i now get the email to inbox to sms alerts correctly.

  12. tamilmaran says:

    Please somebody help me monitor my Server IP(ping monitor) instead of website monitoring.
    Thank in advance

    • Shunmugha Sundaram says:

      Have you tried replacing host name with just IP in the code?

      • tamilmaran says:

        no, i viewed the source code i look like fetching the url , i thought i might not working
        can you help me out pls..

        • Shunmugha Sundaram says:

          Try replacing directly with ip for example for Google it is http://74.125.236.38/

  13. Ashish Anand says:

    Is it compulsory to use step 3 in configuring google docs?
    I skipped that step and the sms alert for emails is not working.
    Please help.

    • Shunmugha Sundaram says:

      Step 3 in the sense? Could you be more clear because there are two sets of instructions. Which one do you mean ?

  14. Ashish Anand says:

    Step 3 in “Configuring Google Docs To Monitor your Sites”.
    Please elaborate this step.

  15. Ashish Anand says:

    Shall we enter URL of gmail? ie, https://mail.google.com/mail/u/0/?tab=wm#inbox ?

    • Shunmugha Sundaram says:

      Ashish,

      Are you trying to get SMS for an email or to get alerts when your site is down?

  16. Ashish Anand says:

    I am trying to get alert for an email.

    • Shunmugha Sundaram says:

      Then please refer this article:

      http://techawakening.org/free-sms-alerts-new-email-on-gmail-with-google-docs/1130/

  17. Francis Lee says:

    Hi,

    I have tried your article but it doesn’t work for me. The is:inbox filter says it will not match anything. I tried on a single email address but what happens is the filter that I created seems to be applied at first but then it is removed. It makes me wonder whether google has blocked it for our Google Apps domain.

    Francis

    • Shunmugha Sundaram says:

      Try the filter in:inbox . As far as I know there is no such restriction in place.

      • Francis Lee says:

        Thanks for the reply. It’s working now. I think it was just a carrier issue with my Telco provider. I have yet to try the in:inbox label. I’ll check it out and see what happens.

        Francis

  18. sid says:

    Hi Sundaram

    Thanks, just one word for your tip – Awesome!!!

    Though its working fine for me but had just one issue – I am getting 2 SMS alerts every-time a new email arrives.

    Any fix for that.

    Please help,
    Tons of thanks in advance.

  19. gaurav says:

    Hi,

    i am not getting the verfication code on my mobile phone. I am fromm delhi and using MTNL

    • Shunmugha Sundaram says:

      Supported mobile providers : http://support.google.com/calendar/bin/answer.py?hl=en&answer=37226#I

  20. Willian says:

    Awesome! Was looking for something like this, thanks. One doubt I have is, does it affect the site performance in any way? Like if the load on the server and traffic is high putting the server at risk, can this monitoring, crawling or however it works, make it worse even if just a tiny bit?
    Thanks!

    • Shunmugha Sundaram says:

      Welcome. No. Because it’s just a request made to get the response code which tells if your site is up or down :) Do share this article if you liked it.

  21. TONY says:

    Hi Shunmugha and every one
    I have read and tried setting and thing seems working ok, but I always get sms twice (the second one comes in few min apart).
    If i create calendar event manualy, I get only one sms as it should be.
    I did compare those events, every thing was set the same.
    Would someone help me?
    thanks

  22. Minra says:

    Did anyone know how to add notification in some special calendar not the personoal a new one. like SENDSMS calendar.

  23. pithiki says:

    sorry trying to post on http://techawakening.org/free-sms-alerts-new-email-on-gmail-with-google-docs/1130/

  24. George says:

    Hi,
    Nice script, and thanks for this blog. I want to monitor some IPs, can this script to monitor IP?
    Thanks

  25. George says:

    Hi,
    I search over the internet how to modify this script to monitor a public IP but I don’t find anything and I don’t have scripting knowledge. Maybe when you have time you will modify this script to work whit IPs.
    Thanks! :)

  26. Biju says:

    HI,
    I do get an SMS (2) when website id down, but when the site is UP i don’t get any SMS. :(
    Can you please help me with this weird behaviour

  27. Riya kumari says:

    i did all the procedures…yet not working..no sms…

  28. Anoop Mohan says:

    Thank You for your great script, which is now promptly alerting me for new emails, and i can see that you are trying to reply for every query, and every need, that is wonderful, kind people are not extinct..thanks

  29. Ohh, Intended to post this on you email alert post. Sorry for misplacement.

  30. Simon says:

    Hi!

    I’ve been using this for awhile now and I have been trying to get the calendar notifications to appear in a separate calendar. I think its on the [ CalendarApp.createEvent( url + ‘ is DOWN’ ,] and I need to add [.getCalendarsByName(‘Calendar-Name’)] to it but whenever I do it doesnt seem to work.

    Does anyone have any suggestions?

    thanks

    Simon

  31. purnima goswami says:

    thanks a lot for ur article. i was actually looking for such information. I have done all the steps you have mentioned. Now lets see, if it responds as per my need.

    Thanks for helping. Will share this with friends and social sites….

  32. ramesh says:

    hi .. is it possible to send a value of cell in spreadsheet via email and sms? pls say how..

  33. Nandha Kishore says:

    Can u please tell me how to stop monitoring

    thank you

  34. operatorkita says:

    I’am very happy get read this article and try to monitoring my website for free sms alert to my phone. thanks

  35. kvin says:

    hi! i’ve got several gmails with different subject in time. all of them were marked with “sendsms” label. but only subject of the last gmail appeared in all calendar events produced from every “sendsms” gmails. any ideas? thanks a lot!

  36. ddanndt says:

    Is it possible to modify your code to check if a certain webpage has been updated, and receive an sms when it happens?

    Also is it possible to retrieve the page source size using JS?

  37. foodi says:

    Hi there!
    Great script. Extremely useful!

    However, i have one question for you:

    I seem to be getting a lot of false positives with regard to the polling. Is there some way to modify the script so that it allows a certain amount of time for a given site to load before determining if it’s down?

    • Foodi,

      You are most Welcome. Sorry the internal API does not support that feature yet :(

      More on this: http://stackoverflow.com/questions/19135818/how-cancel-an-urlfetchapp-fetch-after-specified-time

      And please do share this article and spread the love ;)

  38. Kiran says:

    Wow Grate Artical….its working Thank You very much

  39. draktech says:

    Thanks for share, i will try action to make my website always connecting with this application..

  40. Nick says:

    Thanks for this!

    Massive problem – I can’t seem to get the techawakening ‘site down’ notifications to stop – I have deleted the original spreadsheet although they still seem to be coming hard and fast! It’s insane.

    How do I stop this madness?? :P

    Thanks!

  41. anusha says:

    hi,
    is it possible to know when there are new updates on the site rather than when the site is up or down???

  42. anusha says:

    ok… how do i disable the sites i updated in the excel sheet?

  43. Carlos says:

    Hello Shunmugha,
    congratulations for your script! It is very interesting.

    I need a script that search for a string on website/forum and email me when it was found. Example:

    This site shows a lot of sales (www.hardmob.com.br/promocoes/) . I’m looking for “led tv” . I would like to be warned when someone publish an alert about led tv sale.

    Is it possible to modify your script to get this new feature ? I’m not from TI area. So, for me it is almost impossible. ;)

    Best Regards,
    Carlos Vale.

    • Carlos,

      You are most welcome. Yes it’s very much possible to implement. You can write to me at admin@techawakening.org to discuss more. Will create a POC and let you know if you are interested.

      You can opt for Starter Plan listed at https://gumroad.com/techawakening

  44. elias leousis says:

    This is a great utility, but insteda of checking if the website is down, I would like ot check if there has been any changes to the web site; more specifically changes to a selected line of text: There is a utility that does this ( check4 change) but it does not send SMS alerts and you have to have your computer running under firefox to use the add on. The feature should:

    1- Aloow you to log in to a specific site to which login is required
    2- Check for changes in the web site at specified locations ie: text changes

  45. Dany Boyle says:

    Thanks very much……………
    Appreciate your work………..
    keep us providing more tricks like these in future…..
    thanks.

  46. Tom says:

    I was wondering if you knew how to specify the calendar to place the events into?

    From the reference at Google it looks like there is a parameter to specify a calendar name but I’ve tried changing the script to have the calendar name but that didn’t work.

    var event = CalendarApp.getDefaultCalendar().createEvent(‘Apollo 11 Landing’,…

    I tried changing getDefaultCalendar(). with the name of the calendar but that didn’t work.

    Suggestions?

    • Tom,

      Here’s how you should. Will update the code soon to use custom calendar. Do share this article across ;)

      var cal=CalendarApp.createCalendar(“Apollo 11 Landing”);
      cal.createEvent(‘Apollo 11 Landing’,…

      • Tom says:

        Well that didn’t work…been trying things all day but no luck so far.

        This syntax creates a new calendar every time an event happens it doesn’t use an existing calendar.

        Still trying to get this to populate something other than the default calendar. I need it to use an existing calendar so I can setup the SMS alerts. If the script creates a calendar the SMS alerts are not in effect on the calendar so all I get so far is a line in the sheet, no calendar entries and no alerts.

        I’m still working on it…let you know if I get it to work.

        • If you want to retrieve an existing calendar get like this:

          var cal=CalendarApp.getOwnedCalendarsByName(“Apollo landing”)[0];

          • Tom says:

            Well still doesn’t work.

            I’ve tried:
            var cal = CalendarApp.getCalendarsByName(‘WebsiteMonitor’);
            and
            var cal=CalendarApp.getOwnedCalendarsByName(“WebsiteMonitor”)[0];

            If I do use the createCalendar it does create a calendar but it creates a new one for every event so that doesn’t out either.

            Other sites / blogs have suggested using the Calendar ID but I can’t figure out how to get the ID. I suppose the ID is in the settings but heck if I can find it.

            Any more suggestions?

          • Tom says:

            I finally got it working, starting on line 87 I changed it to the following:

            CalendarApp.getCalendarsByName(‘WebsiteMonitor’)[0].createEvent( url + ‘ is DOWN’ ,
            new Date(now+30000),
            new Date(now+30000)).addSmsReminder(0);
            else

            CalendarApp.getCalendarsByName(‘WebsiteMonitor’)[0].createEvent( url + ‘ is UP’ ,
            new Date(now+30000),
            new Date(now+30000)).addSmsReminder(0);

            And that works. Making all the var statements didn’t work so I thought what if I just spell it all out and bam it worked!

            Now if I could just get it to read from Cell F12 to get the name of the calendar that would be even better.

          • That’s great to know!

            You can get calendar name from cell as follows:

            SpreadsheetApp.getActiveSheet().getRange(‘F12′).getValue();

            Please do share and spread the word about this article on social networks. Hope you won’t mind that ;) Cheers!

  47. mochammad rizal says:

    how to delete/disable/remove that function(alert when website is down)?

  48. Tom says:

    Time stamp in spreadsheet is way off from server time.

    I was wondering if anyone else noticed that the line added to the Sheet is way off from the actual time of the event.

    To test this I started monitoring a dev server and turned off httpd, and of course I got an entry but the time is off.

    The entry in the sheet is: 5/8/2014 23:44:49
    I stopped the server at: Thu May 8 14:15:03 EDT 2014

    Why is there around 7:30 of difference?

    Thanks,
    Tom

    • Make sure the polling interval is set to one minute trigger, also set the correct timezone(Tools->script edtior->File->Project properties).

      Note: When I tested the script it was generating alerts instantaneously without any lack.

      • Tom says:

        With your guidance I figured it out.

        I changed the timezone in the script but that didn’t fix it.

        The change that fixed it was to change the timezone in the spreadsheet and the script.

        Now times are showing up at the same timezone as the server.

        Thanks for the guidance.

  49. Daniel says:

    I followed the steps as indicated and it sent me text messages every time it indicated the site was up but I never received any emails.

    Since I can receive email on my phone, I decided to leave the phone part out of the steps and now I receive notifications from Google that the email is invalid.

    This script doesn’t require a gmail for the email address does it? In either case, what can I do to fix this issue?

    Thanks.

    • Daniel,

      Enter valid email id in cell F8. Then select Tools->script editor, go to line 95 and remove two slash and save it(CTRL + s). And start over as you did before now you will receive sms as well as email alerts.

      Please do share this article on social networks if it helped you out. Cheers!

      • daniel says:

        I am now unsure if it is working. As I had posted yesterday, I started over from scratch.

        This morning I received two notifications from Google Apps Script (one covering the time span from 1PM June 30 to 2AM July 1 the other from 3AM June 30 to 2AM July 1). In these notifications it says
        “invalid email: [lists the same one of the 4 urls] (line 95, file “IS website down – Techawakening.org”) Count 44.

        I looked at the spreadsheet and for the first and last URL I am monitoring it says: Exception: Unexpected error: [URL] then the next cell has -1. The next row is time dated 2-3 minutes after, has the same URL says up and the last cell has 200.

        I am at a loss, other than reducing the URLs to monitor from 4 down to the one I am currently mainly interested in monitoring.

        NOTE: I elected to bypass setting up the mobile and google calender notification as I can receive emails 24/7 so I only need an email notification.

  50. Daniel says:

    Thanks,

    I deleted the entire spreadsheet I had been using and recreated it from your copy above (bypassing the mobile setup step as I do not need the sms messages). I will likely find out tomorrow if it worked.

  51. Centrifuga says:

    Is it right that Google allow a maximum number of calls per day?
    Thanks,
    Sara

  52. Yesu Raj says:

    Hin Shanmuga Sundram,

    First of all very much thanks for posting your scripts. I have configured the same for my website http://www.fundawn.com and http://www.blessmegod.org

    For testing I made my site down http://www.blessmegod.org then I got immediately SMS alert but I didn’t get Email alert and the site down messages are not updated in Google Sheet.

Trackbacks For This Post

  1. What Happens at Google When You Gets your Site Down

Leave a Comment Here's Your Chance to Be Heard!

*