fluent-plugin-zabbix-agent 0.1.0 → 0.1.1
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 +14 -11
- 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: 9e9e82ae6acd85c0a2bd78d03fdf9cc6b370f3b0
|
4
|
+
data.tar.gz: e68f51a774ec59b03a533d0563454a2c7fe9806d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47709b31852db97f53584c4722b7b64c226fd972de41f25d6e77893fc430a14cbff2d249c14819505e47f415911c5931bb75636177e3f52abaac7e5051d09593
|
7
|
+
data.tar.gz: e87acc4edf7640e60012f8044dd9f00af15efe6ef6e81ce28708b8ac6b6930458733484175df661d494850bbc0496b176fb072e12b825d01d5c06a57272b081c
|
data/README.md
CHANGED
@@ -11,21 +11,12 @@ class Fluent::ZabbixAgentInput < Fluent::Input
|
|
11
11
|
define_method('router') { Fluent::Engine }
|
12
12
|
end
|
13
13
|
|
14
|
-
def initialize
|
15
|
-
super
|
16
|
-
require 'csv'
|
17
|
-
require 'fileutils'
|
18
|
-
require 'logger'
|
19
|
-
require 'time'
|
20
|
-
require 'addressable/uri'
|
21
|
-
require 'aws-sdk'
|
22
|
-
end
|
23
|
-
|
24
14
|
config_param :agent_host, :string, :default => '127.0.0.1'
|
25
15
|
config_param :agent_port, :integer, :default => 10050
|
26
16
|
config_param :interval, :time, :default => 60
|
27
17
|
config_param :tag, :string, :default => 'zabbix.item'
|
28
|
-
config_param :items, :hash
|
18
|
+
config_param :items, :hash, :default => nil
|
19
|
+
config_param :items_file, :string, :default => nil
|
29
20
|
config_param :extra, :hash, :default => {}
|
30
21
|
config_param :bulk, :bool, :default => false
|
31
22
|
|
@@ -33,11 +24,23 @@ class Fluent::ZabbixAgentInput < Fluent::Input
|
|
33
24
|
super
|
34
25
|
require 'socket'
|
35
26
|
require 'zabbix_protocol'
|
27
|
+
require 'json'
|
36
28
|
end
|
37
29
|
|
38
30
|
def configure(conf)
|
39
31
|
super
|
40
32
|
|
33
|
+
if @items.nil? and @items_file.nil?
|
34
|
+
raise Fluent::ConfigError, 'One of "items" or "items_file" is required'
|
35
|
+
elsif @items and @items_file
|
36
|
+
raise %!It isn't possible to specify both of items" and "items_file"!
|
37
|
+
end
|
38
|
+
|
39
|
+
if @items_file
|
40
|
+
@items = File.read(@items_file)
|
41
|
+
@items = JSON.load(@items)
|
42
|
+
end
|
43
|
+
|
41
44
|
@items.keys.each do |key|
|
42
45
|
value = @items[key]
|
43
46
|
@items[key] = key if value.nil?
|