procmon 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/{README → README.md} +14 -6
- data/lib/procmon/version.rb +1 -1
- data/procmon.gemspec +1 -1
- metadata +6 -6
data/{README → README.md}
RENAMED
@@ -1,7 +1,17 @@
|
|
1
|
-
|
1
|
+
# Procmon
|
2
|
+
Procmon is a process monitor written in Ruby. Concepts and design are based on Bluepill and God, but with emphasis on simplicity and extensibility.
|
2
3
|
|
3
|
-
|
4
|
+
Procmon allows you to check on processes and then perform arbitary actions based on the result of the checks. For example, you can send notification when mem usage is too high, or you can restart a process if it's dead, etc. It is not meant to run as a daemon. It is designed to be invoked manually or via cron.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
It's hosted on [rubygems.org][rubygems].
|
8
|
+
|
9
|
+
sudo gem install procmon
|
10
|
+
|
11
|
+
## Example of how to use Procmon
|
4
12
|
|
13
|
+
```
|
14
|
+
require 'procmon'
|
5
15
|
|
6
16
|
notifier = Proc.new do
|
7
17
|
puts "I NEED TO SEND OUT AN EMAIL"
|
@@ -11,7 +21,7 @@ notifier2 = Proc.new do
|
|
11
21
|
puts "I NEED TO SEND OUT AN SMS"
|
12
22
|
end
|
13
23
|
|
14
|
-
# action
|
24
|
+
# action can be a Proc object. You can define whatever you want to do
|
15
25
|
Procmon.process("Mail") do |process|
|
16
26
|
process.checks :mem_usage, :above => 100.megabytes, :actions => [notifier, notifier2]
|
17
27
|
end
|
@@ -39,6 +49,4 @@ end
|
|
39
49
|
# process.checks :mem_usage, :above => 100.megabytes, :actions => [notifier, notifier2]
|
40
50
|
# process.checks :mem_usage, :above => 100.megabytes, :actions => [Procmon::Notifiers::Email]
|
41
51
|
#end
|
42
|
-
|
43
|
-
|
44
|
-
|
52
|
+
```
|
data/lib/procmon/version.rb
CHANGED
data/procmon.gemspec
CHANGED
@@ -19,6 +19,6 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
20
20
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
21
21
|
s.require_paths = ["lib"]
|
22
|
-
s.extra_rdoc_files = ["README"]
|
22
|
+
s.extra_rdoc_files = ["README.md"]
|
23
23
|
end
|
24
24
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: procmon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Darren Dao
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-11-
|
18
|
+
date: 2011-11-18 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: activesupport
|
@@ -57,9 +57,9 @@ executables:
|
|
57
57
|
extensions: []
|
58
58
|
|
59
59
|
extra_rdoc_files:
|
60
|
-
- README
|
60
|
+
- README.md
|
61
61
|
files:
|
62
|
-
- README
|
62
|
+
- README.md
|
63
63
|
- bin/placeholder
|
64
64
|
- lib/procmon.rb
|
65
65
|
- lib/procmon/.dsl.rb.swp
|