monittr 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,16 +1,8 @@
1
- # Monittr : A Web Interface for Monit Statistics #
1
+ # Monittr #
2
2
 
3
- _Monittr_ provides a _Ruby_ interface for the [_Monit_](http://mmonit.com/monit/) systems management system.
3
+ Monittr provides a Ruby interface for the [Monit](http://mmonit.com/monit/) systems management system. Its main goal is to display statistics from multiple Monit instances in an attractive web interface.
4
4
 
5
- Its main goal is to display statistics from multiple _Monit_ instances in an attractive web interface.
6
-
7
- _Monittr_ loads XML from the [web server embedded in _Monit_](http://mmonit.com/monit/documentation/monit.html#monit_httpd) and makes it accessible as Ruby objects.
8
-
9
- It also provides helpers for [_Sinatra_](http://www.sinatrarb.com/) applications, to display the information as HTML. You can insert the _Monit_ information into any page, or create a dedicated page.
10
-
11
- You can use the default template, or create your own. The default template is located in `lib/monittr/sinatra/template.erb`.
12
-
13
- The default template is pictured below.
5
+ Monittr loads XML from the [web server embedded in Monit](http://mmonit.com/monit/documentation/monit.html#monit_httpd) and makes it accessible as Ruby objects. It also provides helpers for [Sinatra](http://www.sinatrarb.com/) applications, to display the information as HTML. You can insert the statistics into any page, or create a dedicated one. You can use the default template, or create your own. The default template is located in `lib/monittr/sinatra/template.erb` and pictured below.
14
6
 
15
7
  ![Screenshot: Monittr, a web interface for Monit statistics](https://github.com/karmi/monittr/raw/master/screenshot.png)
16
8
 
@@ -18,7 +10,7 @@ The default template is pictured below.
18
10
  ## Usage ##
19
11
 
20
12
  First, clone or [download](https://github.com/karmi/monittr/zipball/master)
21
- the sources from [_Github_](https://github.com/karmi/monittr/), to get the latest version:
13
+ the sources from [Github](https://github.com/karmi/monittr/), to get the latest version:
22
14
 
23
15
  $ git clone http://github.com/karmi/monittr.git
24
16
  $ cd monittr
@@ -31,7 +23,7 @@ You have to pass one or more full URLs to a local or remote Monit web server out
31
23
 
32
24
  cluster = Monittr::Cluster.new ['http://localhost:2812/']
33
25
 
34
- In case you don't have a running _Monit_ at hand, use the provided _FakeWeb_ setup:
26
+ In case you don't have a running Monit server at hand, use the provided FakeWeb setup:
35
27
 
36
28
  require 'fakeweb'
37
29
  FakeWeb.register_uri(:get, 'http://localhost:2812/_status?format=xml', :body => File.read('test/fixtures/status.xml') ); nil
@@ -62,17 +54,16 @@ You can also check out the HTML display by running the example application:
62
54
 
63
55
  You should see the information about two faked Monit instances in your browser.
64
56
 
65
- Provide the URLs to live _Monit_ instances by setting the appropriate option in `application.rb`:
57
+ Provide the URLs to live Monit instances by setting the appropriate option in `application.rb`:
66
58
 
67
59
  set :monit_urls, %w[ http://production.example.com:2812 http://staging.example.com:2812 ]
68
60
 
69
- You may also need to comment out the _FakeWeb_ section, if you're passing `localhost` URLs.
61
+ You may also need to comment out the FakeWeb section, if you're passing `localhost` URLs.
70
62
 
71
63
 
72
64
  ## Customization ##
73
65
 
74
- It's easy to customize the HTML output by setting the appropriate options in your _Sinatra_ application.
75
-
66
+ It's easy to customize the HTML output by setting the appropriate options in your Sinatra application.
76
67
 
77
68
  set :template, Proc.new { File.join(root, 'template.erb') }
78
69
  set :stylesheet, '/path/to/my/stylesheet'
@@ -82,22 +73,22 @@ Please see the example application for prepared examples.
82
73
 
83
74
  ## Installation ##
84
75
 
85
- The best way how to install the gem is from the source:
76
+ The best way to install the gem is from the source:
86
77
 
87
78
  $ git clone http://github.com/karmi/monittr.git
88
79
  $ cd monittr
89
80
  $ rake install
90
81
 
91
- Stable versions of the gem can be installed from _Rubygems_:
82
+ Stable versions of the gem can be installed from Rubygems:
92
83
 
93
84
  $ gem install monittr
94
85
 
95
86
 
96
87
  ## Other ##
97
88
 
98
- The code is useful for the intended purpose as it is, but if you've got any feedback, suggestions or patches, please send me an e-mail or use _Github_ Issues/Pull Requests.
89
+ Any feedback, suggestions or patches are welcome via [e-mail](mailto:karmi@karmi.cz) or Github Issues/Pull Requests.
99
90
 
100
- Check out the [_monit_](https://github.com/k33l0r/monit) gem for another Ruby interface to _Monit_.
91
+ Check out the [`monit`](https://github.com/k33l0r/monit) gem for another Ruby interface to _Monit_.
101
92
 
102
93
  -----
103
94
 
@@ -31,6 +31,8 @@ module Monittr
31
31
  @system = Services::Base.new :name => error.attributes['name'].content,
32
32
  :message => error.attributes['message'].content,
33
33
  :status => 3
34
+ @filesystems = []
35
+ @processes = []
34
36
  else
35
37
  @system = Services::System.new(@xml.xpath("//service[@type=5]").first)
36
38
  @filesystems = @xml.xpath("//service[@type=0]").map { |xml| Services::Filesystem.new(xml) }
@@ -1,3 +1,3 @@
1
1
  module Monittr
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -23,6 +23,8 @@ module Monittr
23
23
  assert_equal 2, cluster.servers.size
24
24
  assert_equal 3, cluster.servers.first.system.status
25
25
  assert cluster.servers.first.system.message =~ /bad hostname/, "Should be bad hostname"
26
+ assert_not_nil cluster.servers.first.filesystems
27
+ assert_equal [], cluster.servers.first.filesystems
26
28
  end
27
29
  end
28
30
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Karel Minarik