Code Monkey home page Code Monkey logo

website-monitor's Introduction

website-check

A simple stand-alone Web service for monitoring websites

The code is runnable as a stand-alone Web server.

Dependencies

  • Python 2.7
  • web.py python module
  • python requests

Installation

  1. Get the code
  2. Install web.py pip install web.py
  3. Install requests pip install requests

Configuration

Set the following variables in website-check.py

  1. poll_interval (how often each site should be checked)
  2. max_fails (maximum number of times a site can fail the check before email notification
  3. gmail_user = '' (your gmail email address)
  4. gmail_pwd = '' (your gmail password)
  5. recipients = ['[email protected]', '[email protected]'] (who email should be sent to)

You can also use a smtp server other than gmail. Just set the values appropriately and see Python's smtplib documentation for more details.

Run

There are two options: either specify URLs and assertion strings at runtime (use "" for no assertion), or specify a text file that contains comma separated URLs and assertion strings.

  1. python website-check.py port "site1" "assert1" ["site2" "assert2" ... ]
  2. `python website-check.py port servers.txt

Sample servers.txt

http://www.google.com,I'm feeling lucky
http://www.yahoo.com,Yahoo
http://www.bing.com,

Navigate to http://localhost:port to view...

website-monitor's People

Contributors

kylemarkwilliams avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

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.