bipbip 0.7.17 → 0.7.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 461d733cb85b8d8d15d496debfff764cb0190f45
4
- data.tar.gz: 960ac32c4a77c99fc11a14da847c58de41c4c126
3
+ metadata.gz: 42c0f8f32ee4e6277d7bccda9ae53372a7f71701
4
+ data.tar.gz: 2229e84878e7368bdfa1781bd6c3e67425b82a78
5
5
  SHA512:
6
- metadata.gz: 5704ad306dc2960760e9f868d0aafe2ea42f97f8e4f41963842c3baeef7d73a52319d20317c60631ca7a999ebfd9fd3005342e4c78c9a4a4b1904911e6fd1d00
7
- data.tar.gz: ab2311a58a92ca89a956d0d98e938d4d8aa724f0dc01901f68edf2e17ddbf37716b2660632eb3f78c087ee2fa8c4c986e0878a30faea231c7a153f8abc3f8894
6
+ metadata.gz: cdf9307b47bba05fe25ca4d92f56887fce0142bbf07ddd25cc0b6a372d7a3519ea87f13781a14866c3a514d5ddcc11922668518d70e980701080caf097afd2ab
7
+ data.tar.gz: bbca7d58e7b933a60d19a79baed0017a6cdd8fc13b9a43d5b1b477d3e896f6eff1642007fe033ef7a57256f0e04ae0038b8f34f2a6167213686903d32e27ac1b
@@ -0,0 +1,27 @@
1
+ require 'open3'
2
+
3
+ module Bipbip
4
+ class Plugin::CommandStatus < Plugin
5
+ def metrics_schema
6
+ [
7
+ { name: 'status', type: 'gauge', unit: '' }
8
+ ]
9
+ end
10
+
11
+ def monitor
12
+ command = config['command'].to_s
13
+ output_stdout = output_stderr = exit_code = nil
14
+ Open3.popen3(command) do |_stdin, stdout, stderr, wait_thr|
15
+ output_stdout = stdout.read.chomp
16
+ output_stderr = stderr.read.chomp
17
+ exit_code = wait_thr.value
18
+ end
19
+
20
+ log(Logger::INFO, output_stdout) unless output_stdout.empty?
21
+ log(Logger::ERROR, output_stderr) unless output_stderr.empty?
22
+ {
23
+ status: exit_code.exitstatus
24
+ }
25
+ end
26
+ end
27
+ end
@@ -1,3 +1,3 @@
1
1
  module Bipbip
2
- VERSION = '0.7.17'.freeze
2
+ VERSION = '0.7.18'.freeze
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.7.17
4
+ version: 0.7.18
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: 2017-06-28 00:00:00.000000000 Z
13
+ date: 2017-07-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: copperegg-revealmetrics
@@ -311,6 +311,7 @@ files:
311
311
  - lib/bipbip/plugin.rb
312
312
  - lib/bipbip/plugin/apache2.rb
313
313
  - lib/bipbip/plugin/command.rb
314
+ - lib/bipbip/plugin/command_status.rb
314
315
  - lib/bipbip/plugin/coturn.rb
315
316
  - lib/bipbip/plugin/elasticsearch.rb
316
317
  - lib/bipbip/plugin/fastcgi_php_apc.rb
@@ -357,7 +358,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
357
358
  version: '0'
358
359
  requirements: []
359
360
  rubyforge_project:
360
- rubygems_version: 2.6.11
361
+ rubygems_version: 2.2.2
361
362
  signing_key:
362
363
  specification_version: 4
363
364
  summary: Gather services data and store in CopperEgg