Skip to content

Instantly share code, notes, and snippets.

@csexton
Created February 24, 2009 01:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save csexton/69329 to your computer and use it in GitHub Desktop.
Save csexton/69329 to your computer and use it in GitHub Desktop.
["http://internal/", "http://external/"].each do |server|
uri = URI.parse(server)
God.watch do |w|
w.name = "httpmon_#{uri.host}"
w.interval = 10.seconds
w.start = "echo 'start'"
w.stop = "echo 'stop'"
w.lifecycle do |on|
on.condition(:http_response_code) do |c|
c.host = uri.host
c.path = uri.path
c.port = uri.port
c.code_is_not = 500
c.notify = 'dev'
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment