bipbip 0.7.17 → 0.7.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bipbip/plugin/command_status.rb +27 -0
- data/lib/bipbip/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42c0f8f32ee4e6277d7bccda9ae53372a7f71701
|
4
|
+
data.tar.gz: 2229e84878e7368bdfa1781bd6c3e67425b82a78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/bipbip/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|