fluent-plugin-zabbix-agent 0.1.9 → 0.2.0

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: 6a64f2855d3ae4faad49ca79a4270eaebb3bcd7e
4
- data.tar.gz: 614ba107d5bf34550c0b50ed951b66545ce57e94
3
+ metadata.gz: 45296588e6dc58726e0e86ac22535cbfa65f1f97
4
+ data.tar.gz: 2b554f37bd12d77653c3d920d1994e63e2e8b924
5
5
  SHA512:
6
- metadata.gz: b8eae9d506468c45efea37dafa17e513977bb6fa6d212b0fd0670dc9f4c1c89653ee5341f83862d3aaf8e38cbb1ade5a9d3b45a4a70aad4cfd2340445f9c621f
7
- data.tar.gz: 818d8a363335565b2f120bcb6becc73405e30de4e0d2cb652af993bb1914431e4f5a77210f52b934e38e0354b6493733fc96e079bf94270ce33726f709f84735
6
+ metadata.gz: b10efadc433b726f7f2e44b2da1a8aebea1b2e32a1623e4fbd2c71aa07f1da23669c5d972d8f806ab4a2fa576dbc77fa15459274cd850e6c3ce8abc57f4b7084
7
+ data.tar.gz: 36812b8edb4c2617da803fca7f4a78822dc7dea17eee7339f46645247967fe0fc1b832f11fc39d49fd4e260543ab7ccbccf65de942ca89c6edacb2897b7e4e7e
data/README.md CHANGED
@@ -38,6 +38,8 @@ Or install it yourself as:
38
38
  #extra {}
39
39
  #bulk false
40
40
  #allow_items_empty false
41
+ #include_hostname false
42
+ #hostname_key hostname
41
43
 
42
44
  items {
43
45
  "system.cpu.load[all,avg1]": "load_avg1",
@@ -22,6 +22,8 @@ class Fluent::ZabbixAgentInput < Fluent::Input
22
22
  config_param :extra, :hash, :default => {}
23
23
  config_param :bulk, :bool, :default => false
24
24
  config_param :allow_items_empty, :bool, :default => false
25
+ config_param :include_hostname, :bool, :default => false
26
+ config_param :hostname_key, :string, :default => 'hostname'
25
27
 
26
28
  def initialize
27
29
  super
@@ -64,6 +66,10 @@ class Fluent::ZabbixAgentInput < Fluent::Input
64
66
  value = @items[key]
65
67
  @items[key] = key if value.nil?
66
68
  end
69
+
70
+ if @include_hostname
71
+ @extra.update(@hostname_key => hostname)
72
+ end
67
73
  end
68
74
 
69
75
  def start
@@ -151,6 +157,10 @@ class Fluent::ZabbixAgentInput < Fluent::Input
151
157
  end
152
158
  end
153
159
 
160
+ def hostname
161
+ `hostname`.strip
162
+ end
163
+
154
164
  class TimerWatcher < Coolio::TimerWatcher
155
165
  def initialize(interval, repeat, log, &callback)
156
166
  @callback = callback
@@ -1,3 +1,3 @@
1
1
  module FluentPluginZabbixAgent
2
- VERSION = '0.1.9'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-zabbix-agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara