urlcheck.rb - Check a list of URLs and send email about it.
- Ruby 1.9+
- Requires the Curb gem
- Copy urlcheck.yml-sample to urlcheck.yml with your own values
- URL list is a YAML array with the url and the response code you expect.
All of the possible options are listed in urlcheck.yml-sample:
settings:
status_file: urlcheck.status # use full path
user_agent: 'https://www.github.com/rhizome'
mail_from: "CHANGE_ME"
mail_to: "CHANGE_ME"
smtp_server: smtp.example.invalid
domain: example.invalid
markers: false
debug: false
urls:
- url: "http://www.yahoo.com"
code: 301
- url: "https://www.yahoo.com"
code: 200
- [...]
$ crontab -e
# */5 * * * * /path/to/urlcheck.rb
By default, no email is sent when checks are successful.
Usage: urlcheck.rb [options]
-c, --config_file FILE Path to YAML config file
-m, --markers Send an email every hour even if successful
-s, --status Outputs OK or FAIL, does not send mail
-d, --debug Always send mail
-h, --help Show this message
Pull requests always welcome.