Hacker News new | past | comments | ask | show | jobs | submit login
Monitor your Website’s Uptime with Google Docs (labnol.org)
195 points by blueatlas on Oct 1, 2013 | hide | past | favorite | 51 comments



A cautionary tale: I was using this script for a while. Then Google Docs had some sort of freakout, and began sending me hundreds of "your site is down" emails, even after I tried to terminate the script and even deleted the document from my Google Drive. A few days later, the script finally terminated and the messages stopped.


It still annoys me, so I created a filter and it fills up that label now. No more inbox annoyance atleast.


figured something like this would happen. Docs is not meant for this purpose. It's a cool hack and all but I'd expect issues at some point


AppsScript in general should not be used for production purposes, or anything that depends on timely and consistently responses. Even Google will tell you this (and they provide no SLA on AppsScript for enterprise customers, either). That said, it's still a lot of fun to play with, and there are all sorts of useful things you can do with scripts anyway.


Wow.

To paraphrase Babbage, I cannot apprehend the confusion of ideas which could lead someone to think this is a good idea.


I've been using this for about six months now and it works great. Is there something bad about this that we should all know?


"Bad" is probably a strong word. But issues are:

1. Reliance on Google Docs' uptime. While any monitoring service will in theory present the same problem, you're putting all your eggs in one basket.

2. It's just the wrong tool for the job. Install and learn Nagios or Zabbix or what-have-you. If you're worried about uptime, get a couple VPSes from different providers and run your monitors from both.

There's nothing utterly horrifying about it technically, but I just can't imagine how one comes up with this answer to the question of monitoring services.


Ok, but as you pointed out, #1 is just as bad as using any other single provider (which isn't implied or suggested anywhere here). I disagree with #2. The results are pretty nice, and they're accessible through Google Docs, which is great for sharing with co-workers who aren't in IT.

For what it's worth, Google Docs isn't our only monitoring system. We use Munin as our primary monitoring tool, but this is a nice addition to that.


Ahh, this is different. I'll admit to thinking it's strange, but not insane. Sorry for the quick judgment.


Funny you mention this because we use Nagios to monitor the availability of Google apps (Drive & Gmail mostly) and I get a false positive about once a fortnight. It's proven much more helpful to just monitor HN/Reddit or Twitter to figure out when there's an outage.


Do you make API calls, or just grab web pages? I've noticed the Google APIs seem to occasionally return errors for no apparent reason. You could try double-trying in your Nagios check.

It's also complicated by Google's infrastructure — services are scattered across many, many servers, and Google's outages tend to be on some subset of services and/or servers. Your Nagios checks are probably not always checking the same endpoint as users connecting.


I faced a issue because of which I am not able to stop the monitoring now.

And its very unreliable. So it spams me despite all my efforts to remove it.

I finally made a new filter and archive all notifications.


Right, like which product manager decided it was a good idea to add a website monitoring feature into document software.


You do realize that this is not a feature of Docs and no "product manager" had anything to do with it, right? Somebody wrote an app script that uses the URLFetchApp.fetch function.

By the way, Microsoft Office has, at various times, contained a flight simulator, a pinball game, and a first-person shooter.

http://en.wikipedia.org/wiki/Easter_eggs_in_Microsoft_produc...


Oh no I did not realize that. Thanks!


Yes, this is probably the real issue.


I've used it and it is pretty mediocre or at times just inaccurate. I get so many false alerts from Google about the site being down that I've turned it off.

As another comment puts it, it's just the wrong tool for the job.


I've used a modified version of the script for over a year now and was able to determine unreliable sites with it. Of course there can be temporary server issues and when you try to access the site it works again.

The script I wrote checks multiple sites in one go and sends one mail per script execution, if there are errors. I found that more manageable, the code for it is on GitHub https://github.com/yaph/sitemonitor


I just set this up. Works great! I recommend you run it once from the Run menu to make sure you entered a domain name correctly. You can comment out this line to get an email every time it runs (good for testing):

    // if (status !== 200)


I highly recommend http://www.uptimerobot.com which is a free tool. You can monitor up to 50 sites with 5 min intervals. Very useful email notifications specifying how much time your site was unavailable.


+1 for Uptimerobot. I've used it for 2 years or so now and it works great.


Why not just use Pingdom which is designed for that?

One thing Docs is good for though is building custom dashboards on a $0 budget. We've got one at https://starthq.com that shows our key metrics and graphs cohorts for the last few weeks.


I'd be interested to know more about what you did with dashboards using Docs.


We created a simple API which gives us data ranges such as

- /:start/:end - number of users registered within date range

- /:start/:end/active - number of users registered within date range who were active within last week

etc. etc.

Then it's pretty straightforward to use ImportData & CONCATENATE, as well as fill down to create a matrix of cohorts, which can in turn be graphed.

In general it's best to pull in the raw data with ImportData and then calculate percentages and such in the spreadsheet. The latter are updated when the cells they reference refresh.

Docs refreshes ImportData sources once every hour, caching them in between, so the load on the server and DB is minimal and you end up with more or less current stats.


Any chance you could email me to discuss? My email is in profile. Or PM on twitter if you prefer?


No email in your profile. Messaged you via Twitter.


Doesn't pingdom allow only one site on their free plan? One benefit of this method is the ability to monitor all your sites.

No, scratch that. You get 10 "checks" with pingdom free.


details?


This is awesome, in the sense that I am in awe that google lets you do this. Could you create a shareable doc to create a google powered DDOS of a site? Hypothetically, of course.



Interesting read. Also, good on Amazon for the P.S at the end: "Amazon was nice enough to refund the bandwidth charges [...] as they considered this activity accidental and not intentional."


In my experience all HTTP requests made from Google Docs functions and scripts are cached for at least a few minutes. There are workarounds to that but I would guess they do throttling at an IP and domain level as well (being that they know a thing or two about crawling the web).


The script

http://ctrlq.org/code/19319-website-monitor-script

iterates through the URLs in the spreadsheet and for each invokes

https://developers.google.com/apps-script/reference/url-fetc...

which can accept parameters for a URL.

If those GET requests initiate intensive processes, then there could be a problem.


I'm pleased to see people showing off what you can do with Google docs. I think most people (and even most developers) totally underestimate what's possible with Google Apps Script.

A great example of what is possible using Spreadsheets to do live dashboards and analysis of site data. If you use Heroku you can pump data directly from Heroku Dataclips into a Google spreadsheet using a live CSV URL and then analyse, munge and display it however you like.

Apps Script can both consume send data to other web services so coupled with Heroku Dataclips or Chartio.com it's super powerful. It's a great way to skip a lot of UI work or even for someone with business savvy but no official programming skill to get directly into their database and spelunk around.


This is pretty cool. The google calendar event to create texts seems like a hack though (even more-so than the rest of it). Is there any reason this couldn't just use the SMS gateways that pretty much every carrier offers?


I have tested this in the past, and a few clients on the service I launched last year (https://servercheck.in/) have also reported the same: Google Docs is unreliable at best. Besides false positives, there were at least two or three outages (sometimes for an hour or more) unreported.

Google Docs is not meant to be a status monitoring tool. Use the right tool for the job; there are plenty of free and cheap alternatives that do things much better, are more reliable, and save you setup and maintenance time.


I wrote something like this a few months ago.

Depending on Google Spreadsheet for uptime monitoring is nothing more than just a fun hack. I'm surprised that some people here are taking it so seriously. If you're using a script like this, then I hope it's just to keep those single dynos from falling asleep :)

It's also subject to Google Docs availability, my script sometimes fails to run with only a "We're sorry, a server error occurred. Please wait a bit and try again." email notification.


I've hacked something similar with ethercalc (npm install ethercalc) and you should too because you never know when google will sunset your favorite feature..

(RIP reader)


Interesting spreadsheet hack, but it's just looking for a 200 response. I use Pingdom, which allows you to look for specific content in the response, even on the free plan. It's a better guarantee that the page rendered successfully end-to-end.


I would love to use this, but the app wants access to all of my spreadsheets at any time. It looks like I'll need to set up a dummy Google account first.

It looks really cool.


Noon question: couldn't you just write a simple script to do the same thing and set up a cron job on a free hosting service like GApps instead?


You're checking for a status 200, but what about sites that use 301 redirects or proxies?


If you're using it to check your own site, presumably you know what the target of any 301 is beforehand, and can aim at that URL in the first place. Even if you're using a proper monitoring system, why force your server to handle twice the number of requests than it needs to?


It still blows me away when I go to a root domain and get redirected to example.com/home or something similar. Or sites that append slashes to all URLs, but the content links to the slash-less copy, forcing every click to hit the server twice. Gah!


Love it - there is something very nice about having to setup a site monitor in a minute..


I really like this solution. Makes monitoring a BUNCH of sites really, really easy.


um. i'm curious why using this results in a high false positive rate. google docs has dodgy connectivity??? would checking if yahoo.com is up first, before checking each url, reduce the false positives?


I was held back by the amount of permissions it requires


Why exactly does need this app access to all my data at google?

Scary


You're asking for a lot of permissions, huh? ... Why you need to Manage my calendar ?


I assume because, AFAIK, SMS notifications are handled by Google Calendar. So to give you the warning it makes an event with an SMS reminder that contains the warning as its topic




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: