fluent-plugin-zabbix 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{README.rdoc → README.md} +23 -11
- data/fluent-plugin-zabbix.gemspec +2 -1
- data/lib/fluent/plugin/out_zabbix.rb +10 -2
- data/test/plugin/test_out_zabbix.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 778dffb330bf90f5e65b9bab2b57ca3fb29bbee6
|
4
|
+
data.tar.gz: 26d030c79c0680a76a387e0edb61e2ddd9ecf5d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb3f14d22487dc1b29002b447da2459ec2905e4ab46ab98a2ae779bae45fe4544444b0f2619dbca70f9a40a81bebd03ea1c08903546f41e62368761cdd2fd860
|
7
|
+
data.tar.gz: a198b9002377c9adb801dab673193c12f2a29964e3d3bf04bcb9eeed40cb7e5de86d3100748b8bd9ee31a55b47d28414185695271f51efc009675b29dad1e578
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,14 +1,14 @@
|
|
1
|
-
|
1
|
+
# fluent-plugin-zabbix
|
2
2
|
|
3
|
-
|
3
|
+
## Component
|
4
4
|
|
5
|
-
|
5
|
+
### ZabbixOutput
|
6
6
|
|
7
7
|
Plugin to output values to Zabbix server.
|
8
8
|
|
9
|
-
|
9
|
+
## Configuration
|
10
10
|
|
11
|
-
|
11
|
+
### ZabbixOutput
|
12
12
|
|
13
13
|
Zabbix configuration of Item:
|
14
14
|
|
@@ -20,7 +20,7 @@ Zabbix configuration of Item:
|
|
20
20
|
|
21
21
|
For messages such as:
|
22
22
|
tag:metrics {"metrics.field1":300, "metrics.field2":20}
|
23
|
-
|
23
|
+
|
24
24
|
<match metrics>
|
25
25
|
type zabbix
|
26
26
|
zabbix_server 192.168.0.1
|
@@ -29,7 +29,7 @@ For messages such as:
|
|
29
29
|
name_keys metrics.field1,metrics.field2
|
30
30
|
</match>
|
31
31
|
|
32
|
-
or, use
|
32
|
+
or, use `add_key_prefix`
|
33
33
|
tag:metrics {"field1":300, "field2":20}
|
34
34
|
|
35
35
|
<match metrics>
|
@@ -52,11 +52,23 @@ If you want to specify the host(on zabbix) from record's value, use "host_key" d
|
|
52
52
|
name_keys metrics.field1,metrics.field2
|
53
53
|
</match>
|
54
54
|
|
55
|
-
|
55
|
+
v0.0.7~ includes [Fluent::Mixin::ConfigPlaceholders](https://github.com/tagomoris/fluent-mixin-config-placeholders). Placeholders will be expanded in a configuration.
|
56
|
+
|
57
|
+
```
|
58
|
+
<match matrics.**>
|
59
|
+
type zabbix
|
60
|
+
zabbix_server 192.168.0.1
|
61
|
+
host ${hostname}
|
62
|
+
add_key_prefix ${tag}
|
63
|
+
name_key_pattern .
|
64
|
+
</match>
|
65
|
+
```
|
66
|
+
|
67
|
+
# TODO
|
56
68
|
|
57
69
|
- patches welcome!
|
58
70
|
|
59
|
-
|
71
|
+
## Copyright
|
60
72
|
|
61
|
-
Copyright
|
62
|
-
License
|
73
|
+
- Copyright: Copyright (c) 2012- FUJIWARA Shunichiro
|
74
|
+
- License: Apache License, Version 2.0
|
@@ -13,10 +13,11 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
14
|
gem.name = "fluent-plugin-zabbix"
|
15
15
|
gem.require_paths = ["lib"]
|
16
|
-
gem.version = "0.0.
|
16
|
+
gem.version = "0.0.7"
|
17
17
|
|
18
18
|
gem.add_runtime_dependency "fluentd", "~> 0.10"
|
19
19
|
gem.add_runtime_dependency "yajl-ruby", "~> 1.0"
|
20
|
+
gem.add_runtime_dependency "fluent-mixin-config-placeholders", "~> 0.3"
|
20
21
|
gem.add_development_dependency "rake", ">= 0.9.2"
|
21
22
|
gem.add_development_dependency "glint", "= 0.0.2"
|
22
23
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'fluent/mixin/config_placeholders'
|
2
|
+
|
1
3
|
class Fluent::ZabbixOutput < Fluent::Output
|
2
4
|
Fluent::Plugin.register_output('zabbix', self)
|
3
5
|
|
@@ -17,7 +19,9 @@ class Fluent::ZabbixOutput < Fluent::Output
|
|
17
19
|
config_param :name_key_pattern, :string, :default => nil
|
18
20
|
config_param :add_key_prefix, :string, :default => nil
|
19
21
|
|
20
|
-
|
22
|
+
include Fluent::Mixin::ConfigPlaceholders
|
23
|
+
|
24
|
+
# Define `log` method for v0.10.42 or earlier
|
21
25
|
unless method_defined?(:log)
|
22
26
|
define_method("log") { $log }
|
23
27
|
end
|
@@ -53,7 +57,11 @@ class Fluent::ZabbixOutput < Fluent::Output
|
|
53
57
|
|
54
58
|
def send(host, tag, name, value, time)
|
55
59
|
if @add_key_prefix
|
56
|
-
|
60
|
+
if @add_key_prefix == '${tag}'
|
61
|
+
name = "#{tag}.#{name}"
|
62
|
+
else
|
63
|
+
name = "#{@add_key_prefix}.#{name}"
|
64
|
+
end
|
57
65
|
end
|
58
66
|
begin
|
59
67
|
sock = TCPSocket.open(@zabbix_server, @port)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-zabbix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- FUJIWARA Shunichiro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: fluent-mixin-config-placeholders
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.3'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.3'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -78,7 +92,7 @@ files:
|
|
78
92
|
- Gemfile
|
79
93
|
- Gemfile.fluentd.lt.0.10.43
|
80
94
|
- LICENSE
|
81
|
-
- README.
|
95
|
+
- README.md
|
82
96
|
- Rakefile
|
83
97
|
- fluent-plugin-zabbix.gemspec
|
84
98
|
- lib/fluent/plugin/out_zabbix.rb
|