bipbip 0.2.9 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5ea8d18b7e7edf039a1ca434ffaee257724342b
4
- data.tar.gz: 52187036d55b68d80df31028f79531ac5a1395c5
3
+ metadata.gz: e2d6d7ff483fb383c49e134f961b60361b7a9eac
4
+ data.tar.gz: effa9e0c6d22d39b4fedb9c81f9fc059545f087b
5
5
  SHA512:
6
- metadata.gz: f962bb480c2932d36167697d17525faf800aca8b4fbd4f66bbc15528897521e3d80e3d19c1a77653090f683c416ee4649cd45021f1c8d2b5061ba68a8160d092
7
- data.tar.gz: 21647e1873392f7c5ebea6e72fb7ed8f76e260f06d46d136b781911dce3ff383d7549d02cd85033b09a02e422f016edf64f3e04311633384bf62a2fe134ac976
6
+ metadata.gz: f810ebeefbe757e1c627e179818b4535099b4cb6be08ad5e0bb4c78dca42a708499725b2c6d77cb865fc456521307d6bf0f31b8bfeccf4049b72b4f931eecc1d
7
+ data.tar.gz: 9c5c3908dd2ad2539514841b1c669943d308dc3e6edf3e1d8585a73f03642ca5a0e4835c558d2f5b745c970b95b5edc589551f63a28cd6d2af6b92f52ea6646a
@@ -0,0 +1,31 @@
1
+ require 'monit'
2
+
3
+ module Bipbip
4
+
5
+ class Plugin::Monit < Plugin
6
+
7
+ def metrics_schema
8
+ [
9
+ {:name => 'Running', :type => 'gauge', :unit => 'Boolean'},
10
+ {:name => 'All_Services_ok', :type => 'gauge', :unit => 'Boolean'},
11
+ ]
12
+ end
13
+
14
+ def monitor
15
+ status = ::Monit::Status.new(
16
+ :host => config['host'],
17
+ :auth => config['auth']
18
+ )
19
+ data = Hash.new(0)
20
+
21
+ begin
22
+ data['Running'] = status.get ? 1 : 0
23
+ data['All_Services_ok'] = status.services.any? { |service| service.monitor != '1' || service.status != '0' } ? 0 : 1
24
+ rescue
25
+ data['Running'] = 0
26
+ data['All_Services_ok'] = 0
27
+ end
28
+ data
29
+ end
30
+ end
31
+ end
@@ -1,3 +1,3 @@
1
1
  module Bipbip
2
- VERSION = '0.2.9'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bipbip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cargo Media
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-05-08 00:00:00.000000000 Z
13
+ date: 2014-06-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: copperegg
@@ -96,6 +96,20 @@ dependencies:
96
96
  - - "~>"
97
97
  - !ruby/object:Gem::Version
98
98
  version: '1.25'
99
+ - !ruby/object:Gem::Dependency
100
+ name: monit
101
+ requirement: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - "~>"
104
+ - !ruby/object:Gem::Version
105
+ version: '0.3'
106
+ type: :runtime
107
+ prerelease: false
108
+ version_requirements: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - "~>"
111
+ - !ruby/object:Gem::Version
112
+ version: '0.3'
99
113
  - !ruby/object:Gem::Dependency
100
114
  name: rake
101
115
  requirement: !ruby/object:Gem::Requirement
@@ -146,6 +160,7 @@ files:
146
160
  - lib/bipbip/plugin/fastcgi_php_opcache.rb
147
161
  - lib/bipbip/plugin/gearman.rb
148
162
  - lib/bipbip/plugin/memcached.rb
163
+ - lib/bipbip/plugin/monit.rb
149
164
  - lib/bipbip/plugin/mysql.rb
150
165
  - lib/bipbip/plugin/network.rb
151
166
  - lib/bipbip/plugin/nginx.rb
@@ -176,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
191
  version: '0'
177
192
  requirements: []
178
193
  rubyforge_project:
179
- rubygems_version: 2.2.2
194
+ rubygems_version: 2.3.0
180
195
  signing_key:
181
196
  specification_version: 4
182
197
  summary: Gather services data and store in CopperEgg