fluent-plugin-munin-node 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee769965d53c56afa58d2d2ba89177b81645980f
4
- data.tar.gz: 5bd42c213c57ba9a18d9c7493ab66a9e4740ab39
3
+ metadata.gz: 40715938a20832b9b2cd85e39c40ced5ea5f74ce
4
+ data.tar.gz: 3f532fb1d6dd01309a2bc11d09a4035eb6ae3f12
5
5
  SHA512:
6
- metadata.gz: aa4a147a3036122b811af47008a7c9366eee2d420132bf8bf714ffca518f00a63b6496ad22df8687cd348427ed5cc65bfdaffc917d81809aee9c0ed783bf8cde
7
- data.tar.gz: e93447ba38f5111b2d0d1b34d93cc79da379241a540c867a871664d629b5a05f858ff03757ba2dd671857ce554bf65e216390fcba5c99a97f72fe6081e72a2fd
6
+ metadata.gz: 97d5f677b50cac77e091e30d3a101e80ba5a94f0c9d5da4707742b85c58851cb613ce99381ead9040121d75d137a5c426518533219c138754f1ab5b6767bc8af
7
+ data.tar.gz: aa23d05edd9be3de41846c9ab9d513bdef97150def68245de629356efa9466763b8b5f4924871129f1931e3c0415b59d882ab5072012cff36e21acc6ef0f0154
data/README.md CHANGED
@@ -39,6 +39,8 @@ Or install it yourself as:
39
39
  #bulk false
40
40
  #include_service (cpu|entropy) # regular expression
41
41
  #exclude_service df.* # regular expression
42
+ #include_hostname false
43
+ #hostname_key hostname
42
44
  </source>
43
45
  ```
44
46
 
@@ -11,18 +11,20 @@ class Fluent::MuninNodeInput < Fluent::Input
11
11
  define_method('router') { Fluent::Engine }
12
12
  end
13
13
 
14
- config_param :node_host, :string, :default => '127.0.0.1'
15
- config_param :node_port, :integer, :default => 4949
16
- config_param :interval, :time, :default => 60
17
- config_param :tag_prefix, :string, :default => 'munin'
18
- config_param :bulk_suffix, :string, :default => 'metrics'
19
- config_param :service_key, :string, :default => 'service'
20
- config_param :field_key, :string, :default => 'field'
21
- config_param :value_key, :string, :default => 'value'
22
- config_param :extra, :hash, :default => {}
23
- config_param :bulk, :bool, :default => false
24
- config_param :include_service, :string, :default => nil
25
- config_param :exclude_service, :string, :default => nil
14
+ config_param :node_host, :string, :default => '127.0.0.1'
15
+ config_param :node_port, :integer, :default => 4949
16
+ config_param :interval, :time, :default => 60
17
+ config_param :tag_prefix, :string, :default => 'munin'
18
+ config_param :bulk_suffix, :string, :default => 'metrics'
19
+ config_param :service_key, :string, :default => 'service'
20
+ config_param :field_key, :string, :default => 'field'
21
+ config_param :value_key, :string, :default => 'value'
22
+ config_param :extra, :hash, :default => {}
23
+ config_param :bulk, :bool, :default => false
24
+ config_param :include_service, :string, :default => nil
25
+ config_param :exclude_service, :string, :default => nil
26
+ config_param :include_hostname, :bool, :default => false
27
+ config_param :hostname_key, :string, :default => 'hostname'
26
28
 
27
29
  def initialize
28
30
  super
@@ -34,6 +36,10 @@ class Fluent::MuninNodeInput < Fluent::Input
34
36
 
35
37
  @include_service = Regexp.new(@include_service) if @include_service
36
38
  @exclude_service = Regexp.new(@exclude_service) if @exclude_service
39
+
40
+ if @include_hostname
41
+ @extra.update(@hostname_key => hostname)
42
+ end
37
43
  end
38
44
 
39
45
  def start
@@ -121,6 +127,10 @@ class Fluent::MuninNodeInput < Fluent::Input
121
127
  services
122
128
  end
123
129
 
130
+ def hostname
131
+ `hostname`.strip
132
+ end
133
+
124
134
  class TimerWatcher < Coolio::TimerWatcher
125
135
  def initialize(interval, repeat, log, &callback)
126
136
  @callback = callback
@@ -1,3 +1,3 @@
1
1
  module FluentPluginMuninNode
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-munin-node
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-15 00:00:00.000000000 Z
11
+ date: 2015-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd