Skip to content

Instantly share code, notes, and snippets.

@pirapira
Created July 14, 2011 13:44
Show Gist options
  • Save pirapira/1082481 to your computer and use it in GitHub Desktop.
Save pirapira/1082481 to your computer and use it in GitHub Desktop.
http server monitor
#! /usr/local/bin/ruby
require 'net/http'
Net::HTTP.version_1_2
begin
r = Net::HTTP.start('example.com', 80) {|http|
res = http.get('/directory/file')
}
rescue
system('echo "NG" | mail -c [email protected] -s "server faillure" [email protected]')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment