fluent-plugin-zabbix-agent 0.1.4 → 0.1.5

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: 27049880904ec28d2e2159623747826e6fac0b43
4
- data.tar.gz: 534b50053c659cd512c11e0f651a3006116ca7ad
3
+ metadata.gz: 9d7f2b2841901404b8aa1aed837046c9aa79f869
4
+ data.tar.gz: 9d6019d70e783ad42e3202b3952e44479fdcbf2f
5
5
  SHA512:
6
- metadata.gz: 1c2aee511111ea3bd9ecfc9fa1a862a797cb276b78680b191fc673af4b48353bdcedc05feb378c8c322d5730c7a473f530cab49f5fe51c24d9b40df2240954c7
7
- data.tar.gz: 861a09d4bdca8ad495923f36d49c9b007ec857fb27b13f1eef34ab548940f14e53b6f513d5967aed9f85729af86dcd64541e52c62a1d46f501dfe97e9efd0882
6
+ metadata.gz: 98334166453109edfd864d9b13cb0a14a393e6ec0dede2e1856b0427fb35b7f180b839ce2312a04447d0e4adc47e7c4d67cc83656ba057bd11abc039720b15ba
7
+ data.tar.gz: adf317734eff24096edf75015c64c3b1f12f0838c3bc378b758245532c4b9ad75845ff900486224c066e18d4b64d03e5f7012e3e8e8f12608f66ff4cd5d08bff
data/README.md CHANGED
@@ -47,6 +47,8 @@ Or install it yourself as:
47
47
  #items_file /path/to/items.json
48
48
  # or
49
49
  #items_file /path/to/conf.d/items-*.json
50
+ # or
51
+ #items_file http://path/to/items.json
50
52
  </source>
51
53
 
52
54
  ```
@@ -27,6 +27,7 @@ class Fluent::ZabbixAgentInput < Fluent::Input
27
27
  require 'socket'
28
28
  require 'zabbix_protocol'
29
29
  require 'json'
30
+ require 'open-uri'
30
31
  end
31
32
 
32
33
  def configure(conf)
@@ -41,10 +42,18 @@ class Fluent::ZabbixAgentInput < Fluent::Input
41
42
  if @items_file
42
43
  @items = {}
43
44
 
44
- Dir.glob(@items_file) do |path|
45
- file = File.read(path)
45
+ files = Dir.glob(@items_file)
46
+
47
+ if files.empty?
48
+ file = open(@items_file, &:read)
46
49
  json = JSON.load(file)
47
50
  @items.update(json) if json
51
+ else
52
+ Dir.glob(@items_file) do |path|
53
+ file = File.read(path)
54
+ json = JSON.load(file)
55
+ @items.update(json) if json
56
+ end
48
57
  end
49
58
  end
50
59
 
@@ -1,3 +1,3 @@
1
1
  module FluentPluginZabbixAgent
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
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.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara