-
-
Save donovanbray/920553 to your computer and use it in GitHub Desktop.
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/bin/ruby | |
# Pingdom_http_custom_check | |
# DFF - 2011 | |
# put this in {Apache Files}/cgi-bin/ | |
# make sure to chmod +x the file | |
# Your ruby interpreter might not be where mine is. Check the above. | |
# | |
require 'cgi' | |
too_old=360 | |
#Get modification time: | |
age_in_seconds = (Time.now - File.mtime('APACHE_CONTENT_DIR/FILE_TO_TIMESTAMP')).to_i | |
cgi = CGI.new('html3') | |
cgi.out do | |
cgi.out { "<pingdom_http_custom_check>\n\t<status>#{ age_in_seconds < too_old ? 'OK' : 'ERROR' }</status>\n\t<response_time>#{age_in_seconds.to_s }</response_time>\n</pingdom_http_custo | |
m_check>" } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment