I am looking for a way to use God to monitor a number of servers. In addition to the standard running god on each server, I wanted to setup an external machine to watch each server in the pool (as well as the external address).
After some tweaking I got something that looks like this: ["http://internal.address/", "http://external.address"].each do | server| uri = URI.parse(server) God.watch do |w| w.name = "httpmon_#{uri.host}" w.interval = 30.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 Few drawbacks to this: * Which will alert me every 30 seconds until the test passes again -- which isn't bad, but not ideal. * `god status` is meaningless for this, as it always shows 'up' Is there a better way to do something like this? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "god.rb" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/god-rb?hl=en -~----------~----~----~----~------~----~------~--~---
