fluent-plugin-munin 0.0.1 → 0.1.1

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/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- # Specify your gem's dependencies in fluent-plugin-twitter.gemspec
3
+ # Specify your gem's dependencies in fluent-plugin-munin.gemspec
4
4
  gemspec
5
5
  gem "munin-ruby"
data/README.md CHANGED
@@ -2,7 +2,7 @@ fluent-plugin-munin
2
2
  ===================
3
3
 
4
4
  ## Component
5
- Fluentd Input plugin. fetch munin-node metrics data with custom intervals.
5
+ Fluentd Input plugin to fetch munin-node metrics data with custom intervals.
6
6
 
7
7
  ## Installation
8
8
 
@@ -23,12 +23,12 @@ gem install fluent-plugin-munin
23
23
  `````
24
24
  <source>
25
25
  type munin
26
- server localhost
27
- port 4949
28
- interval 10
29
- tag_prefix input.munin
30
- service cpu,df
31
- record_hostname yes
26
+ server localhost # Optional (default: localhost)
27
+ port 4949 # Optional (default: 4949)
28
+ interval 10s # Optional (default: 1m)
29
+ tag_prefix input.munin # Required
30
+ service cpu,df # Optional (not specify, fetch all enabled munin metrics)
31
+ record_hostname yes # Optional (yes/no)
32
32
  </source>
33
33
 
34
34
  <match input.munin.*>
@@ -3,11 +3,11 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "fluent-plugin-munin"
6
- s.version = "0.0.1"
6
+ s.version = "0.1.1"
7
7
  s.authors = ["Kentaro Yoshida"]
8
8
  s.email = ["y.ken.studio@gmail.com"]
9
9
  s.homepage = "https://github.com/y-ken/fluent-plugin-munin"
10
- s.summary = %q{Fluentd Input plugin. fetch munin-node metrics data with custom intervals.}
10
+ s.summary = %q{Fluentd Input plugin to fetch munin-node metrics data with custom intervals.}
11
11
 
12
12
  s.files = `git ls-files`.split("\n")
13
13
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -1,23 +1,25 @@
1
1
  module Fluent
2
2
  class MuninInput < Fluent::Input
3
3
  Plugin.register_input('munin', self)
4
- require 'munin-ruby'
4
+
5
5
  def initialize
6
+ require 'munin-ruby'
6
7
  super
7
8
  end
8
9
 
9
10
  config_param :host, :string, :default => 'localhost'
10
11
  config_param :port, :integer, :default => 4949
11
- config_param :interval, :integer, :default => 1
12
+ config_param :interval, :string, :default => '1m'
12
13
  config_param :tag_prefix, :string
13
- config_param :service, :string, :default => nil
14
+ config_param :service, :string, :default => 'all'
14
15
  config_param :record_hostname, :string, :default => nil
15
16
 
16
17
  def configure(conf)
17
18
  super
18
19
  service_list = get_service_list
19
20
  $log.info "munin-node provides #{service_list.inspect}"
20
- @services = @service.nil? ? service_list : @service.split(',')
21
+ @interval = Config.time_value(@interval)
22
+ @services = @service == 'all' ? service_list : @service.split(',')
21
23
  @record_hostname = @record_hostname || false
22
24
  @hostname = `hostname`.chomp
23
25
  end
@@ -28,7 +30,8 @@ module Fluent
28
30
 
29
31
  def shutdown
30
32
  disconnect
31
- @thread.join
33
+ @munin.disconnect(false)
34
+ Thread.kill(@thread)
32
35
  end
33
36
 
34
37
  def run
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-munin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-03 00:00:00.000000000 Z
12
+ date: 2012-10-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
16
- requirement: &21592420 !ruby/object:Gem::Requirement
16
+ requirement: &8370700 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *21592420
24
+ version_requirements: *8370700
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: fluentd
27
- requirement: &21591140 !ruby/object:Gem::Requirement
27
+ requirement: &8369440 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *21591140
35
+ version_requirements: *8369440
36
36
  description:
37
37
  email:
38
38
  - y.ken.studio@gmail.com
@@ -72,7 +72,7 @@ rubyforge_project:
72
72
  rubygems_version: 1.8.11
73
73
  signing_key:
74
74
  specification_version: 3
75
- summary: Fluentd Input plugin. fetch munin-node metrics data with custom intervals.
75
+ summary: Fluentd Input plugin to fetch munin-node metrics data with custom intervals.
76
76
  test_files:
77
77
  - test/helper.rb
78
78
  - test/plugin/test_in_munin.rb