Skip to content

Commit

Permalink
Tabs to spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Wright committed Apr 3, 2012
1 parent 76c975d commit baf5db8
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions scripts/monitor.py
Expand Up @@ -3,36 +3,36 @@
from daemonwatch import * from daemonwatch import *


def run_monitor(url=None): def run_monitor(url=None):
Monitor( Monitor(
Service( Service(
name="cbu-ensure-up", name="cbu-ensure-up",
monitor=( monitor=(
HTTP( HTTP(
GET=url, GET=url,
freq=Time.ms(5000), freq=Time.ms(5000),
fail=[ fail=[
Incident( Incident(
errors=1, errors=1,
during=Time.s(5), during=Time.s(5),
actions=[ actions=[
Print("%s experienced an error") Print("%s experienced an error")
] ]
), ),
Incident( Incident(
errors=2, errors=2,
during=Time.s(10), during=Time.s(10),
actions=[ actions=[
Print("%s experienced 2 errors within 10 seconds") Print("%s experienced 2 errors within 10 seconds")
] ]
) )
] ]
) )
) )
) )
).run() ).run()


if len(sys.argv) == 1: if len(sys.argv) == 1:
sys.exit("Please specify a URL (be sure to include a trailing slash): python monitor.py http://yourhost/") sys.exit("Please specify a URL (be sure to include a trailing slash): python monitor.py http://yourhost/")


run_monitor(sys.argv[1]) run_monitor(sys.argv[1])

0 comments on commit baf5db8

Please sign in to comment.