Created
October 12, 2012 20:39
-
-
Save thehar/3881374 to your computer and use it in GitHub Desktop.
This file contains 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/bin/env ruby | |
# Wrapper file for smoke check for Pingdom Dashboard | |
require 'rubygems' | |
pwd = File.dirname(File.expand_path(__FILE__)) | |
file = pwd + '/smoke-check.rb' | |
# Path of the WWW page for Pingdom status check | |
result_output = "/var/www/test" | |
loop do | |
# We care what time this runs at | |
puts "Running smoke check @ #{Time.now}" | |
system(file) | |
if $? != 0 | |
puts "Smoke check failed" | |
# Open and write out the status of the smoke check | |
File.open(result_output, "w") { |f| f.write($?) } | |
else | |
puts "Smoke check succeeded" | |
# Again, open and write out the status of the smoke check | |
File.open(result_output, "w") { |f| f.write($?) } | |
end | |
sleep 10 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment