-
Notifications
You must be signed in to change notification settings - Fork 2
/
satan.cfg
37 lines (34 loc) · 2.16 KB
/
satan.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Satan.watch do |s|
s.name = "jvm instances" # name of job
s.user = "webservd" # under what user
s.group = "webservd" # under what group
s.deamon = "java" # deamon binary name to grep for
s.args = nil # globally look for specific arguments, optional
s.debug = true # if to write out debug information
s.safe_mode = false # If in safe mode, satan will not kill ;-(
s.interval = 10.seconds # interval to run at to collect statistics
s.sleep_after_kill = 1.minute # sleep after killing, satan is tired!
s.contact = "[email protected]" # admin contact, optional if you want email alerts
s.kill_if do |process|
process.condition(:cpu) do |cpu| # on cpu condition
cpu.name = "50% CPU limit" # name for job
cpu.args = "jetty" # make sure this is a jetty process, optional
cpu.above = 48.percent # if above certain percentage
cpu.times = 5 # how many times we can hit this condition before killing
end
process.condition(:memory) do |memory| # on memory condition
memory.name = "850MB limit" # name for job
memory.args = "jetty" # make sure this is a jetty process, optional
memory.above = 850.megabytes # limit for memory use
memory.times = 5 # how many times we can hit this condition before killing
end
# ActiveMQ tends to die on us under heavy load so we need the power of satan!
process.condition(:http) do |http| # on http condition
http.name = "HTTP ActiveMQ Check" # name for job
http.args = "8161" # look for specific app arguments
# to associate app to URI
http.uri = "http://localhost:8161/admin/queues.jsp" # the URI
http.times = 5 # how many times before the kill
end
end
end