fluent-plugin-df 0.0.2 → 0.0.3

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/README.md CHANGED
@@ -26,11 +26,11 @@ Or install it yourself as:
26
26
  target_mounts /
27
27
  </source>
28
28
 
29
- If you specify more than one `target_mounts`, separated by commas.
29
+ If you specify more than one `target_mounts`, separated by spaces.
30
30
 
31
31
  ## Output Format
32
32
 
33
- df._dev_disk0s2: {"size":"487546976","used":"52533512","avail":"434757464","capacity":"11"}
33
+ df._dev_disk0s2: {"size":"487546976","used":"52533512","available":"434757464","capacity":"11"}
34
34
 
35
35
  Tag name is the concatenation of the name of the `tag_prefix` and file system.
36
36
  `/` in the file system is replaced by an `_`
@@ -4,12 +4,12 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-df"
7
- spec.version = "0.0.2"
7
+ spec.version = "0.0.3"
8
8
  spec.authors = ["tiwakawa"]
9
9
  spec.email = ["tiwakawa@aiming-inc.com"]
10
- spec.description = %q{input plugin to get disk free data}
11
- spec.summary = %q{input plugin to get disk free data}
12
- spec.homepage = ""
10
+ spec.description = %q{Df input plugin for Fluent event collector}
11
+ spec.summary = %q{Df input plugin for Fluent event collector}
12
+ spec.homepage = "https://github.com/tiwakawa/fluent-plugin-df"
13
13
  spec.license = "MIT"
14
14
 
15
15
  spec.files = `git ls-files`.split($/)
@@ -9,7 +9,7 @@ module Fluent
9
9
 
10
10
  def configure(conf)
11
11
  super
12
- @command = "df #{@option}"
12
+ @command = "df #{@option} #{@target_mounts} 2> /dev/null"
13
13
  end
14
14
 
15
15
  def start
@@ -36,24 +36,18 @@ module Fluent
36
36
 
37
37
  private
38
38
  def df
39
- fss = `#{@command} 2> /dev/null`.split($/)
39
+ fss = `#{@command}`.split($/)
40
40
  fss.shift # remove header
41
41
  fss.map do |fs|
42
42
  f = fs.split(/\s+/)
43
- if arrayed_target_mounts.include?(f[5])
44
- {
45
- 'fs' => f[0].gsub(/\//, '_'),
46
- 'size' => f[1],
47
- 'used' => f[2],
48
- 'avail' => f[3],
49
- 'capacity' => f[4].delete('%')
50
- }
51
- end
52
- end.compact
53
- end
54
-
55
- def arrayed_target_mounts
56
- @target_mounts.gsub(/'/, '').split(',').map(&:strip)
43
+ {
44
+ 'fs' => f[0].gsub(/\//, '_'),
45
+ 'size' => f[1],
46
+ 'used' => f[2],
47
+ 'available' => f[3],
48
+ 'capacity' => f[4].delete('%')
49
+ }
50
+ end
57
51
  end
58
52
 
59
53
  def tag_name(fs)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-df
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-22 00:00:00.000000000 Z
12
+ date: 2013-03-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -59,7 +59,7 @@ dependencies:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
- description: input plugin to get disk free data
62
+ description: Df input plugin for Fluent event collector
63
63
  email:
64
64
  - tiwakawa@aiming-inc.com
65
65
  executables: []
@@ -75,7 +75,7 @@ files:
75
75
  - lib/fluent/plugin/in_df.rb
76
76
  - test/helper.rb
77
77
  - test/plugin/test_in_df.rb
78
- homepage: ''
78
+ homepage: https://github.com/tiwakawa/fluent-plugin-df
79
79
  licenses:
80
80
  - MIT
81
81
  post_install_message:
@@ -99,7 +99,7 @@ rubyforge_project:
99
99
  rubygems_version: 1.8.23
100
100
  signing_key:
101
101
  specification_version: 3
102
- summary: input plugin to get disk free data
102
+ summary: Df input plugin for Fluent event collector
103
103
  test_files:
104
104
  - test/helper.rb
105
105
  - test/plugin/test_in_df.rb