fluent-plugin-df 0.0.5 → 0.0.6
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 +4 -4
- data/README.md +3 -1
- data/fluent-plugin-df.gemspec +1 -1
- data/lib/fluent/plugin/in_df.rb +4 -1
- data/test/plugin/test_in_df.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b346af2fc867b170e3a78ba14d8fd22fe9881442
|
4
|
+
data.tar.gz: db0a2fe25bbe25da862e0133c423dd0af45c9d7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9480a6db27b7a66fe066874c44abc6b0de54067cbbe3479050fb2a7f3a38e428a9fc0dccbb04e1a40f65dfc1867754f9d243be90ac67fa5ce9b28aed25c92fa1
|
7
|
+
data.tar.gz: 84f855b304a7a554ece8b61977f646f1f274d4ebc76f2cf381b4e98acaafac43bf16890cbfee0b46cac89905050b07ec5e3216fb1830dd5c0f472a40925bd6cd
|
data/README.md
CHANGED
@@ -26,13 +26,15 @@ Or install it yourself as:
|
|
26
26
|
target_mounts / # "Mounted on" to filter the information you want to retrieve
|
27
27
|
replace_slash true # whether to replace '_' by '/' in the file system
|
28
28
|
# tag free_disk # tag (default is nil)
|
29
|
+
rm_percent true # delete the percentage mark of capacity
|
30
|
+
hostname true # add to the record the results of the hostname command
|
29
31
|
</source>
|
30
32
|
|
31
33
|
If you specify more than one `target_mounts`, separated by spaces.
|
32
34
|
|
33
35
|
## Output Format
|
34
36
|
|
35
|
-
2013-03-01 00:00:00 +0900 df._dev_disk0s2: {"size":"487546976","used":"52533512","available":"434757464","capacity":"11"}
|
37
|
+
2013-03-01 00:00:00 +0900 df._dev_disk0s2: {"size":"487546976","used":"52533512","available":"434757464","capacity":"11","hostname":"my.local"}
|
36
38
|
|
37
39
|
If `tag` specified, character of `tag` is the Tag name.
|
38
40
|
|
data/fluent-plugin-df.gemspec
CHANGED
@@ -4,7 +4,7 @@ $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.
|
7
|
+
spec.version = "0.0.6"
|
8
8
|
spec.authors = ["tiwakawa"]
|
9
9
|
spec.email = ["tiwakawa@aiming-inc.com"]
|
10
10
|
spec.description = %q{Df input plugin for Fluent event collector}
|
data/lib/fluent/plugin/in_df.rb
CHANGED
@@ -11,6 +11,7 @@ module Fluent
|
|
11
11
|
config_param :replace_slash, :bool, default: true
|
12
12
|
config_param :tag, :string, default: nil
|
13
13
|
config_param :rm_percent, :bool, default: true
|
14
|
+
config_param :hostname, :bool, default: false
|
14
15
|
|
15
16
|
def configure(conf)
|
16
17
|
super
|
@@ -50,13 +51,15 @@ module Fluent
|
|
50
51
|
$log.warn "The output of the df command is unexpected. May not obtain the correct result."
|
51
52
|
end
|
52
53
|
|
53
|
-
{
|
54
|
+
df_info = {
|
54
55
|
'fs' => replace_slash_in(f[0]),
|
55
56
|
'size' => f[1],
|
56
57
|
'used' => f[2],
|
57
58
|
'available' => f[3],
|
58
59
|
'capacity' => f[4] && @rm_percent ? f[4].delete('%') : f[4]
|
59
60
|
}
|
61
|
+
df_info['hostname'] = `hostname`.chomp if @hostname
|
62
|
+
df_info
|
60
63
|
end
|
61
64
|
end
|
62
65
|
|
data/test/plugin/test_in_df.rb
CHANGED
@@ -13,6 +13,7 @@ class DfInputTest < Test::Unit::TestCase
|
|
13
13
|
replace_slash true
|
14
14
|
tag free_disk
|
15
15
|
rm_percent true
|
16
|
+
hostname false
|
16
17
|
]
|
17
18
|
|
18
19
|
def create_driver(conf=CONFIG)
|
@@ -28,6 +29,7 @@ class DfInputTest < Test::Unit::TestCase
|
|
28
29
|
assert_equal true, d.instance.replace_slash
|
29
30
|
assert_equal "free_disk", d.instance.tag
|
30
31
|
assert_equal true, d.instance.rm_percent
|
32
|
+
assert_equal false, d.instance.hostname
|
31
33
|
end
|
32
34
|
|
33
35
|
# def test_emit
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-df
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tiwakawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|