lonbaker (owner)

Fork Of

Revisions

  • 51e4e8 Mon Feb 23 17:55:40 -0800 2009
gist: 179609 Download_button fork
public
Public Clone URL: git://gist.github.com/179609.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
["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