POC simple HTTP monitoring script. First build the docker images:
git clone [this-gist] monitor
cd monitor
docker build -t amirkdv/monitor .
Now start the container, and all sites under sites.yaml
will be pinged one
after another:
docker run -i -t amirkdv/monitor
# Example 1 (immediate 200):
# connecting to http://www.bbc.co.uk/
# final HTTP code: 200
# ---> UP
# Example 2 (DNS resolves, but site is down):
# connecting to http://muhc-dev.tree.ewdev.ca/
# Timeout
# ---> DOWN: sending e-mail to admin@example.com
# Example 3 (DNS does not resolve):
# connecting to http://nonexiting.muhc.ca
# Timeout
# ---> DOWN: sending e-mail to admin@example.com
# Example 4 (requires redirection to get to 200):
# connecting to http://google.ca
# redirecting (HTTP code: 301)
# final HTTP code: 200
# ---> UP
# Example 5 (URL contains query):
# connecting to http://reuters-demo.tree.ewdev.ca:9090/reuters/select?q=a
# final HTTP code: 200
# ---> UP
# Example 6 (URL contains illegal query resulting in 403):
# connecting to http://reuters-demo.tree.ewdev.ca:9090/reuters/
# final HTTP code: 403
# ---> DOWN: sending e-mail to admin@example.com
# Example 7 (HTTP basic auth):
# connecting to http://sync-dev.tree.ewdev.ca
# final HTTP code: 200
# ---> UP
# Example 8 (HTTP basic auth, invalid credentials):
# connecting to http://sync-dev.tree.ewdev.ca
# final HTTP code: 401
# ---> DOWN: sending e-mail to admin@example.com