monittr 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +21 -9
- data/examples/application.rb +59 -0
- data/examples/monitrc +29 -0
- data/examples/template.erb +20 -0
- data/lib/monittr.rb +80 -24
- data/lib/monittr/sinatra/template.erb +1 -0
- data/lib/monittr/version.rb +1 -1
- data/test/fixtures/status.xml +549 -1
- data/test/monittr_test.rb +39 -1
- data/test/test_helper.rb +2 -1
- metadata +5 -2
data/README.markdown
CHANGED
@@ -8,18 +8,16 @@ It also displays the information in HTML with the provided helpers. You can use
|
|
8
8
|
|
9
9
|
![Screenshot: Monittr, a web interface for Monit statistics](https://github.com/karmi/monittr/raw/master/screenshot.png)
|
10
10
|
|
11
|
-
## Installation ##
|
12
|
-
|
13
|
-
$ gem install monittr
|
14
|
-
|
15
11
|
|
16
12
|
## Usage ##
|
17
13
|
|
14
|
+
First, clone or download the sources from [_Github_](https://github.com/karmi/monittr/zipball/master).
|
15
|
+
|
18
16
|
You can try the interface in a IRB console:
|
19
17
|
|
20
18
|
$ irb -Ilib -rubygems -rmonittr
|
21
19
|
|
22
|
-
You have to pass one or more URLs to a running Monit web server.
|
20
|
+
You have to pass one or more full URLs to a running Monit web server XML output, eg. `http://admin:monit@example.com:2812/_status?format=xml`.
|
23
21
|
|
24
22
|
In case you don't have a running Monit handy, fake its output:
|
25
23
|
|
@@ -28,7 +26,7 @@ In case you don't have a running Monit handy, fake its output:
|
|
28
26
|
|
29
27
|
Now, retrieve information from the cluster:
|
30
28
|
|
31
|
-
cluster = Monittr::Cluster.new 'http://localhost:2812/_status?format=xml'
|
29
|
+
cluster = Monittr::Cluster.new ['http://localhost:2812/_status?format=xml']
|
32
30
|
cluster.servers.size
|
33
31
|
|
34
32
|
server = cluster.servers.first
|
@@ -53,7 +51,7 @@ You should see the information about two faked Monit instances in your browser.
|
|
53
51
|
|
54
52
|
Provide the URLs to _Monit_ instances by setting the appropriate option:
|
55
53
|
|
56
|
-
set :monit_urls, ['http://
|
54
|
+
set :monit_urls, ['http://production.example.com:2812/_status?format=xml', 'http://staging.example.com:2812/_status?format=xml']
|
57
55
|
|
58
56
|
|
59
57
|
## Customization ##
|
@@ -61,11 +59,25 @@ Provide the URLs to _Monit_ instances by setting the appropriate option:
|
|
61
59
|
It's easy to customize the HTML output by setting the appropriate options in your _Sinatra_ application.
|
62
60
|
|
63
61
|
|
64
|
-
set :template, Proc.new { File.join(root, 'template.erb') }
|
65
|
-
set :stylesheet, '/path/to/my/stylesheet'
|
62
|
+
set :template, Proc.new { File.join(root, 'template.erb') }
|
63
|
+
set :stylesheet, '/path/to/my/stylesheet'
|
66
64
|
|
67
65
|
Please see the example application for more.
|
68
66
|
|
67
|
+
|
68
|
+
## Installation ##
|
69
|
+
|
70
|
+
The best way how to install the gem is from the source:
|
71
|
+
|
72
|
+
$ git clone http://github.com/karmi/monittr.git
|
73
|
+
$ cd monittr
|
74
|
+
$ rake install
|
75
|
+
|
76
|
+
Stable versions of the gem can be installed from _Rubygems_:
|
77
|
+
|
78
|
+
$ gem install monittr
|
79
|
+
|
80
|
+
|
69
81
|
## Other Information ##
|
70
82
|
|
71
83
|
See the [_monit_](https://github.com/k33l0r/monit) gem for another Ruby interface to _Monit_.
|
@@ -0,0 +1,59 @@
|
|
1
|
+
$LOAD_PATH.unshift( File.expand_path('../../lib', __FILE__) )
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'monittr'
|
5
|
+
require 'sinatra'
|
6
|
+
require 'fakeweb'
|
7
|
+
|
8
|
+
require 'monittr/sinatra/monittr'
|
9
|
+
|
10
|
+
FakeWeb.register_uri(:get, 'http://localhost:2812/_status?format=xml', :body => File.read( File.expand_path('../../test/fixtures/status.xml', __FILE__)))
|
11
|
+
|
12
|
+
set :monit_urls, ['http://localhost:2812/_status?format=xml', 'http://localhost:2812/_status?format=xml']
|
13
|
+
|
14
|
+
# set :template, Proc.new { File.join(root, 'template.erb') }
|
15
|
+
# set :stylesheet, '/path/to/my/stylesheet'
|
16
|
+
|
17
|
+
get "/" do
|
18
|
+
erb :index
|
19
|
+
end
|
20
|
+
|
21
|
+
__END__
|
22
|
+
|
23
|
+
@@ layout
|
24
|
+
<!DOCTYPE html>
|
25
|
+
<html>
|
26
|
+
<head>
|
27
|
+
<title>Example Admin Application With Monittr</title>
|
28
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
29
|
+
<style>
|
30
|
+
body { color: #222; font-family: sans-serif; margin: 2em; }
|
31
|
+
#example { border: 4px solid #ccc; padding: 1em; }
|
32
|
+
</style>
|
33
|
+
</head>
|
34
|
+
<body>
|
35
|
+
<%= yield %>
|
36
|
+
</body>
|
37
|
+
</html>
|
38
|
+
|
39
|
+
@@ index
|
40
|
+
|
41
|
+
<p>This is your regular admin application created with <em>Sinatra</em>, having lots of features.</p>
|
42
|
+
|
43
|
+
<p>Now, you can embed the <em>Monittr</em> info anywhere by calling this helper method:</p>
|
44
|
+
|
45
|
+
<pre>monittr.html</pre>
|
46
|
+
|
47
|
+
<p>and you should see something like this:</p>
|
48
|
+
|
49
|
+
<div id="example">
|
50
|
+
<%= monittr.html %>
|
51
|
+
</div><!-- /monittr_example -->
|
52
|
+
|
53
|
+
<p>See, easy.</p>
|
54
|
+
|
55
|
+
<p>You can customize the template, of course, and set the path to it with:</p>
|
56
|
+
|
57
|
+
<pre>
|
58
|
+
set :template, '/path/to/my/template.erb'
|
59
|
+
</pre>
|
data/examples/monitrc
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# ##########################################
|
2
|
+
# Run me with `monit -I -c examples/monitrc`
|
3
|
+
# ##########################################
|
4
|
+
|
5
|
+
set daemon 120
|
6
|
+
|
7
|
+
set alert user@example.com
|
8
|
+
set mailserver localhost
|
9
|
+
|
10
|
+
set httpd port 2812 and
|
11
|
+
use address localhost
|
12
|
+
allow localhost
|
13
|
+
|
14
|
+
check system myapplication.cz
|
15
|
+
if loadavg (1min) > 4 then alert
|
16
|
+
if loadavg (5min) > 2 then alert
|
17
|
+
if memory usage > 75% then alert
|
18
|
+
if cpu usage (user) > 70% then alert
|
19
|
+
if cpu usage (system) > 30% then alert
|
20
|
+
if cpu usage (wait) > 20% then alert
|
21
|
+
|
22
|
+
check filesystem tmp with path /tmp
|
23
|
+
if space usage > 90% for 5 times within 15 cycles then alert
|
24
|
+
if inode usage > 30000 then alert
|
25
|
+
group myapplication.cz
|
26
|
+
|
27
|
+
check host sinatra with address 127.0.0.1
|
28
|
+
if failed url http://127.0.0.1:4567/ with timeout 15 seconds then alert
|
29
|
+
group myapplication.cz
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<h1>A Customized template for <em>Monittr</em></h1>
|
2
|
+
|
3
|
+
<p>You can customize the template as you wish,
|
4
|
+
just set the path to it with something like this in your application:</p>
|
5
|
+
|
6
|
+
<pre>set :template, Proc.new { File.join(root, 'template.erb') }</pre>
|
7
|
+
|
8
|
+
<hr>
|
9
|
+
|
10
|
+
<% cluster.servers.each do |server| %>
|
11
|
+
<h2>Server: <em><%= server.system.name %></em> // status: <%= server.system.status %></h2>
|
12
|
+
|
13
|
+
<h3>Processes</h3>
|
14
|
+
<ul>
|
15
|
+
<% server.processes.each do |process| %>
|
16
|
+
<li><%= process.name %></li>
|
17
|
+
<% end %>
|
18
|
+
</ul>
|
19
|
+
|
20
|
+
<% end %>
|
data/lib/monittr.rb
CHANGED
@@ -4,6 +4,9 @@ require 'ostruct'
|
|
4
4
|
|
5
5
|
module Monittr
|
6
6
|
|
7
|
+
# Represents a cluster of monitored instances.
|
8
|
+
# Pass and array of URLs to the constructor.
|
9
|
+
#
|
7
10
|
class Cluster
|
8
11
|
|
9
12
|
attr_reader :servers
|
@@ -15,7 +18,7 @@ module Monittr
|
|
15
18
|
end
|
16
19
|
|
17
20
|
|
18
|
-
# Represents one monitored
|
21
|
+
# Represents one monitored instance
|
19
22
|
#
|
20
23
|
class Server
|
21
24
|
|
@@ -23,60 +26,113 @@ module Monittr
|
|
23
26
|
|
24
27
|
def initialize(xml)
|
25
28
|
@xml = Nokogiri::XML(xml)
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
+
if error = @xml.xpath('error').first
|
30
|
+
@system = Services::Base.new :name => error.attributes['name'].content,
|
31
|
+
:message => error.attributes['message'].content,
|
32
|
+
:status => 3
|
33
|
+
else
|
34
|
+
@system = Services::System.new(@xml.xpath("//service[@type=5]").first)
|
35
|
+
@filesystems = @xml.xpath("//service[@type=0]").map { |xml| Services::Filesystem.new(xml) }
|
36
|
+
@processes = @xml.xpath("//service[@type=3]").map { |xml| Services::Process.new(xml) }
|
37
|
+
end
|
29
38
|
end
|
30
39
|
|
40
|
+
# Retrieve Monit status XML from the URL
|
41
|
+
#
|
31
42
|
def self.fetch(url=nil)
|
32
43
|
url = url || ENV['MONIT_URL'] || 'http://admin:monit@localhost:2812/_status?format=xml'
|
33
44
|
self.new( RestClient.get(url) )
|
45
|
+
rescue Exception => e
|
46
|
+
self.new(%Q|<error status="3" name="#{e.class}" message="#{e.message}" />|)
|
47
|
+
end
|
48
|
+
|
49
|
+
def inspect
|
50
|
+
%Q|<#{self.class} name="#{system.name}" status="#{system.status}" message="#{system.message}">|
|
34
51
|
end
|
35
52
|
|
36
53
|
end
|
37
54
|
|
38
55
|
|
56
|
+
|
39
57
|
module Services
|
58
|
+
|
40
59
|
class Base < OpenStruct
|
41
60
|
TYPES = { 0 => "Filesystem", 1 => "Directory", 2 => "File", 3 => "Daemon", 4 => "Connection", 5 => "System" }
|
61
|
+
|
62
|
+
def value(matcher, converter=:to_s)
|
63
|
+
@xml.xpath(matcher).first.content.send(converter) rescue nil
|
64
|
+
end
|
65
|
+
|
66
|
+
def inspect
|
67
|
+
%Q|<#{self.class} name="#{name}" status="#{status}" message="#{message}">|
|
68
|
+
end
|
42
69
|
end
|
43
70
|
|
71
|
+
# A "system" service in Monit
|
72
|
+
#
|
73
|
+
# <service type="5">
|
74
|
+
#
|
44
75
|
class System < Base
|
45
76
|
def initialize(xml)
|
46
|
-
|
47
|
-
|
48
|
-
:
|
49
|
-
:
|
50
|
-
:
|
51
|
-
:
|
52
|
-
:
|
77
|
+
@xml = xml
|
78
|
+
super( { :name => value('name' ),
|
79
|
+
:status => value('status', :to_i),
|
80
|
+
:monitored => value('monitor', :to_i),
|
81
|
+
:load => value('system/load/avg01', :to_f),
|
82
|
+
:cpu => value('system/cpu/user', :to_f),
|
83
|
+
:memory => value('system/memory/percent', :to_f),
|
84
|
+
:uptime => value('//server/uptime', :to_f)
|
53
85
|
} )
|
54
86
|
end
|
55
87
|
end
|
56
88
|
|
89
|
+
# A "filesystem" service in Monit
|
90
|
+
#
|
91
|
+
# http://mmonit.com/monit/documentation/monit.html#filesystem_flags_testing
|
92
|
+
#
|
93
|
+
# <service type="0">
|
94
|
+
#
|
57
95
|
class Filesystem < Base
|
58
96
|
def initialize(xml)
|
59
|
-
|
60
|
-
|
61
|
-
:
|
62
|
-
:
|
63
|
-
:
|
64
|
-
:
|
97
|
+
@xml = xml
|
98
|
+
super( { :name => value('name' ),
|
99
|
+
:status => value('status', :to_i),
|
100
|
+
:monitored => value('monitor', :to_i),
|
101
|
+
:percent => value('block/percent', :to_f),
|
102
|
+
:usage => value('block/usage' ),
|
103
|
+
:total => value('block/total' )
|
65
104
|
} )
|
105
|
+
rescue Exception => e
|
106
|
+
puts "ERROR: #{e.class} -- #{e.message}, In: #{e.backtrace.first}"
|
107
|
+
super( { :name => 'Error',
|
108
|
+
:status => 3,
|
109
|
+
:message => e.message } )
|
66
110
|
end
|
67
111
|
end
|
68
112
|
|
113
|
+
# A "process" service in Monit
|
114
|
+
#
|
115
|
+
# http://mmonit.com/monit/documentation/monit.html#pid_testing
|
116
|
+
#
|
117
|
+
# <service type="3">
|
118
|
+
#
|
69
119
|
class Process < Base
|
70
120
|
def initialize(xml)
|
71
|
-
|
72
|
-
|
73
|
-
:
|
74
|
-
:
|
75
|
-
:
|
76
|
-
:
|
77
|
-
:
|
121
|
+
@xml = xml
|
122
|
+
super( { :name => value('name' ),
|
123
|
+
:status => value('status', :to_i),
|
124
|
+
:monitored => value('monitor', :to_i),
|
125
|
+
:pid => value('pid', :to_i),
|
126
|
+
:uptime => value('uptime', :to_i),
|
127
|
+
:memory => value('memory/percent', :to_f),
|
128
|
+
:cpu => value('cpu/percent', :to_i)
|
78
129
|
|
79
130
|
} )
|
131
|
+
rescue Exception => e
|
132
|
+
puts "ERROR: #{e.class} -- #{e.message}, In: #{e.backtrace.first}"
|
133
|
+
super( { :name => 'Error',
|
134
|
+
:status => 3,
|
135
|
+
:message => e.message } )
|
80
136
|
end
|
81
137
|
end
|
82
138
|
|
@@ -12,6 +12,7 @@
|
|
12
12
|
<span class="dot status <%= server.system.status == 0 ? 'running' : 'failure' %>">·</span>
|
13
13
|
<span class="dot monitored <%= server.system.monitored == 1 ? 'running' : 'failure' %>">·</span>
|
14
14
|
<%= server.system.name %>
|
15
|
+
<%= "<em>#{server.system.message}</em>" if server.system.message %>
|
15
16
|
</strong>
|
16
17
|
|
17
18
|
<small>
|
data/lib/monittr/version.rb
CHANGED
data/test/fixtures/status.xml
CHANGED
@@ -1 +1,549 @@
|
|
1
|
-
<?xml version="1.0" encoding="ISO-8859-1"?><monit><server><id>92d1d1a237da200ac04cc19890495214</id><incarnation>1289589073</incarnation><version>5.1.1</version><uptime>937661</uptime><poll>10</poll><startdelay>0</startdelay><localhostname>myapplication.cz</localhostname><controlfile>/usr/local/etc/monitrc</controlfile><httpd><address></address><port>2812</port><ssl>0</ssl></httpd></server><platform><name>FreeBSD</name><release>8.1-RELEASE</release><version>FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 UTC 2010 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC</version><machine>amd64</machine><cpu>4</cpu><memory>8373908</memory></platform><service type="0"><collected_sec>1290526733</collected_sec><collected_usec>927817</collected_usec><name>root</name><status>0</status><status_hint>0</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups></groups><mode>755</mode><uid>0</uid><gid>0</gid><flags>20480</flags><block><percent>22.8</percent><usage>294.5 MB</usage><total>1978.5 MB</total></block><inode><percent>0.8</percent><usage>2382</usage><total>282622</total></inode></service><service type="0"><collected_sec>1290526733</collected_sec><collected_usec>927867</collected_usec><name>tmp</name><status>0</status><status_hint>0</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups></groups><mode>1777</mode><uid>0</uid><gid>0</gid><flags>2101248</flags><block><percent>67.0</percent><usage>281.2 MB</usage><total>476.4 MB</total></block><inode><percent>4.3</percent><usage>2769</usage><total>63230</total></inode></service><service type="0"><collected_sec>1290526733</collected_sec><collected_usec>927885</collected_usec><name>usr</name><status>0</status><status_hint>0</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups></groups><mode>755</mode><uid>0</uid><gid>0</gid><flags>2101248</flags><block><percent>35.1</percent><usage>2125.7 MB</usage><total>7815.5 MB</total></block><inode><percent>4.9</percent><usage>51155</usage><total>1036286</total></inode></service><service type="0"><collected_sec>1290526733</collected_sec><collected_usec>927903</collected_usec><name>var</name><status>0</status><status_hint>0</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups></groups><mode>755</mode><uid>0</uid><gid>0</gid><flags>2101248</flags><block><percent>57.5</percent><usage>26554.6 MB</usage><total>53555.8 MB</total></block><inode><percent>0.1</percent><usage>8038</usage><total>7089150</total></inode></service><service type="3"><collected_sec>1290526733</collected_sec><collected_usec>928167</collected_usec><name>thin_1</name><status>0</status><status_hint>0</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups><name>my_application_thin</name></groups><pid>40199</pid><ppid>1</ppid><uptime>679095</uptime><children>0</children><memory><percent>1.2</percent><percenttotal>1.2</percenttotal><kilobyte>101576</kilobyte><kilobytetotal>101576</kilobytetotal></memory><cpu><percent>0.0</percent><percenttotal>0.0</percenttotal></cpu><unix><path>/var/run/thin/thin.1.sock</path><protocol>DEFAULT</protocol><responsetime>0.000</responsetime></unix></service><service type="3"><collected_sec>1290526733</collected_sec><collected_usec>928169</collected_usec><name>thin_2</name><status>0</status><status_hint>0</status_hint><monitor>0</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups><name>my_application_thin</name></groups></service><service type="3"><collected_sec>1290526733</collected_sec><collected_usec>928391</collected_usec><name>thin_3</name><status>0</status><status_hint>0</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups><name>my_application_thin</name></groups><pid>40070</pid><ppid>1</ppid><uptime>679107</uptime><children>0</children><memory><percent>1.3</percent><percenttotal>1.3</percenttotal><kilobyte>109268</kilobyte><kilobytetotal>109268</kilobytetotal></memory><cpu><percent>0.0</percent><percenttotal>0.0</percenttotal></cpu><unix><path>/var/run/thin/thin.3.sock</path><protocol>DEFAULT</protocol><responsetime>0.000</responsetime></unix></service><service type="3"><collected_sec>1290526733</collected_sec><collected_usec>938417</collected_usec><name>nginx</name><status>0</status><status_hint>0</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups><name>myapplication</name></groups><pid>41305</pid><ppid>1</ppid><uptime>299250</uptime><children>6</children><memory><percent>0.0</percent><percenttotal>0.3</percenttotal><kilobyte>3264</kilobyte><kilobytetotal>29136</kilobytetotal></memory><cpu><percent>0.0</percent><percenttotal>0.0</percenttotal></cpu><port><hostname>localhost</hostname><portnumber>80</portnumber><request>/sign_in</request><protocol>HTTP</protocol><type>TCP</type><responsetime>0.010</responsetime></port></service><service type="3"><collected_sec>1290526733</collected_sec><collected_usec>940124</collected_usec><name>couchdb</name><status>0</status><status_hint>524288</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups></groups><pid>29555</pid><ppid>29554</ppid><uptime>59920</uptime><children>40</children><memory><percent>4.4</percent><percenttotal>7.2</percenttotal><kilobyte>372484</kilobyte><kilobytetotal>608548</kilobytetotal></memory><cpu><percent>4.2</percent><percenttotal>14.5</percenttotal></cpu><port><hostname>127.0.0.1</hostname><portnumber>5984</portnumber><request></request><protocol>DEFAULT</protocol><type>TCP</type><responsetime>0.000</responsetime></port></service><service type="3"><collected_sec>1290526733</collected_sec><collected_usec>938754</collected_usec><name>couchdb_lucene</name><status>0</status><status_hint>524288</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups></groups><pid>32378</pid><ppid>1</ppid><uptime>433976</uptime><children>0</children><memory><percent>2.0</percent><percenttotal>2.0</percenttotal><kilobyte>171184</kilobyte><kilobytetotal>171184</kilobytetotal></memory><cpu><percent>0.0</percent><percenttotal>0.0</percenttotal></cpu><port><hostname>127.0.0.1</hostname><portnumber>5985</portnumber><request></request><protocol>DEFAULT</protocol><type>TCP</type><responsetime>0.000</responsetime></port></service><service type="3"><collected_sec>1290526733</collected_sec><collected_usec>939199</collected_usec><name>redis</name><status>0</status><status_hint>524288</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups></groups><pid>963</pid><ppid>1</ppid><uptime>937659</uptime><children>0</children><memory><percent>11.8</percent><percenttotal>11.8</percenttotal><kilobyte>992948</kilobyte><kilobytetotal>992948</kilobytetotal></memory><cpu><percent>0.2</percent><percenttotal>0.2</percenttotal></cpu><port><hostname>127.0.0.1</hostname><portnumber>6379</portnumber><request></request><protocol>DEFAULT</protocol><type>TCP</type><responsetime>0.000</responsetime></port></service><service type="3"><collected_sec>1290526733</collected_sec><collected_usec>939333</collected_usec><name>refresh_workers</name><status>0</status><status_hint>0</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups></groups><pid>75352</pid><ppid>75350</ppid><uptime>67064</uptime><children>10</children><memory><percent>0.7</percent><percenttotal>9.4</percenttotal><kilobyte>59020</kilobyte><kilobytetotal>787952</kilobytetotal></memory><cpu><percent>0.0</percent><percenttotal>5.9</percenttotal></cpu></service><service type="3"><collected_sec>1290526733</collected_sec><collected_usec>939465</collected_usec><name>enrichment_workers</name><status>0</status><status_hint>0</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups></groups><pid>75434</pid><ppid>75433</ppid><uptime>49821</uptime><children>10</children><memory><percent>0.7</percent><percenttotal>8.4</percenttotal><kilobyte>59384</kilobyte><kilobytetotal>704804</kilobytetotal></memory><cpu><percent>0.0</percent><percenttotal>0.6</percenttotal></cpu></service><service type="3"><collected_sec>1290526733</collected_sec><collected_usec>939601</collected_usec><name>enrichment_manager_workers</name><status>0</status><status_hint>0</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups></groups><pid>14922</pid><ppid>14921</ppid><uptime>655967</uptime><children>1</children><memory><percent>0.6</percent><percenttotal>1.4</percenttotal><kilobyte>57204</kilobyte><kilobytetotal>119852</kilobytetotal></memory><cpu><percent>0.0</percent><percenttotal>0.0</percenttotal></cpu></service><service type="3"><collected_sec>1290526733</collected_sec><collected_usec>939682</collected_usec><name>delete_keyword_workers</name><status>0</status><status_hint>0</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups></groups><pid>12889</pid><ppid>12888</ppid><uptime>656639</uptime><children>1</children><memory><percent>0.6</percent><percenttotal>1.4</percenttotal><kilobyte>56364</kilobyte><kilobytetotal>119656</kilobytetotal></memory><cpu><percent>0.0</percent><percenttotal>0.0</percenttotal></cpu></service><service type="3"><collected_sec>1290526733</collected_sec><collected_usec>939749</collected_usec><name>reports_workers</name><status>0</status><status_hint>0</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups></groups><pid>12934</pid><ppid>12933</ppid><uptime>656624</uptime><children>1</children><memory><percent>0.6</percent><percenttotal>1.4</percenttotal><kilobyte>56908</kilobyte><kilobytetotal>120236</kilobytetotal></memory><cpu><percent>0.0</percent><percenttotal>0.0</percenttotal></cpu></service><service type="3"><collected_sec>1290526733</collected_sec><collected_usec>939824</collected_usec><name>scheduler_workers</name><status>0</status><status_hint>0</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups></groups><pid>12870</pid><ppid>12869</ppid><uptime>656652</uptime><children>1</children><memory><percent>0.6</percent><percenttotal>1.3</percenttotal><kilobyte>56596</kilobyte><kilobytetotal>116260</kilobytetotal></memory><cpu><percent>0.0</percent><percenttotal>0.0</percenttotal></cpu></service><service type="3"><collected_sec>1290526733</collected_sec><collected_usec>939890</collected_usec><name>scheduler</name><status>0</status><status_hint>0</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups></groups><pid>12681</pid><ppid>1</ppid><uptime>656765</uptime><children>0</children><memory><percent>0.7</percent><percenttotal>0.7</percenttotal><kilobyte>66200</kilobyte><kilobytetotal>66200</kilobytetotal></memory><cpu><percent>0.2</percent><percenttotal>0.2</percenttotal></cpu></service><service type="3"><collected_sec>1290526733</collected_sec><collected_usec>939892</collected_usec><name>enrichment_fresh</name><status>0</status><status_hint>0</status_hint><monitor>0</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups></groups></service><service type="5"><collected_sec>1290526733</collected_sec><collected_usec>939894</collected_usec><name>myapplication.cz</name><status>0</status><status_hint>0</status_hint><monitor>1</monitor><monitormode>0</monitormode><pendingaction>0</pendingaction><groups></groups><system><load><avg01>5.28</avg01><avg05>5.66</avg05><avg15>5.06</avg15></load><cpu><user>63.2</user><system>21.8</system></cpu><memory><percent>37.0</percent><kilobyte>3099648</kilobyte></memory></system></service></monit>
|
1
|
+
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2
|
+
<monit>
|
3
|
+
<server>
|
4
|
+
<id>92d1d1a237da200ac04cc19890495214</id>
|
5
|
+
<incarnation>1289589073</incarnation>
|
6
|
+
<version>5.1.1</version>
|
7
|
+
<uptime>937661</uptime>
|
8
|
+
<poll>10</poll>
|
9
|
+
<startdelay>0</startdelay>
|
10
|
+
<localhostname>myapplication.cz</localhostname>
|
11
|
+
<controlfile>/usr/local/etc/monitrc</controlfile>
|
12
|
+
<httpd>
|
13
|
+
<address/>
|
14
|
+
<port>2812</port>
|
15
|
+
<ssl>0</ssl>
|
16
|
+
</httpd>
|
17
|
+
</server>
|
18
|
+
<platform>
|
19
|
+
<name>FreeBSD</name>
|
20
|
+
<release>8.1-RELEASE</release>
|
21
|
+
<version>FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 UTC 2010 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC</version>
|
22
|
+
<machine>amd64</machine>
|
23
|
+
<cpu>4</cpu>
|
24
|
+
<memory>8373908</memory>
|
25
|
+
</platform>
|
26
|
+
<service type="0">
|
27
|
+
<collected_sec>1290526733</collected_sec>
|
28
|
+
<collected_usec>927817</collected_usec>
|
29
|
+
<name>root</name>
|
30
|
+
<status>0</status>
|
31
|
+
<status_hint>0</status_hint>
|
32
|
+
<monitor>1</monitor>
|
33
|
+
<monitormode>0</monitormode>
|
34
|
+
<pendingaction>0</pendingaction>
|
35
|
+
<groups/>
|
36
|
+
<mode>755</mode>
|
37
|
+
<uid>0</uid>
|
38
|
+
<gid>0</gid>
|
39
|
+
<flags>20480</flags>
|
40
|
+
<block>
|
41
|
+
<percent>22.8</percent>
|
42
|
+
<usage>294.5 MB</usage>
|
43
|
+
<total>1978.5 MB</total>
|
44
|
+
</block>
|
45
|
+
<inode>
|
46
|
+
<percent>0.8</percent>
|
47
|
+
<usage>2382</usage>
|
48
|
+
<total>282622</total>
|
49
|
+
</inode>
|
50
|
+
</service>
|
51
|
+
<service type="0">
|
52
|
+
<collected_sec>1290526733</collected_sec>
|
53
|
+
<collected_usec>927867</collected_usec>
|
54
|
+
<name>tmp</name>
|
55
|
+
<status>0</status>
|
56
|
+
<status_hint>0</status_hint>
|
57
|
+
<monitor>1</monitor>
|
58
|
+
<monitormode>0</monitormode>
|
59
|
+
<pendingaction>0</pendingaction>
|
60
|
+
<groups/>
|
61
|
+
<mode>1777</mode>
|
62
|
+
<uid>0</uid>
|
63
|
+
<gid>0</gid>
|
64
|
+
<flags>2101248</flags>
|
65
|
+
<block>
|
66
|
+
<percent>67.0</percent>
|
67
|
+
<usage>281.2 MB</usage>
|
68
|
+
<total>476.4 MB</total>
|
69
|
+
</block>
|
70
|
+
<inode>
|
71
|
+
<percent>4.3</percent>
|
72
|
+
<usage>2769</usage>
|
73
|
+
<total>63230</total>
|
74
|
+
</inode>
|
75
|
+
</service>
|
76
|
+
<service type="0">
|
77
|
+
<collected_sec>1290526733</collected_sec>
|
78
|
+
<collected_usec>927885</collected_usec>
|
79
|
+
<name>usr</name>
|
80
|
+
<status>0</status>
|
81
|
+
<status_hint>0</status_hint>
|
82
|
+
<monitor>1</monitor>
|
83
|
+
<monitormode>0</monitormode>
|
84
|
+
<pendingaction>0</pendingaction>
|
85
|
+
<groups/>
|
86
|
+
<mode>755</mode>
|
87
|
+
<uid>0</uid>
|
88
|
+
<gid>0</gid>
|
89
|
+
<flags>2101248</flags>
|
90
|
+
<block>
|
91
|
+
<percent>35.1</percent>
|
92
|
+
<usage>2125.7 MB</usage>
|
93
|
+
<total>7815.5 MB</total>
|
94
|
+
</block>
|
95
|
+
<inode>
|
96
|
+
<percent>4.9</percent>
|
97
|
+
<usage>51155</usage>
|
98
|
+
<total>1036286</total>
|
99
|
+
</inode>
|
100
|
+
</service>
|
101
|
+
<service type="0">
|
102
|
+
<collected_sec>1290526733</collected_sec>
|
103
|
+
<collected_usec>927903</collected_usec>
|
104
|
+
<name>var</name>
|
105
|
+
<status>0</status>
|
106
|
+
<status_hint>0</status_hint>
|
107
|
+
<monitor>1</monitor>
|
108
|
+
<monitormode>0</monitormode>
|
109
|
+
<pendingaction>0</pendingaction>
|
110
|
+
<groups/>
|
111
|
+
<mode>755</mode>
|
112
|
+
<uid>0</uid>
|
113
|
+
<gid>0</gid>
|
114
|
+
<flags>2101248</flags>
|
115
|
+
<block>
|
116
|
+
<percent>57.5</percent>
|
117
|
+
<usage>26554.6 MB</usage>
|
118
|
+
<total>53555.8 MB</total>
|
119
|
+
</block>
|
120
|
+
<inode>
|
121
|
+
<percent>0.1</percent>
|
122
|
+
<usage>8038</usage>
|
123
|
+
<total>7089150</total>
|
124
|
+
</inode>
|
125
|
+
</service>
|
126
|
+
<service type="3">
|
127
|
+
<collected_sec>1290526733</collected_sec>
|
128
|
+
<collected_usec>928167</collected_usec>
|
129
|
+
<name>thin_1</name>
|
130
|
+
<status>0</status>
|
131
|
+
<status_hint>0</status_hint>
|
132
|
+
<monitor>1</monitor>
|
133
|
+
<monitormode>0</monitormode>
|
134
|
+
<pendingaction>0</pendingaction>
|
135
|
+
<groups>
|
136
|
+
<name>my_application_thin</name>
|
137
|
+
</groups>
|
138
|
+
<pid>40199</pid>
|
139
|
+
<ppid>1</ppid>
|
140
|
+
<uptime>679095</uptime>
|
141
|
+
<children>0</children>
|
142
|
+
<memory>
|
143
|
+
<percent>1.2</percent>
|
144
|
+
<percenttotal>1.2</percenttotal>
|
145
|
+
<kilobyte>101576</kilobyte>
|
146
|
+
<kilobytetotal>101576</kilobytetotal>
|
147
|
+
</memory>
|
148
|
+
<cpu>
|
149
|
+
<percent>0.0</percent>
|
150
|
+
<percenttotal>0.0</percenttotal>
|
151
|
+
</cpu>
|
152
|
+
<unix>
|
153
|
+
<path>/var/run/thin/thin.1.sock</path>
|
154
|
+
<protocol>DEFAULT</protocol>
|
155
|
+
<responsetime>0.000</responsetime>
|
156
|
+
</unix>
|
157
|
+
</service>
|
158
|
+
<service type="3">
|
159
|
+
<collected_sec>1290526733</collected_sec>
|
160
|
+
<collected_usec>928169</collected_usec>
|
161
|
+
<name>thin_2</name>
|
162
|
+
<status>0</status>
|
163
|
+
<status_hint>0</status_hint>
|
164
|
+
<monitor>0</monitor>
|
165
|
+
<monitormode>0</monitormode>
|
166
|
+
<pendingaction>0</pendingaction>
|
167
|
+
<groups>
|
168
|
+
<name>my_application_thin</name>
|
169
|
+
</groups>
|
170
|
+
</service>
|
171
|
+
<service type="3">
|
172
|
+
<collected_sec>1290526733</collected_sec>
|
173
|
+
<collected_usec>928391</collected_usec>
|
174
|
+
<name>thin_3</name>
|
175
|
+
<status>0</status>
|
176
|
+
<status_hint>0</status_hint>
|
177
|
+
<monitor>1</monitor>
|
178
|
+
<monitormode>0</monitormode>
|
179
|
+
<pendingaction>0</pendingaction>
|
180
|
+
<groups>
|
181
|
+
<name>my_application_thin</name>
|
182
|
+
</groups>
|
183
|
+
<pid>40070</pid>
|
184
|
+
<ppid>1</ppid>
|
185
|
+
<uptime>679107</uptime>
|
186
|
+
<children>0</children>
|
187
|
+
<memory>
|
188
|
+
<percent>1.3</percent>
|
189
|
+
<percenttotal>1.3</percenttotal>
|
190
|
+
<kilobyte>109268</kilobyte>
|
191
|
+
<kilobytetotal>109268</kilobytetotal>
|
192
|
+
</memory>
|
193
|
+
<cpu>
|
194
|
+
<percent>0.0</percent>
|
195
|
+
<percenttotal>0.0</percenttotal>
|
196
|
+
</cpu>
|
197
|
+
<unix>
|
198
|
+
<path>/var/run/thin/thin.3.sock</path>
|
199
|
+
<protocol>DEFAULT</protocol>
|
200
|
+
<responsetime>0.000</responsetime>
|
201
|
+
</unix>
|
202
|
+
</service>
|
203
|
+
<service type="3">
|
204
|
+
<collected_sec>1290526733</collected_sec>
|
205
|
+
<collected_usec>938417</collected_usec>
|
206
|
+
<name>nginx</name>
|
207
|
+
<status>0</status>
|
208
|
+
<status_hint>0</status_hint>
|
209
|
+
<monitor>1</monitor>
|
210
|
+
<monitormode>0</monitormode>
|
211
|
+
<pendingaction>0</pendingaction>
|
212
|
+
<groups>
|
213
|
+
<name>myapplication</name>
|
214
|
+
</groups>
|
215
|
+
<pid>41305</pid>
|
216
|
+
<ppid>1</ppid>
|
217
|
+
<uptime>299250</uptime>
|
218
|
+
<children>6</children>
|
219
|
+
<memory>
|
220
|
+
<percent>0.0</percent>
|
221
|
+
<percenttotal>0.3</percenttotal>
|
222
|
+
<kilobyte>3264</kilobyte>
|
223
|
+
<kilobytetotal>29136</kilobytetotal>
|
224
|
+
</memory>
|
225
|
+
<cpu>
|
226
|
+
<percent>0.0</percent>
|
227
|
+
<percenttotal>0.0</percenttotal>
|
228
|
+
</cpu>
|
229
|
+
<port>
|
230
|
+
<hostname>localhost</hostname>
|
231
|
+
<portnumber>80</portnumber>
|
232
|
+
<request>/sign_in</request>
|
233
|
+
<protocol>HTTP</protocol>
|
234
|
+
<type>TCP</type>
|
235
|
+
<responsetime>0.010</responsetime>
|
236
|
+
</port>
|
237
|
+
</service>
|
238
|
+
<service type="3">
|
239
|
+
<collected_sec>1290526733</collected_sec>
|
240
|
+
<collected_usec>940124</collected_usec>
|
241
|
+
<name>couchdb</name>
|
242
|
+
<status>0</status>
|
243
|
+
<status_hint>524288</status_hint>
|
244
|
+
<monitor>1</monitor>
|
245
|
+
<monitormode>0</monitormode>
|
246
|
+
<pendingaction>0</pendingaction>
|
247
|
+
<groups/>
|
248
|
+
<pid>29555</pid>
|
249
|
+
<ppid>29554</ppid>
|
250
|
+
<uptime>59920</uptime>
|
251
|
+
<children>40</children>
|
252
|
+
<memory>
|
253
|
+
<percent>4.4</percent>
|
254
|
+
<percenttotal>7.2</percenttotal>
|
255
|
+
<kilobyte>372484</kilobyte>
|
256
|
+
<kilobytetotal>608548</kilobytetotal>
|
257
|
+
</memory>
|
258
|
+
<cpu>
|
259
|
+
<percent>4.2</percent>
|
260
|
+
<percenttotal>14.5</percenttotal>
|
261
|
+
</cpu>
|
262
|
+
<port>
|
263
|
+
<hostname>127.0.0.1</hostname>
|
264
|
+
<portnumber>5984</portnumber>
|
265
|
+
<request/>
|
266
|
+
<protocol>DEFAULT</protocol>
|
267
|
+
<type>TCP</type>
|
268
|
+
<responsetime>0.000</responsetime>
|
269
|
+
</port>
|
270
|
+
</service>
|
271
|
+
<service type="3">
|
272
|
+
<collected_sec>1290526733</collected_sec>
|
273
|
+
<collected_usec>938754</collected_usec>
|
274
|
+
<name>couchdb_lucene</name>
|
275
|
+
<status>0</status>
|
276
|
+
<status_hint>524288</status_hint>
|
277
|
+
<monitor>1</monitor>
|
278
|
+
<monitormode>0</monitormode>
|
279
|
+
<pendingaction>0</pendingaction>
|
280
|
+
<groups/>
|
281
|
+
<pid>32378</pid>
|
282
|
+
<ppid>1</ppid>
|
283
|
+
<uptime>433976</uptime>
|
284
|
+
<children>0</children>
|
285
|
+
<memory>
|
286
|
+
<percent>2.0</percent>
|
287
|
+
<percenttotal>2.0</percenttotal>
|
288
|
+
<kilobyte>171184</kilobyte>
|
289
|
+
<kilobytetotal>171184</kilobytetotal>
|
290
|
+
</memory>
|
291
|
+
<cpu>
|
292
|
+
<percent>0.0</percent>
|
293
|
+
<percenttotal>0.0</percenttotal>
|
294
|
+
</cpu>
|
295
|
+
<port>
|
296
|
+
<hostname>127.0.0.1</hostname>
|
297
|
+
<portnumber>5985</portnumber>
|
298
|
+
<request/>
|
299
|
+
<protocol>DEFAULT</protocol>
|
300
|
+
<type>TCP</type>
|
301
|
+
<responsetime>0.000</responsetime>
|
302
|
+
</port>
|
303
|
+
</service>
|
304
|
+
<service type="3">
|
305
|
+
<collected_sec>1290526733</collected_sec>
|
306
|
+
<collected_usec>939199</collected_usec>
|
307
|
+
<name>redis</name>
|
308
|
+
<status>0</status>
|
309
|
+
<status_hint>524288</status_hint>
|
310
|
+
<monitor>1</monitor>
|
311
|
+
<monitormode>0</monitormode>
|
312
|
+
<pendingaction>0</pendingaction>
|
313
|
+
<groups/>
|
314
|
+
<pid>963</pid>
|
315
|
+
<ppid>1</ppid>
|
316
|
+
<uptime>937659</uptime>
|
317
|
+
<children>0</children>
|
318
|
+
<memory>
|
319
|
+
<percent>11.8</percent>
|
320
|
+
<percenttotal>11.8</percenttotal>
|
321
|
+
<kilobyte>992948</kilobyte>
|
322
|
+
<kilobytetotal>992948</kilobytetotal>
|
323
|
+
</memory>
|
324
|
+
<cpu>
|
325
|
+
<percent>0.2</percent>
|
326
|
+
<percenttotal>0.2</percenttotal>
|
327
|
+
</cpu>
|
328
|
+
<port>
|
329
|
+
<hostname>127.0.0.1</hostname>
|
330
|
+
<portnumber>6379</portnumber>
|
331
|
+
<request/>
|
332
|
+
<protocol>DEFAULT</protocol>
|
333
|
+
<type>TCP</type>
|
334
|
+
<responsetime>0.000</responsetime>
|
335
|
+
</port>
|
336
|
+
</service>
|
337
|
+
<service type="3">
|
338
|
+
<collected_sec>1290526733</collected_sec>
|
339
|
+
<collected_usec>939333</collected_usec>
|
340
|
+
<name>refresh_workers</name>
|
341
|
+
<status>0</status>
|
342
|
+
<status_hint>0</status_hint>
|
343
|
+
<monitor>1</monitor>
|
344
|
+
<monitormode>0</monitormode>
|
345
|
+
<pendingaction>0</pendingaction>
|
346
|
+
<groups/>
|
347
|
+
<pid>75352</pid>
|
348
|
+
<ppid>75350</ppid>
|
349
|
+
<uptime>67064</uptime>
|
350
|
+
<children>10</children>
|
351
|
+
<memory>
|
352
|
+
<percent>0.7</percent>
|
353
|
+
<percenttotal>9.4</percenttotal>
|
354
|
+
<kilobyte>59020</kilobyte>
|
355
|
+
<kilobytetotal>787952</kilobytetotal>
|
356
|
+
</memory>
|
357
|
+
<cpu>
|
358
|
+
<percent>0.0</percent>
|
359
|
+
<percenttotal>5.9</percenttotal>
|
360
|
+
</cpu>
|
361
|
+
</service>
|
362
|
+
<service type="3">
|
363
|
+
<collected_sec>1290526733</collected_sec>
|
364
|
+
<collected_usec>939465</collected_usec>
|
365
|
+
<name>enrichment_workers</name>
|
366
|
+
<status>0</status>
|
367
|
+
<status_hint>0</status_hint>
|
368
|
+
<monitor>1</monitor>
|
369
|
+
<monitormode>0</monitormode>
|
370
|
+
<pendingaction>0</pendingaction>
|
371
|
+
<groups/>
|
372
|
+
<pid>75434</pid>
|
373
|
+
<ppid>75433</ppid>
|
374
|
+
<uptime>49821</uptime>
|
375
|
+
<children>10</children>
|
376
|
+
<memory>
|
377
|
+
<percent>0.7</percent>
|
378
|
+
<percenttotal>8.4</percenttotal>
|
379
|
+
<kilobyte>59384</kilobyte>
|
380
|
+
<kilobytetotal>704804</kilobytetotal>
|
381
|
+
</memory>
|
382
|
+
<cpu>
|
383
|
+
<percent>0.0</percent>
|
384
|
+
<percenttotal>0.6</percenttotal>
|
385
|
+
</cpu>
|
386
|
+
</service>
|
387
|
+
<service type="3">
|
388
|
+
<collected_sec>1290526733</collected_sec>
|
389
|
+
<collected_usec>939601</collected_usec>
|
390
|
+
<name>enrichment_manager_workers</name>
|
391
|
+
<status>0</status>
|
392
|
+
<status_hint>0</status_hint>
|
393
|
+
<monitor>1</monitor>
|
394
|
+
<monitormode>0</monitormode>
|
395
|
+
<pendingaction>0</pendingaction>
|
396
|
+
<groups/>
|
397
|
+
<pid>14922</pid>
|
398
|
+
<ppid>14921</ppid>
|
399
|
+
<uptime>655967</uptime>
|
400
|
+
<children>1</children>
|
401
|
+
<memory>
|
402
|
+
<percent>0.6</percent>
|
403
|
+
<percenttotal>1.4</percenttotal>
|
404
|
+
<kilobyte>57204</kilobyte>
|
405
|
+
<kilobytetotal>119852</kilobytetotal>
|
406
|
+
</memory>
|
407
|
+
<cpu>
|
408
|
+
<percent>0.0</percent>
|
409
|
+
<percenttotal>0.0</percenttotal>
|
410
|
+
</cpu>
|
411
|
+
</service>
|
412
|
+
<service type="3">
|
413
|
+
<collected_sec>1290526733</collected_sec>
|
414
|
+
<collected_usec>939682</collected_usec>
|
415
|
+
<name>delete_keyword_workers</name>
|
416
|
+
<status>0</status>
|
417
|
+
<status_hint>0</status_hint>
|
418
|
+
<monitor>1</monitor>
|
419
|
+
<monitormode>0</monitormode>
|
420
|
+
<pendingaction>0</pendingaction>
|
421
|
+
<groups/>
|
422
|
+
<pid>12889</pid>
|
423
|
+
<ppid>12888</ppid>
|
424
|
+
<uptime>656639</uptime>
|
425
|
+
<children>1</children>
|
426
|
+
<memory>
|
427
|
+
<percent>0.6</percent>
|
428
|
+
<percenttotal>1.4</percenttotal>
|
429
|
+
<kilobyte>56364</kilobyte>
|
430
|
+
<kilobytetotal>119656</kilobytetotal>
|
431
|
+
</memory>
|
432
|
+
<cpu>
|
433
|
+
<percent>0.0</percent>
|
434
|
+
<percenttotal>0.0</percenttotal>
|
435
|
+
</cpu>
|
436
|
+
</service>
|
437
|
+
<service type="3">
|
438
|
+
<collected_sec>1290526733</collected_sec>
|
439
|
+
<collected_usec>939749</collected_usec>
|
440
|
+
<name>reports_workers</name>
|
441
|
+
<status>0</status>
|
442
|
+
<status_hint>0</status_hint>
|
443
|
+
<monitor>1</monitor>
|
444
|
+
<monitormode>0</monitormode>
|
445
|
+
<pendingaction>0</pendingaction>
|
446
|
+
<groups/>
|
447
|
+
<pid>12934</pid>
|
448
|
+
<ppid>12933</ppid>
|
449
|
+
<uptime>656624</uptime>
|
450
|
+
<children>1</children>
|
451
|
+
<memory>
|
452
|
+
<percent>0.6</percent>
|
453
|
+
<percenttotal>1.4</percenttotal>
|
454
|
+
<kilobyte>56908</kilobyte>
|
455
|
+
<kilobytetotal>120236</kilobytetotal>
|
456
|
+
</memory>
|
457
|
+
<cpu>
|
458
|
+
<percent>0.0</percent>
|
459
|
+
<percenttotal>0.0</percenttotal>
|
460
|
+
</cpu>
|
461
|
+
</service>
|
462
|
+
<service type="3">
|
463
|
+
<collected_sec>1290526733</collected_sec>
|
464
|
+
<collected_usec>939824</collected_usec>
|
465
|
+
<name>scheduler_workers</name>
|
466
|
+
<status>0</status>
|
467
|
+
<status_hint>0</status_hint>
|
468
|
+
<monitor>1</monitor>
|
469
|
+
<monitormode>0</monitormode>
|
470
|
+
<pendingaction>0</pendingaction>
|
471
|
+
<groups/>
|
472
|
+
<pid>12870</pid>
|
473
|
+
<ppid>12869</ppid>
|
474
|
+
<uptime>656652</uptime>
|
475
|
+
<children>1</children>
|
476
|
+
<memory>
|
477
|
+
<percent>0.6</percent>
|
478
|
+
<percenttotal>1.3</percenttotal>
|
479
|
+
<kilobyte>56596</kilobyte>
|
480
|
+
<kilobytetotal>116260</kilobytetotal>
|
481
|
+
</memory>
|
482
|
+
<cpu>
|
483
|
+
<percent>0.0</percent>
|
484
|
+
<percenttotal>0.0</percenttotal>
|
485
|
+
</cpu>
|
486
|
+
</service>
|
487
|
+
<service type="3">
|
488
|
+
<collected_sec>1290526733</collected_sec>
|
489
|
+
<collected_usec>939890</collected_usec>
|
490
|
+
<name>scheduler</name>
|
491
|
+
<status>0</status>
|
492
|
+
<status_hint>0</status_hint>
|
493
|
+
<monitor>1</monitor>
|
494
|
+
<monitormode>0</monitormode>
|
495
|
+
<pendingaction>0</pendingaction>
|
496
|
+
<groups/>
|
497
|
+
<pid>12681</pid>
|
498
|
+
<ppid>1</ppid>
|
499
|
+
<uptime>656765</uptime>
|
500
|
+
<children>0</children>
|
501
|
+
<memory>
|
502
|
+
<percent>0.7</percent>
|
503
|
+
<percenttotal>0.7</percenttotal>
|
504
|
+
<kilobyte>66200</kilobyte>
|
505
|
+
<kilobytetotal>66200</kilobytetotal>
|
506
|
+
</memory>
|
507
|
+
<cpu>
|
508
|
+
<percent>0.2</percent>
|
509
|
+
<percenttotal>0.2</percenttotal>
|
510
|
+
</cpu>
|
511
|
+
</service>
|
512
|
+
<service type="3">
|
513
|
+
<collected_sec>1290526733</collected_sec>
|
514
|
+
<collected_usec>939892</collected_usec>
|
515
|
+
<name>enrichment_fresh</name>
|
516
|
+
<status>0</status>
|
517
|
+
<status_hint>0</status_hint>
|
518
|
+
<monitor>0</monitor>
|
519
|
+
<monitormode>0</monitormode>
|
520
|
+
<pendingaction>0</pendingaction>
|
521
|
+
<groups/>
|
522
|
+
</service>
|
523
|
+
<service type="5">
|
524
|
+
<collected_sec>1290526733</collected_sec>
|
525
|
+
<collected_usec>939894</collected_usec>
|
526
|
+
<name>myapplication.cz</name>
|
527
|
+
<status>0</status>
|
528
|
+
<status_hint>0</status_hint>
|
529
|
+
<monitor>1</monitor>
|
530
|
+
<monitormode>0</monitormode>
|
531
|
+
<pendingaction>0</pendingaction>
|
532
|
+
<groups/>
|
533
|
+
<system>
|
534
|
+
<load>
|
535
|
+
<avg01>5.28</avg01>
|
536
|
+
<avg05>5.66</avg05>
|
537
|
+
<avg15>5.06</avg15>
|
538
|
+
</load>
|
539
|
+
<cpu>
|
540
|
+
<user>63.2</user>
|
541
|
+
<system>21.8</system>
|
542
|
+
</cpu>
|
543
|
+
<memory>
|
544
|
+
<percent>37.0</percent>
|
545
|
+
<kilobyte>3099648</kilobyte>
|
546
|
+
</memory>
|
547
|
+
</system>
|
548
|
+
</service>
|
549
|
+
</monit>
|
data/test/monittr_test.rb
CHANGED
@@ -15,6 +15,24 @@ module Monittr
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
+
should "not fail on invalid URLS" do
|
19
|
+
assert_nothing_raised do
|
20
|
+
cluster = Monittr::Cluster.new %w[ NOTVALID
|
21
|
+
http://admin:monit@localhost:2812/_status?format=xml ]
|
22
|
+
assert_not_nil cluster.servers
|
23
|
+
assert_equal 2, cluster.servers.size
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
should "not fail on out-of-order URLs" do
|
28
|
+
cluster = Monittr::Cluster.new %w[ http://not-working/_status?format=xml
|
29
|
+
http://admin:monit@localhost:2812/_status?format=xml ]
|
30
|
+
assert_not_nil cluster.servers
|
31
|
+
assert_equal 2, cluster.servers.size
|
32
|
+
assert_equal 3, cluster.servers.first.system.status
|
33
|
+
assert_equal '500 Internal Server Error', cluster.servers.first.system.message
|
34
|
+
end
|
35
|
+
|
18
36
|
end
|
19
37
|
|
20
38
|
context "Server" do
|
@@ -23,10 +41,16 @@ module Monittr
|
|
23
41
|
@server = Server.new( fixture_file('status.xml') )
|
24
42
|
end
|
25
43
|
|
44
|
+
should "parse error XML on initialization" do
|
45
|
+
assert_nothing_raised do
|
46
|
+
server = Server.new(%Q|<error status="3" name="ERROR" message="MESSAGE" />|)
|
47
|
+
assert_equal 'ERROR', server.system.name
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
26
51
|
should "fetch info from Monit embedded web server" do
|
27
52
|
assert_nothing_raised { Server.fetch }
|
28
53
|
assert_nothing_raised { Server.fetch('http://admin:monit@localhost:2812/_status?format=xml') }
|
29
|
-
assert_raise(FakeWeb::NetConnectNotAllowedError) { Server.fetch('http://example.com') }
|
30
54
|
end
|
31
55
|
|
32
56
|
should "return system info" do
|
@@ -64,6 +88,20 @@ module Monittr
|
|
64
88
|
|
65
89
|
end
|
66
90
|
|
91
|
+
[ Services::System, Services::Filesystem, Services::Process ].each do |klass|
|
92
|
+
context "#{klass}" do
|
93
|
+
should "deal with invalid XML" do
|
94
|
+
assert_nothing_raised do
|
95
|
+
part = klass.new('KRUPITZOWKA')
|
96
|
+
assert_nil part.name
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
|
103
|
+
# ---------------------------------------------------------------------------
|
104
|
+
|
67
105
|
end
|
68
106
|
|
69
107
|
end
|
data/test/test_helper.rb
CHANGED
@@ -16,7 +16,8 @@ class Test::Unit::TestCase
|
|
16
16
|
|
17
17
|
def setup
|
18
18
|
FakeWeb.register_uri(:get, 'http://admin:monit@localhost:2812/_status?format=xml', :body => fixture_file('status.xml'))
|
19
|
-
FakeWeb.
|
19
|
+
FakeWeb.register_uri(:get, 'http://not-working/_status?format=xml', :body => '', :status => ['500'])
|
20
|
+
# FakeWeb.allow_net_connect = false
|
20
21
|
end
|
21
22
|
|
22
23
|
def fixtures_path
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Karel Minarik
|
@@ -125,6 +125,9 @@ files:
|
|
125
125
|
- test/monittr_test.rb
|
126
126
|
- test/sinatra_helper_test.rb
|
127
127
|
- test/test_helper.rb
|
128
|
+
- examples/application.rb
|
129
|
+
- examples/monitrc
|
130
|
+
- examples/template.erb
|
128
131
|
has_rdoc: true
|
129
132
|
homepage: http://github.com/karmi/monittr
|
130
133
|
licenses: []
|