A simple Ruby script to pull a URL, search for a string, and log the result to a CSV file.
ruby simple-site-monitor.rb --site=URL --pattern=pattern --log=log-file
ruby simple-site-monitor.rb --site=https://google.com --pattern=body --log=log.csv
I use a cron job to run the program every five min.
*/5 * * * * /usr/bin/ruby ~/simple-site-monitor/simple-site-monitor.rb --site=https://google.com --pattern=body --log=google-uptime.csv
We needed a method for monitoring uptime of a mission critical app that is hosted on the internal network. Uptime monitoting services would not work because the app is only accessable from the inside.