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 +4 -4
- data/README.md +2 -0
- data/lib/fluent/plugin/in_zabbix_agent.rb +11 -2
- data/lib/fluent_plugin_zabbix_agent/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d7f2b2841901404b8aa1aed837046c9aa79f869
|
4
|
+
data.tar.gz: 9d6019d70e783ad42e3202b3952e44479fdcbf2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98334166453109edfd864d9b13cb0a14a393e6ec0dede2e1856b0427fb35b7f180b839ce2312a04447d0e4adc47e7c4d67cc83656ba057bd11abc039720b15ba
|
7
|
+
data.tar.gz: adf317734eff24096edf75015c64c3b1f12f0838c3bc378b758245532c4b9ad75845ff900486224c066e18d4b64d03e5f7012e3e8e8f12608f66ff4cd5d08bff
|
data/README.md
CHANGED
@@ -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)
|
45
|
-
|
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
|
|