Created
July 14, 2011 13:44
-
-
Save pirapira/1082481 to your computer and use it in GitHub Desktop.
http server monitor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /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