XyloSiteMonitor

Update of "XyloSiteMonitor"
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

Artifact ID: 445f9d356b95c0bc0c111690b91cc6cb370439114b1997469aeaa3572837d7c4
Page Name:XyloSiteMonitor
Date: 2018-11-04 15:46:55
Original User: xylon
Parent: 13c428cb6cb2ab19a616e9ee1faf49787f811e1e3f1db202077206b91b66de09 (diff)
Content
XyloSiteMonitor is a single-file python script which tests every permutation of ways your website can be accessed:

Some permutations will result in a page loading. Others may result in a redirect. All permutations need testing.

Websites to be tested are defined in a beautiful YAML format.

It produces a nice report and can pass the report to a local mail-server if you want.

Here's some example YAML, that tests Free Software UK:

- name: Free Software UK
  expected string: Free Software UK
  canonical address: https://www.freesoftwareuk.org.uk/
  urls:
  - url: www.freesoftwareuk.org.uk
    tests:
    - action: return string
      protocols:
        - TLS
    - action: redirect
      protocols:
        - no-TLS
  - url: freesoftwareuk.org.uk
    tests:
    - action: redirect
      protocols:
        - TLS
        - no-TLS

This translates into 8 checks and produces the following output:

IPv4, does "www.freesoftwareuk.org.uk" return string over "TLS"?                                                                                                                                                   
 Test Success!                                                                                                                                                                                                     
IPv6, does "www.freesoftwareuk.org.uk" return string over "TLS"?                                                                                                                                                   
 Test Success!                                                                                                                                                                                                     
IPv4, does "www.freesoftwareuk.org.uk" redirect over "no-TLS"?                                                                                                                                                     
 Test Success!                                                                                                                                                                                                     
IPv6, does "www.freesoftwareuk.org.uk" redirect over "no-TLS"?                                                                                                                                                     
 Test Success!                                                                                                                                                                                                     
IPv4, does "freesoftwareuk.org.uk" redirect over "TLS"?                                                                                                                                                            
 Test Success!                                                                                                                                                                                                     
IPv6, does "freesoftwareuk.org.uk" redirect over "TLS"?                                                                                                                                                            
 Test Success!                                                                                                                                                                                                     
IPv4, does "freesoftwareuk.org.uk" redirect over "no-TLS"?                                                                                                                                                         
 Test Success!                                                                                                                                                                                                     
IPv6, does "freesoftwareuk.org.uk" redirect over "no-TLS"?                                                                                                                                                         
 Test Success!

Summary:                                                                                                                                                                                                           
8 tests passed                                                                                                                                             
0 tests failed

To monitor all 10 of my websites like this means 64 checks. To get this many checks with UptimeRobot would require a Pro plan and it wouldn't allow me to test IPv4 vs 6. Rival service Pingdom can do IPv4 or 6 but this many checks would require an "Advanced" plan for £48 GBP per month!

If you don't like YAML this probably isn't for you because it's wholly based on YAML.

Dependencies are:

To find out the options please run:

./xylositemonitor.py --help

I use it as a cron job on a dedicated monitoring server:

25 5 * * * /usr/local/bin/xylositemonitor.py --annotation 'SiteMonitor daily' --mailto joseph@xylon.me.uk
33 * * * * /usr/local/bin/xylositemonitor.py --annotation 'SiteMonitor hourly' --mailto joseph@xylon.me.uk --email-only-on-fail

This way I get an email every day, usually telling me all tests passed. And there's also an hourly check which only sends an email on error.