I used a previous version of this free monitoring tool, but I recently setup their new version. It is quite neat. Basically, it uses Google’s infrastructure to constantly hit your website and if it doesn’t get a 200 status back, it will contact you via email or SMS saying your site is down. While this was nice, I really wanted to use Pushover more. So I looked through their API and discovered it is very easy to send messages. So I modified their script and now I get notifications via Pushover. Here are the changes that you need to perform.
- Add two new rows after the SMS notifications row.
- Call the title’s what you want, but I went with “Pushover API Token ::” on A5 and “Pushover User Key ::” on A6.
- I created a new Pushover app
- I put the new app’s API token in B5 and my user key in B6.5. Go to Tools | Script editor…
- Then add the following code to the
function logMessage(url, message)
funtion in the script after the email portion:
if (sheet.getRange(“B5”).getValue() != “”){ var options = { ‘method’: ‘post’ }; var url = ‘https://api.pushover.net/1/messages.json?’ + ‘token=’ + sheet.getRange(“B5”).getValue() + ‘&user=’ + sheet.getRange(“B6”).getValue() + ‘&message=’ + alert + ‘&title=’ + “Site ” + message; var response = UrlFetchApp.fetch(url, options); }
No responses yet