Skip to content

Commit

Permalink
added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Allyn Treshansky committed Apr 4, 2016
1 parent fc10195 commit d334d48
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
# check_sites
simple python script for checking whether websites are up

uses 2 simple configuration files:
* "check_sites.conf": specifies the email settings to be used
* "check_sites.json": specifies the sites to check

takes 2 arguments:
* -f <file>: specifices the path to "check_sites.json"
* -v: specifies "verbose" mode (in non-verbose mode, an email is only sent if any sites DO NOT return a status code of 200)

best used w/ cron to check a set of websites automatically
2 changes: 2 additions & 0 deletions check_sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def usage():
try:
request = urllib2.urlopen(site["url"])
code = request.code
# if you wanted to add more logic or fine-grained detail to the log
# here is where you would do it; using a bunch of if statments on 'code'
site.update({
"code": code,
"up": True,
Expand Down

0 comments on commit d334d48

Please sign in to comment.