fluent-plugin-zabbix-agent 0.1.2 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 90b064b3363a061c4ddb2c5ea48ccc6ca6109cc7
4
- data.tar.gz: 73ec863548405ec6471329f375b362e0f384889a
3
+ metadata.gz: 70ea3efb9f6850bc5baaf5edfd4ba7ceaa5f2727
4
+ data.tar.gz: 42e89b3a717f56601aad4ba89ef46f6485ab2abf
5
5
  SHA512:
6
- metadata.gz: 1d1da1ac043177d538f053216c2e334c0654d839f13c47b3077599b2439e90ab059f1059db8b423772a9d6dada4b8510cc9219022617a22a67241c824ccb623f
7
- data.tar.gz: bfdaf09ae1e7acf7b6dab73732644eb3972cbbc4ce996750a3b03adea33e892508688b1446c8e365357c4278b8422aea72954af2ad6f6d4f7a8710e4d674e68a
6
+ metadata.gz: 0cc4ddd43188a5c2d8172e3a13c611a956b7c9f3553ceeb48c406e379e4c7cf91e16cb78667bcbaf072b9774621c8d240c9a368aca9c05bbd865feabbf4d1edd
7
+ data.tar.gz: d92ac6db472f9f14b2d391e1e863725349ce9a52186446bbcb5759af98578973f41b6b59f952141a7d61c092a7d18788bc4a05e5d4ba1a43a8976fe5c7338b57
data/README.md CHANGED
@@ -43,6 +43,8 @@ Or install it yourself as:
43
43
  }
44
44
  # or
45
45
  #items_file /path/to/items.json
46
+ # or
47
+ #items_file /path/to/conf.d/items-*.json
46
48
  </source>
47
49
 
48
50
  ```
@@ -33,12 +33,21 @@ class Fluent::ZabbixAgentInput < Fluent::Input
33
33
  if @items.nil? and @items_file.nil?
34
34
  raise Fluent::ConfigError, 'One of "items" or "items_file" is required'
35
35
  elsif @items and @items_file
36
- raise %!It isn't possible to specify both of items" and "items_file"!
36
+ raise Fluent::ConfigError, %!It isn't possible to specify both of items" and "items_file"!
37
37
  end
38
38
 
39
39
  if @items_file
40
- @items = File.read(@items_file)
41
- @items = JSON.load(@items)
40
+ @items = {}
41
+
42
+ Dir.glob(@items_file) do |path|
43
+ file = File.read(path)
44
+ json = JSON.load(file)
45
+ @items.update(json) if json
46
+ end
47
+ end
48
+
49
+ if @items.empty?
50
+ raise Fluent::ConfigError, '"items" or "items_file" is empty'
42
51
  end
43
52
 
44
53
  @items.keys.each do |key|
@@ -1,3 +1,3 @@
1
1
  module FluentPluginZabbixAgent
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
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.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara