Skip to content

Instantly share code, notes, and snippets.

@csexton
Created February 24, 2009 01:55
Show Gist options
  • Save csexton/69329 to your computer and use it in GitHub Desktop.
Save csexton/69329 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Feb 24, 2009.
    20 changes: 20 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    ["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