Бесплатный мониторинг доступности вашего сайта с SMS-уведомлением

В данной заметке я расскажу о способе мониторинга доступности вашего сайта, используя Google Docs и Google Calendar. В данном решении мы будем получать уведомления не только по почте, но и через SMS. Идея этого способа состоит в том, чтобы создать в Google Docs скрипт, который при возникновении проблемы будет создавать в календаре событие. А , поскольку, Google Calendar имеет возможность присылать SMS сообщения, то проблем в принципе не возникнет.

website-monitor-sms

Итак, если у вас еще нет аккаунта от сервисов Google, то самое время создать его. Далее по шагам:

  1. Скопируйте в ваш Google Docs следующий документ. Для этого просто кликните по ссылке.
  2. Отредактируйте поля Website URLs, Email Address, и в поле SMS введите yes.
  3. После этого в верхнем меню произведите инициализацию и запуск скрипта: WebSite Monitor->Initialize, WebSite Monitor-> Start.
  4. И последним шагом необходимо в Google Calendar привязать свой номер телефона к календарю. Для этого в Google Calendar зайдите в Настройки -> Настройки для мобильных устройств и привяжите номер телефона. После этого у вас появится страница с дополнительными настройками. В ней вы должны поставить галку напротив поле Новые мероприятия.

На этом настройка закончена и в случае, если сайт будет лежать вы получите уведомление и на почту, и посредством SMS.

Исходный код Google-скрипта:

/*

   Website Monitor HD by Digital Inspiration   
   =========================================  

*/

function init() {  
  if (ScriptApp.getScriptTriggers().length == 0) {
    // Set up a monitor that triggers every 5 minutes
    ScriptApp.newTrigger("websiteMonitor")
      .timeBased().everyMinutes(5).create();
  }  
}

function websiteMonitor()
{ 
  var response, error, code, urls;

  // The script can monitor multiple website URLs (comma separated) 
  urls = SpreadsheetApp.getActiveSheet().getRange("B2").getValue();
  urls = urls.replace(/\s/g, "").split(",");

  for (var i=0; i<urls.length; i++)="" {="" var="" url="urls[i];" if="" (!scriptproperties.getproperty(url))="" scriptproperties.setproperty(url,="" 200);="" }="" trying="" to="" connect="" the="" website="" try="" response="UrlFetchApp.fetch(url);" catch(error)="" urlfetchapp="" fails,="" site="" is="" probably="" down="" updatelog(url,="" -1);="" continue;="" code="response.getResponseCode();" code);="" function="" code)="" (scriptproperties.getproperty(url)="=" return;="" sheet="SpreadsheetApp.getActiveSheet();" row="sheet.getLastRow()" +="" 1;="" time="new" date();="" msg="Down" ;="" (code="=" 200)="" "="" url;="" sheet.getrange(row,1).setvalue(time);="" sheet.getrange(row,2).setvalue(msg);="" send="" an="" email="" notification="" when="" status="" changes="" mailapp.sendemail(email,="" msg,="" url);="" now="new" date(time.gettime()="" 10000);="" create="" event="" in="" google="" calendar="" with="" sms="" reminder="" (sheet.getrange("b4").getvalue().tolowercase()="=" "yes")="" calendarapp.createevent(msg,="" now,="" now).addsmsreminder(0);="" *="" published="" by="" amit="" agarwal="" on="" 09="" 14="" 2012="" <="" pre="">

97 комментариев к “Бесплатный мониторинг доступности вашего сайта с SMS-уведомлением

  1. A motivating discussion is worth comment.
    I do think that you need to write more on this
    issue, it might not be a taboo matter but typically people don’t discuss
    such issues. To the next! Many thanks!!

  2. Hello There. I found your blog using msn. This is a very well
    written article. I’ll make sure to bookmark it
    and return to read more of your useful info. Thanks for
    the post. I’ll certainly comeback.

  3. Excellent goods from you, man. I have understand your stuff previous to and you’re just extremely fantastic.
    I really like what you have acquired here, certainly like what you are saying and the way in which you say it.
    You make it enjoyable and you still care for to keep it sensible.

    I can’t wait to read much more from you. This is actually
    a tremendous site.

  4. An intriguing discussion is definitely worth comment. I think that you should publish more on this subject, it may not be a taboo matter but usually people do not discuss these topics. To the next! Cheers!!|

  5. I’m amazed, I have to admit. Seldom do I encounter a blog that’s both equally
    educative and engaging, and let me tell you, you have hit
    the nail on the head. The issue is an issue that too few men and women are speaking intelligently about.
    I’m very happy that I found this during my hunt for something regarding
    this.

  6. Hey There. I found your weblog the use of msn. This is an extremely neatly written article. I’ll make sure to bookmark it and return to learn more of your helpful info. Thanks for the post. I will definitely comeback.|

  7. Your style is very unique compared to other folks I’ve read stuff from.
    Thanks for posting when you’ve got the opportunity, Guess I’ll just bookmark this site.

  8. I know this if off topic but I’m looking into starting my own blog and was wondering
    what all is required to get set up? I’m assuming
    having a blog like yours would cost a pretty penny? I’m not
    very web smart so I’m not 100% positive. Any tips or advice would
    be greatly appreciated. Cheers

  9. When I originally left a comment I seem to have clicked
    on the -Notify me when new comments are added- checkbox and now each time a comment is
    added I recieve four emails with the same comment. There has to be a way you are able to
    remove me from that service? Thanks a lot!

  10. Do you have a spam problem on this blog; I also am a blogger, and I was wanting to know your situation; many of us have created some nice practices and we are looking to swap methods with others, be sure to shoot me an email if interested.|

  11. I don’t even know the way I ended up here, but I thought
    this submit was good. I don’t realize who you are but definitely you
    are going to a well-known blogger if you are not already.
    Cheers!

  12. hey there and thank you for your information – I’ve certainly picked up something new from right here.
    I did however expertise several technical points using this website, as I experienced to reload the web site
    a lot of times previous to I could get it to load correctly.
    I had been wondering if your web host is OK?
    Not that I am complaining, but sluggish loading instances times will very
    frequently affect your placement in google
    and can damage your quality score if ads and marketing with Adwords.
    Well I am adding this RSS to my e-mail and could look out for a lot more of your respective fascinating content.
    Ensure that you update this again very soon.

  13. We absolutely love your blog and find almost all of your post’s
    to be just what I’m looking for. Do you offer guest writers to write content
    for you? I wouldn’t mind writing a post or elaborating on many of the
    subjects you write about here. Again, awesome weblog!

  14. Hmm it seems like your site ate my first comment
    (it was extremely long) so I guess I’ll just sum it up what I submitted and say, I’m thoroughly enjoying your blog.
    I as well am an aspiring blog blogger but I’m still new to the whole thing.

    Do you have any tips and hints for beginner blog writers?
    I’d genuinely appreciate it.

  15. Does your site have a contact page? I’m having trouble locating it but, I’d like to shoot
    you an email. I’ve got some creative ideas for your blog
    you might be interested in hearing. Either way, great website and
    I look forward to seeing it improve over time.

  16. Hi there! This post could not be written any better!
    Reading through this post reminds me of my old room mate!
    He always kept talking about this. I will forward this page to him.
    Pretty sure he will have a good read. Thanks for sharing!

  17. It’s perfect time to make some plans for the future and it
    is time to be happy. I’ve read this submit and if I could I wish to recommend you few attention-grabbing things or tips.
    Perhaps you can write next articles regarding this article.
    I want to read even more issues approximately it!

Оставить ответ

Ваш адрес email не будет опубликован. Обязательные поля помечены *