Pingdom not free anymore
-
If you're just looking to monitor whether a site is online you could spin up a very small linux VM, install sendmail, and use BASH to throw together a really simple script that cycles through a list of hosts on a regular interval and fires off an email notifying you when a host is down.
-
This has been wonderful for me. It keeps a nice log of uptime and downtimes as well as emailing you and texting you during outages
http://www.labnol.org/internet/website-uptime-monitor/21060/
-
-
@IRJ said:
This has been wonderful for me. It keeps a nice log of uptime and downtimes as well as emailing you and texting you during outages
http://www.labnol.org/internet/website-uptime-monitor/21060/
Can i upvote your post like x10 times?
Thanks a lot @IRJ
-
We use Alertra. We pay for it but I think that they might have a free option.
-
For a 3rd party external monitor, I am using uptime robot. They have a free version that has some limitations, i.e. scan intervals but I pay for the basic tier and it is really close to free.
-
https://uptimerobot.com/pricing Here is the link if anyone is interested.
-
So I got to thinking about this post and decided to use it as motivation to practice with GIT version control. I built a simple website monitoring application/script that exports site status to a very simple HTML page and availability log. The script is meant to be setup using Cron and the availability log can be parsed to track any periods of downtime. If you're interested in giving it a whirl/critique you can clone it from:
https://github.com/ramblingbiped/simple-site-monitor
*written in BASH for use on debian/ubuntu-based linux distributions.
Thanks for the motivation, it was a great exercise for familiarization with GIT!
-
Really sites that just ping aren't so great at detecting issues. You can have many outages, when a ping will still work. Not saying thats all any of these do, just saying watch out for services that only do that as it really provides you nothing.
-
@Jason said:
Really sites that just ping aren't so great at detecting issues. You can have many outages, when a ping will still work. Not saying thats all any of these do, just saying watch out for services that only do that as it really provides you nothing.
Great point. I can't imagine on relying only on icmp response as a guarantor of any service continuity, for the exact reason you state.
-
@Jason said:
Really sites that just ping aren't so great at detecting issues. You can have many outages, when a ping will still work. Not saying thats all any of these do, just saying watch out for services that only do that as it really provides you nothing.
The script I used doesn't rely on just ping. I am not exactly sure how it works, but I had it tell me my website was down when I could ping the server. There was an issue connecting the wordpress database and a reboot fixed it. If it just did a ping, it never would have caught that issue.
-
@IRJ said:
@Jason said:
Really sites that just ping aren't so great at detecting issues. You can have many outages, when a ping will still work. Not saying thats all any of these do, just saying watch out for services that only do that as it really provides you nothing.
The script I used doesn't rely on just ping. I am not exactly sure how it works, but I had it tell me my website was down when I could ping the server. There was an issue connecting the wordpress database and a reboot fixed it. If it just did a ping, it never would have caught that issue.
The google document looks for a http 200 response. I looked at the script code when i set it up myself. it is a nice little tool.
-
@JaredBusch said:
@IRJ said:
The google document looks for a http 200 response. I looked at the script code when i set it up myself. it is a nice little tool.
Here is the script if anyone is curious.
/** Website Monitor 4.0 by Digital Inspiration **/ /** ========================================== **/ /** Published by Amit Agarwal on 02/14/2013 **/ /** Last updated by @labnol on 12/11/2014 **/ /** Details at http://labnol.org/?p=21060 **/ /** Support: [email protected] twitter: @labnol **/ function init() { removeJobs(true); var sheet = SpreadsheetApp.getActiveSpreadsheet(); var urls = sheet.getActiveSheet().getRange("B2").getValue(); urls = urls.toString().replace(/\s/g, "").split(","); var prop = PropertiesService.getScriptProperties(); for (i=0; i<urls.length; i++) { if (urls[i] !== "") { prop.setProperty(urls[i], 200); } } // Setup trigger that runs every 5 minutes ScriptApp.newTrigger("websiteMonitor") .timeBased() .everyMinutes(5) .create(); sheet.toast("Google Docs will now monitor your website(s). " + "You can exit this sheet!", "Initialized", -1); } function websiteMonitor() { var prop = PropertiesService.getScriptProperties(); var urls = prop.getKeys(); for (var i in urls) { var newStatus = getSiteStatus(urls[i]); var oldStatus = parseInt(prop.getProperty(urls[i])); if (oldStatus !== newStatus) { prop.setProperty(urls[i], alertUser(urls[i], oldStatus, newStatus)); } } } function getSiteStatus (url) { var siteStatus = -1; try { var response = UrlFetchApp.fetch(url, { muteHttpExceptions: true, validateHttpsCertificates: false, followRedirects: true }); siteStatus = response.getResponseCode() === 200 ? 200 : -1; } catch(e) {} return siteStatus; } function alertUser(url, oldCode, newCode) { // Status unchanged if (newCode === oldCode) { return newCode; } // Site was up previously but is now down if ((newCode === -1) && (oldCode === 200)) { quickCheck(); return -2; } // Site was down previously but up on second check if ((newCode === 200) && (oldCode === -2)) { return newCode; } // Site was down previously and is down again if ((newCode === -1) && (oldCode === -2)) { quickCheck(); logMessage(url, "Down"); return newCode; } // Site was down previously but up again if ((newCode === 200) && (oldCode === -1)) { logMessage(url, "Up"); return newCode; } return 200; } function logMessage(url, message) { var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var time = new Date(); sheet.appendRow([time, message + " : " + url]); /* var row = sheet.getLastRow() + 1; sheet.getRange(row,1).setValue(time); sheet.getRange(row,2).setValue(message + " : " + url); */ var alert = "Site " + url + " is " + message.toLowerCase(); MailApp.sendEmail(sheet.getRange("B3").getValue(), alert, getSiteStatus(url) ); if (sheet.getRange("B4").getValue().toLowerCase() == "yes") { time = new Date(time.getTime() + 15000); CalendarApp.createEvent(alert, time, time).addSmsReminder(0); } return; } function secondCheck() { var triggers = ScriptApp.getProjectTriggers(); for (var i=0; i<triggers.length; i++) { if (triggers[i].getHandlerFunction() == "secondCheck") { ScriptApp.deleteTrigger(triggers[i]); } } websiteMonitor(); } function quickCheck() { ScriptApp.newTrigger("secondCheck").timeBased().after(120000).create(); return; } function removeJobs(quiet) { PropertiesService.getScriptProperties().deleteAllProperties(); // Delete all Script Triggers var triggers = ScriptApp.getProjectTriggers(); for (i=0; i<triggers.length; i++) { ScriptApp.deleteTrigger(triggers[i]); } // Inform the user, default is "YES" if (! quiet) { SpreadsheetApp.getActiveSpreadsheet() .toast("The program has stopped. You can choose Start under Website Monitor " + "menu anytime later to resume website monitoring!", "Uninstalled", -1); } } function help() { var html = HtmlService.createHtmlOutputFromFile('help') .setTitle("Google Scripts Support") .setWidth(400) .setHeight(260); var ss = SpreadsheetApp.getActive(); ss.show(html); } function onOpen() { var sheet = SpreadsheetApp.getActiveSpreadsheet(); var menu = [ {name: "โ Help and Support ยป",functionName: "help"}, null, {name: "Step 1: Initialize", functionName: "init"}, {name: "Step 2: Start Website Monitor ", functionName: "init"}, null, {name: "โ Uninstall (Stop Monitor)", functionName: "removeJobs"}, null ]; sheet.addMenu("โช Website Monitor", menu); } // Written by Amit Agarwal [email protected] // Twitter: @labnol
-
This is the important bit
function getSiteStatus (url) { var siteStatus = -1; try { var response = UrlFetchApp.fetch(url, { muteHttpExceptions: true, validateHttpsCertificates: false, followRedirects: true }); siteStatus = response.getResponseCode() === 200 ? 200 : -1; } catch(e) {} return siteStatus; }