Skip to content

emails you a report if a web page indicates that a service is down or has not been running

License

Notifications You must be signed in to change notification settings

dwinston/itsdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

itsdown

emails you a report if a web page indicates that a service is down or has not been running

  1. Supply a URL

  2. Supply a function that, given a BeautifulSoup object as input, decides whether the service is down and outputs a useful message. There are some provided in itsdown.functions -- you supply a function on the command line as a dotted path.

  3. If the service is down, email someone with the message, with a link to the URL, and with the page output attached to the email.

Installing

git clone [email protected]:dwinston/itsdown.git
cd itsdown
pip install -e .
cp itsdown/config.example.ini itsdown/config.ini
# Edit itsdown/config.ini to reflect your email service SMTP information.

Usage Example

python itsdown/main.py \
    --url "https://structpred.dash.materialsproject.org/report/hours/24/" \
    --fn "itsdown.functions.fwsdash_24hr" \
    --to [email protected]

Advanced installation

In addition to the above, you can use Celery to run reports in a crontab-like manner.

You'll need to install RabbitMQ (Celery's recommended so-called "data broker"):

# Ubuntu/Debian?
sudo apt-get install rabbitmq-server
# Docker?
docker run -d -p 5462:5462 rabbitmq
# Homebrew?
brew install rabbitmq

Usage Example

Start the RabbitMQ server:

# For example, if you use `brew install` on a Mac, this will ensure rabbitmq starts now and on system restarts.
brew services start rabbitmq

Start the Celery server:

celery -A itsdown.tasks worker -l info

(Under construction) Use celery.schedules.crontab to do great things!

About

emails you a report if a web page indicates that a service is down or has not been running

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages