-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
63 lines (50 loc) · 3.05 KB
/
README
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Automated Process Reaper for Unix Systems
Satan does just one thing, and one thing only; kill processes. Satan was designed to work with Solaris’ SMF self-healing properties. Let Satan kill while SMF revive. The Satan name is a play off of the God Monitor http://god.rubyforge.org/
The reason Satan was developed was because God overlaps too much in functionality with SMF so it is not practical to run on Solaris.
Features
- No dependencies aside from Ruby
- Email notification on reaped processes
- Easy to use DSL to define reaping rules
- HTTP checks to reap based on non-200 response code
INSTALLATION
- Install satan on your run path: /opt/bin;/opt/sfw/bin;/usr/bin
- Edit satan.smf to your liking and import: svccfg import satan.smf
HOW TO USE
- /opt/bin/satan ~/satan.cfg
OR
- via SMF, see installation block.
The configuration is all done in Ruby, clean and simple.
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