riemann-babbler 1.4.0 → 2.0.0pre1
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.
- data/.gitignore +2 -0
- data/Gemfile +2 -16
- data/Gemfile.lock +25 -39
- data/LICENSE.txt +22 -0
- data/README.md +18 -16
- data/bin/riemann-babbler +30 -10
- data/lib/riemann/babbler/errors.rb +13 -0
- data/lib/riemann/babbler/logging.rb +36 -0
- data/lib/riemann/babbler/{support/deep_merge.rb → monkey_patches.rb} +25 -16
- data/lib/riemann/babbler/options.rb +43 -0
- data/lib/riemann/babbler/plugin.rb +154 -0
- data/lib/riemann/babbler/plugin_loader.rb +86 -0
- data/lib/riemann/babbler/plugins/cpu.rb +14 -11
- data/lib/riemann/babbler/plugins/cpu_fan.rb +2 -2
- data/lib/riemann/babbler/plugins/cpu_temp.rb +2 -2
- data/lib/riemann/babbler/plugins/disk.rb +12 -6
- data/lib/riemann/babbler/plugins/{diskstat.rb → disk_stat.rb} +18 -18
- data/lib/riemann/babbler/plugins/errors_reporter.rb +34 -0
- data/lib/riemann/babbler/plugins/exim4.rb +2 -2
- data/lib/riemann/babbler/plugins/find_files.rb +7 -7
- data/lib/riemann/babbler/plugins/haproxy.rb +7 -7
- data/lib/riemann/babbler/plugins/helpers/init.rb +2 -0
- data/lib/riemann/babbler/plugins/helpers/rest.rb +28 -0
- data/lib/riemann/babbler/plugins/helpers/shell.rb +37 -0
- data/lib/riemann/babbler/plugins/http.rb +4 -6
- data/lib/riemann/babbler/plugins/la.rb +11 -3
- data/lib/riemann/babbler/plugins/mdadm.rb +10 -10
- data/lib/riemann/babbler/plugins/mega_cli.rb +2 -2
- data/lib/riemann/babbler/plugins/memory.rb +21 -17
- data/lib/riemann/babbler/plugins/net.rb +7 -5
- data/lib/riemann/babbler/plugins/net_stat.rb +5 -5
- data/lib/riemann/babbler/plugins/nginx.rb +2 -2
- data/lib/riemann/babbler/plugins/pgsql.rb +13 -13
- data/lib/riemann/babbler/plugins/runit.rb +6 -7
- data/lib/riemann/babbler/plugins/status_file.rb +4 -4
- data/lib/riemann/babbler/plugins/tw_cli.rb +5 -5
- data/lib/riemann/babbler/responder.rb +45 -0
- data/lib/riemann/babbler/sender.rb +102 -0
- data/lib/riemann/babbler/version.rb +2 -2
- data/lib/riemann/babbler.rb +8 -175
- data/riemann-babbler.gemspec +30 -26
- metadata +39 -38
- data/config.yml +0 -72
- data/lib/riemann/babbler/plugins/dummy.rb +0 -12
- data/lib/riemann/babbler/start.rb +0 -159
- data/lib/riemann/babbler/support/errors.rb +0 -3
- data/lib/riemann/babbler/support/monkey_patches.rb +0 -42
- data/lib/riemann/babbler/support/plugin_helpers.rb +0 -104
- data/lib/riemann/babbler/support/responder.rb +0 -29
- data/spec/config.yml +0 -15
- data/spec/default.rb +0 -61
data/spec/default.rb
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
#encoding: utf-8
|
2
|
-
|
3
|
-
require 'riemann/babbler'
|
4
|
-
require 'riemann/babbler/version'
|
5
|
-
require 'riemann/babbler/start'
|
6
|
-
require 'configatron'
|
7
|
-
|
8
|
-
opts = Hash.new
|
9
|
-
opts[:config] = File.expand_path('../config.yml', __FILE__)
|
10
|
-
|
11
|
-
babbler = Riemann::Babbler::Starter.new(opts, configatron)
|
12
|
-
|
13
|
-
describe Riemann::Babbler do
|
14
|
-
|
15
|
-
it 'Merge config' do
|
16
|
-
babbler.merge_config
|
17
|
-
configatron.riemann.host.should eq 'hostname_does_not_exists'
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'Set logger lvl' do
|
21
|
-
babbler.set_logger_config
|
22
|
-
babbler.logger.level.should eq 4
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'Load plugins' do
|
26
|
-
babbler.load_plugins
|
27
|
-
Riemann::Babbler.registered_plugins.should include( Riemann::Babbler::Dummy )
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'Started plugins' do
|
31
|
-
babbler.started_plugins.should include( Riemann::Babbler::Dummy )
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'Parent plugins' do
|
35
|
-
babbler.started_plugins.should include( Riemann::Babbler::Dummy2 )
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'Custom parent plugin start' do
|
39
|
-
dummyplugin = Riemann::Babbler::Dummy2.new(configatron, nil, nil)
|
40
|
-
configatron.plugins.dummy2.to_hash.should include(:run => false)
|
41
|
-
dummyplugin.plugin.run.should eq false
|
42
|
-
dummyplugin.plugin.interval.should eq 2000
|
43
|
-
dummyplugin.run.should eq 0
|
44
|
-
end
|
45
|
-
|
46
|
-
it 'Shell helper' do
|
47
|
-
dummyplugin = Riemann::Babbler::Dummy2.new(configatron, nil, nil)
|
48
|
-
dummyplugin.shell("echo 'a' | wc -l").to_i.should eq 1
|
49
|
-
end
|
50
|
-
|
51
|
-
it 'RestGet helper' do
|
52
|
-
dummyplugin = Riemann::Babbler::Dummy2.new(configatron, nil, nil)
|
53
|
-
dummyplugin.rest_get('http://ya.ru').should include 'yandex.ru'
|
54
|
-
end
|
55
|
-
|
56
|
-
it 'TcpPortAviable helper' do
|
57
|
-
dummyplugin = Riemann::Babbler::Dummy2.new(configatron, nil, nil)
|
58
|
-
dummyplugin.tcp_port_aviable?('www.ya.ru', 80).should eq true
|
59
|
-
end
|
60
|
-
|
61
|
-
end
|