The only issue that I had with Amit’s script is that he only supports one website per spreadsheet. So to keep track of ALL of your sites, you might end up making 15 spreadsheets. Well, most of the people on his blog post were already clamoring for a multisite version and I figured I’d try my hand at making a script that would satisfy these requirements.
StalkMySite is my heavily modified version that allows for keeping track of all of your sites’ uptime, no matter how many sites you need to keep tabs on. My script reads all of the URLs that you enter, along with an email address for each site, then loops through all the data, checks each URL to see if it’s up and then if it encounters an error, it logs the error and reason into the spreadsheet, then shoots off an email. All of this is automated by enabling script triggers that let you choose how often you need updates, from as often as every minute to every week.
How To Setup StalkMySite
It’s pretty easy. If you haven’t already created a Google Docs account, you can do so here. If you already have an account, then start by making a copy of the StalkMySite spreadsheet into your own Google Docs repository. After that, you should be in your own repository, looking at the spreadsheet.
Edit: In doing some research on this script and through the Google Docs API, the sendMail function natively supports multiple recipients. In your own spreadsheet, simply add your multiple email addresses, comma-separated and that is all you need to do. Cool!
Next, under the Events section, click on the dropdown and select “Time-driven”. The next two dropdowns to the immediate right will let you select the interval of time. Again those range from on the minute to by the week. Go ahead and choose how often you want it to check your sites. (NOTE: I have mine currently set to every 5 minutes. As this is still in the testing phase, I want to do it more frequently, but may dial my interval back in the future.)
Finally click on the save button here and that’s it! Well, kind of. You may receive a pop-up warning about not being the author of this script and the potential security hazard that poses. This is a standard Google disclaimer to protect the user from doing something stupid. Don’t worry though, this script is 100% legit and all you have to do is click through the prompt to allow access.
SMS Messages with StalkMySite
In today’s world of mobile technology, everybody is on the go and if you’re one of us “lowlifes” that doesn’t have push notification of email on your phone, you may have to wait an entire 5 (FIVE!!! *gasp*) minutes to get the email message saying your site is down. Well, perhaps you want it faster than that? As long as you have a cell phone and understand how sending SMS through email works, then you should be good to go.
I’ve included below a list of some of the most popular carriers and how their email-to-SMS addresses work. For most of them, you simply put the phone number with no dashes ahead of the “@” symbol with the carriers default email domain afterwards. Some require the use of the country code and some do not. Have a look:
* This should go without saying, but replace “1234567890″ with your own phone number.
Alltel – firstname.lastname@example.org
AT&T – email@example.com
Boost – firstname.lastname@example.org
iWireless – email@example.com
Nextel – firstname.lastname@example.org
Sprint – email@example.com
T-Mobile – firstname.lastname@example.org
Verizon – email@example.com
Virgin Mobile – firstname.lastname@example.org
US Cellular – email@example.com
If you know of any other carriers that you’d like to list, post ‘em in the comments.
Personally, I think this script is great. We no longer have to pay a third party site to ensure that our websites are up and running since this is 100% free. However, I’m wondering what the Terms of Service of some shared hosting accounts would think about this or even what Google thinks about it. It’s a simple request with a minimal packet size that is being sent to your server, but what if you’re a hosting company and everybody on their servers had multiple sites that they were doing this to? Would that go noticed and then subsequently banned from being allowed by hosting providers?
Chances are, probably not (and I really hope not!). I think that if StalkMySite is used properly it can be a useful preparedness tool that can keep you, the responsible webmaster, on their toes and ready to go. One thing that I would recommend doing if you run a multisite install like we do here at Frontera, is only set this up on your primary domain. Since all of the subsites that you run on a WP Multisite Network all point to the same IP address anyway, if your primary goes down, they should all go down.
As an example, say you run 10 sites all on one install of WordPress. Your primary site has an IP address of 192.168.1.118 (yes I know that’s an internal IP, it’s just for educational purposes…) and you read my article on how to setup multisite domain mapping, so you currently have all 10 of those domains mapped. If you notice in your hosting providers DNS management console, all of your domains should have an IP address of 192.168.1.118. Don’t believe me? Ping each site and see what IP the name translates to. If it isn’t 192.168.1.118, then I have bad news; your multisite mapping isn’t setup properly.
So why ping 192.168.1.118 10 times every minute to check your sites when you know that if you lose one, you’ll lose them all? The answer is, “don’t”. Just ping your primary and call it a day.
Some Final Things To Note