Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
["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
You can’t perform that action at this time.