Skip to content

Instantly share code, notes, and snippets.

@thehar
Created October 12, 2012 20:39
Show Gist options
  • Save thehar/3881374 to your computer and use it in GitHub Desktop.
Save thehar/3881374 to your computer and use it in GitHub Desktop.
#!/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