Coder Social home page Coder Social logo

cunningdj / site-checker Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 3 KB

Website serving checker. Alerts via email. Any number of websites, and set the checker interval.

JavaScript 100.00%
interval nodemailer smtp daemon oauth ping site-checker nodejs request

site-checker's Introduction

Site Checker

Checks the websites every interval, and sends an email for any websites that are down (status 404 from a GET request on the given url).

Instructions

  1. Run npm install in the command line to install the dependencies
  2. Copy the json files from src/templates/ to src/.
  3. Set up a Gmail (or whichever smtp host) smtp key in Gmail. See Nodemailer and Gmail for instructions (link in notes).
  4. Add the Gmail app key to auth.json
  5. Fill in the other values in the .json files.
    • Any number of websites can be added to sites.json
  6. Run the src/checker.js script with a daemon tool like forever or pm2.

Notes

  • If the interval time is very small and a website goes down, you'll get a lot of emails in a short time. Take this into account when deciding an interval time. I've found every 15 minutes to be a reasonable interval for my websites.
  • This daemon process lends itself well to a low power server device like Raspberry Pi, or any server you currently have running 24/7.
  • The base email functionality is in Nodemailer. See the OAuth2 page for help or retooling.

site-checker's People

Contributors

cunningdj avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

site-checker's Issues

Read configuration from environment variables

It would be nice if this was set up to read configuration values differently depending on if it is used in development vs production. We use Heroku for a lot of our New Leaf Digital projects. So being able to read from environment variables for the production setup would be nice. Not sure how you'd tell which is set up the app is in. Maybe a JSON file with a property and the value is set to either development or production. Then you just read that to know where to pull the values from. What do you think?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.