logstash-codec-collectd 3.0.3 → 3.0.4

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: 322604cfe191bf4f20131a1c189d28487c4076b3
4
- data.tar.gz: 38cd8905eeb1f231ab883e123374af6bb0fb2cbf
3
+ metadata.gz: decc3be655939a06a907407677c23e75286dd70b
4
+ data.tar.gz: 7df39f00db930c448f03679e8dac5a3e18476cc3
5
5
  SHA512:
6
- metadata.gz: 1f5b7aaba18ec50b81cbb8a810b81c13a7cb554ec8b6708dc62c402c78277ccb7ab14b9fb9c22809c2d93bd49360c769d05633f5db44d40513293118d101e64c
7
- data.tar.gz: afebec996e0a9ee6e467815b11e538af6ed382a18b11f98ade55ec87829b79249a744b19c36d0ebe8a3b342e32c4ea964f25dff7f249abb183c39f4770f27564
6
+ metadata.gz: eadab78a1e9ed8c9ebdeaf64f123b8a534829f09aaf1273f53eb8b5e4c75fefda80111bfe6948ad3f9d196138b6817a8f2cff4d5a6c5b325ee411843d7c39cb2
7
+ data.tar.gz: 6a723a6cb8c4d37f34e377ff5e0dc6f7435c5ddbcb0182f7977a054ece840d19fb4b32c93d5b7c5a4daaabd7b06e609ba00e650f800bf844645702120ec0a15e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.0.4
2
+ - Make this plugins compatible with JRuby 9 by using the OpenSSL::HMAC class and keep it backward compatible with JRuby 1.7.25 (Issue #24)
3
+
1
4
  ## 3.0.3
2
5
  - Fix log levels
3
6
 
data/Gemfile CHANGED
@@ -1,4 +1,11 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in logstash-mass_effect.gemspec
4
3
  gemspec
4
+
5
+ logstash_path = ENV["LOGSTASH_PATH"] || "../../logstash"
6
+ use_logstash_source = ENV["LOGSTASH_SOURCE"] && ENV["LOGSTASH_SOURCE"].to_s == "1"
7
+
8
+ if Dir.exist?(logstash_path) && use_logstash_source
9
+ gem 'logstash-core', :path => "#{logstash_path}/logstash-core"
10
+ gem 'logstash-core-plugin-api', :path => "#{logstash_path}/logstash-core-plugin-api"
11
+ end
@@ -0,0 +1,147 @@
1
+ :plugin: collectd
2
+ :type: codec
3
+
4
+ ///////////////////////////////////////////
5
+ START - GENERATED VARIABLES, DO NOT EDIT!
6
+ ///////////////////////////////////////////
7
+ :version: %VERSION%
8
+ :release_date: %RELEASE_DATE%
9
+ :changelog_url: %CHANGELOG_URL%
10
+ :include_path: ../../../logstash/docs/include
11
+ ///////////////////////////////////////////
12
+ END - GENERATED VARIABLES, DO NOT EDIT!
13
+ ///////////////////////////////////////////
14
+
15
+ [id="plugins-{type}-{plugin}"]
16
+
17
+ === Collectd
18
+
19
+ include::{include_path}/plugin_header.asciidoc[]
20
+
21
+ ==== Description
22
+
23
+ Read events from the collectd binary protocol over the network via udp.
24
+ See https://collectd.org/wiki/index.php/Binary_protocol
25
+
26
+ Configuration in your Logstash configuration file can be as simple as:
27
+ [source,ruby]
28
+ input {
29
+ udp {
30
+ port => 25826
31
+ buffer_size => 1452
32
+ codec => collectd { }
33
+ }
34
+ }
35
+
36
+ A sample `collectd.conf` to send to Logstash might be:
37
+ [source,xml]
38
+ Hostname "host.example.com"
39
+ LoadPlugin interface
40
+ LoadPlugin load
41
+ LoadPlugin memory
42
+ LoadPlugin network
43
+ <Plugin interface>
44
+ Interface "eth0"
45
+ IgnoreSelected false
46
+ </Plugin>
47
+ <Plugin network>
48
+ <Server "10.0.0.1" "25826">
49
+ </Server>
50
+ </Plugin>
51
+
52
+ Be sure to replace `10.0.0.1` with the IP of your Logstash instance.
53
+
54
+
55
+ [id="plugins-{type}s-{plugin}-options"]
56
+ ==== Collectd Codec Configuration Options
57
+
58
+ This plugin supports the following configuration options plus the <<plugins-{type}s-common-options>> described later.
59
+
60
+ [cols="<,<,<",options="header",]
61
+ |=======================================================================
62
+ |Setting |Input type|Required
63
+ | <<plugins-{type}s-{plugin}-authfile>> |<<string,string>>|No
64
+ | <<plugins-{type}s-{plugin}-nan_handling>> |<<string,string>>, one of `["change_value", "warn", "drop"]`|No
65
+ | <<plugins-{type}s-{plugin}-nan_tag>> |<<string,string>>|No
66
+ | <<plugins-{type}s-{plugin}-nan_value>> |<<number,number>>|No
67
+ | <<plugins-{type}s-{plugin}-prune_intervals>> |<<boolean,boolean>>|No
68
+ | <<plugins-{type}s-{plugin}-security_level>> |<<string,string>>, one of `["None", "Sign", "Encrypt"]`|No
69
+ | <<plugins-{type}s-{plugin}-typesdb>> |<<array,array>>|No
70
+ |=======================================================================
71
+
72
+ Also see <<plugins-{type}s-common-options>> for a list of options supported by all
73
+ codec plugins.
74
+
75
+ &nbsp;
76
+
77
+ [id="plugins-{type}s-{plugin}-authfile"]
78
+ ===== `authfile`
79
+
80
+ * Value type is <<string,string>>
81
+ * There is no default value for this setting.
82
+
83
+ Path to the authentication file. This file should have the same format as
84
+ the http://collectd.org/documentation/manpages/collectd.conf.5.shtml#authfile_filename[AuthFile]
85
+ in collectd. You only need to set this option if the `security_level` is set to
86
+ `Sign` or `Encrypt`
87
+
88
+ [id="plugins-{type}s-{plugin}-nan_handling"]
89
+ ===== `nan_handling`
90
+
91
+ * Value can be any of: `change_value`, `warn`, `drop`
92
+ * Default value is `"change_value"`
93
+
94
+ What to do when a value in the event is `NaN` (Not a Number)
95
+
96
+ - change_value (default): Change the `NaN` to the value of the nan_value option and add `nan_tag` as a tag
97
+ - warn: Change the `NaN` to the value of the nan_value option, print a warning to the log and add `nan_tag` as a tag
98
+ - drop: Drop the event containing the `NaN` (this only drops the single event, not the whole packet)
99
+
100
+ [id="plugins-{type}s-{plugin}-nan_tag"]
101
+ ===== `nan_tag`
102
+
103
+ * Value type is <<string,string>>
104
+ * Default value is `"_collectdNaN"`
105
+
106
+ The tag to add to the event if a `NaN` value was found
107
+ Set this to an empty string ('') if you don't want to tag
108
+
109
+ [id="plugins-{type}s-{plugin}-nan_value"]
110
+ ===== `nan_value`
111
+
112
+ * Value type is <<number,number>>
113
+ * Default value is `0`
114
+
115
+ Only relevant when `nan_handeling` is set to `change_value`
116
+ Change NaN to this configured value
117
+
118
+ [id="plugins-{type}s-{plugin}-prune_intervals"]
119
+ ===== `prune_intervals`
120
+
121
+ * Value type is <<boolean,boolean>>
122
+ * Default value is `true`
123
+
124
+ Prune interval records. Defaults to `true`.
125
+
126
+ [id="plugins-{type}s-{plugin}-security_level"]
127
+ ===== `security_level`
128
+
129
+ * Value can be any of: `None`, `Sign`, `Encrypt`
130
+ * Default value is `"None"`
131
+
132
+ Security Level. Default is `None`. This setting mirrors the setting from the
133
+ collectd https://collectd.org/wiki/index.php/Plugin:Network[Network plugin]
134
+
135
+ [id="plugins-{type}s-{plugin}-typesdb"]
136
+ ===== `typesdb`
137
+
138
+ * Value type is <<array,array>>
139
+ * There is no default value for this setting.
140
+
141
+ File path(s) to collectd `types.db` to use.
142
+ The last matching pattern wins if you have identical pattern names in multiple files.
143
+ If no types.db is provided the included `types.db` will be used (currently 5.4.0).
144
+
145
+
146
+
147
+ include::{include_path}/{type}.asciidoc[]
@@ -6,6 +6,8 @@ require "logstash/errors"
6
6
  require "tempfile"
7
7
  require "time"
8
8
 
9
+ import "javax.crypto.Mac"
10
+
9
11
  class ProtocolError < LogStash::Error; end
10
12
  class HeaderError < LogStash::Error; end
11
13
  class EncryptionError < LogStash::Error; end
@@ -339,10 +341,29 @@ class LogStash::Codecs::Collectd < LogStash::Codecs::Base
339
341
 
340
342
  key = get_key(user)
341
343
  return false if key.nil?
342
-
343
- return Digest::HMAC.digest(user+payload, key, Digest::SHA256) == signature
344
+ return digest(user, payload, key) == signature
344
345
  end # def verify_signature
345
346
 
347
+ private
348
+ def digest_ruby19(user, payload, key)
349
+ Digest::HMAC.digest(user+payload, key , Digest::SHA256)
350
+ end
351
+
352
+ private
353
+ def digest_ruby20(user, payload, key)
354
+ OpenSSL::HMAC.digest(OpenSSL::Digest.new("sha256"), key, user+payload)
355
+ end
356
+
357
+ def self.ruby_19?
358
+ RUBY_VERSION == "1.9.3"
359
+ end
360
+
361
+ if ruby_19?
362
+ alias_method :digest, :digest_ruby19
363
+ else
364
+ alias_method :digest, :digest_ruby20
365
+ end
366
+
346
367
  private
347
368
  def decrypt_packet(user, iv, content)
348
369
  # Content has to have at least a SHA1 hash (20 bytes), a header (4 bytes) and
@@ -1,7 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
-
3
2
  s.name = 'logstash-codec-collectd'
4
- s.version = '3.0.3'
3
+ s.version = '3.0.4'
5
4
  s.licenses = ['Apache License (2.0)']
6
5
  s.summary = "Read events from the collectd binary protocol"
7
6
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -11,7 +10,7 @@ Gem::Specification.new do |s|
11
10
  s.require_paths = ["lib"]
12
11
 
13
12
  # Files
14
- s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
13
+ s.files = Dir["lib/**/*","spec/**/*","*.gemspec","*.md","CONTRIBUTORS","Gemfile","LICENSE","NOTICE.TXT", "vendor/jar-dependencies/**/*.jar", "vendor/jar-dependencies/**/*.rb", "VERSION", "docs/**/*"]
15
14
 
16
15
  # Tests
17
16
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-codec-collectd
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-26 00:00:00.000000000 Z
11
+ date: 2017-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -56,10 +56,10 @@ files:
56
56
  - LICENSE
57
57
  - NOTICE.TXT
58
58
  - README.md
59
+ - docs/index.asciidoc
59
60
  - lib/logstash/codecs/collectd.rb
60
61
  - logstash-codec-collectd.gemspec
61
62
  - spec/codecs/collectd_spec.rb
62
- - vendor/types.db
63
63
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
64
64
  licenses:
65
65
  - Apache License (2.0)
data/vendor/types.db DELETED
@@ -1,208 +0,0 @@
1
- absolute value:ABSOLUTE:0:U
2
- apache_bytes value:DERIVE:0:U
3
- apache_connections value:GAUGE:0:65535
4
- apache_idle_workers value:GAUGE:0:65535
5
- apache_requests value:DERIVE:0:U
6
- apache_scoreboard value:GAUGE:0:65535
7
- ath_nodes value:GAUGE:0:65535
8
- ath_stat value:DERIVE:0:U
9
- backends value:GAUGE:0:65535
10
- bitrate value:GAUGE:0:4294967295
11
- bytes value:GAUGE:0:U
12
- cache_eviction value:DERIVE:0:U
13
- cache_operation value:DERIVE:0:U
14
- cache_ratio value:GAUGE:0:100
15
- cache_result value:DERIVE:0:U
16
- cache_size value:GAUGE:0:4294967295
17
- charge value:GAUGE:0:U
18
- compression_ratio value:GAUGE:0:2
19
- compression uncompressed:DERIVE:0:U, compressed:DERIVE:0:U
20
- connections value:DERIVE:0:U
21
- conntrack value:GAUGE:0:4294967295
22
- contextswitch value:DERIVE:0:U
23
- counter value:COUNTER:U:U
24
- cpufreq value:GAUGE:0:U
25
- cpu value:DERIVE:0:U
26
- current_connections value:GAUGE:0:U
27
- current_sessions value:GAUGE:0:U
28
- current value:GAUGE:U:U
29
- delay value:GAUGE:-1000000:1000000
30
- derive value:DERIVE:0:U
31
- df_complex value:GAUGE:0:U
32
- df_inodes value:GAUGE:0:U
33
- df used:GAUGE:0:1125899906842623, free:GAUGE:0:1125899906842623
34
- disk_latency read:GAUGE:0:U, write:GAUGE:0:U
35
- disk_merged read:DERIVE:0:U, write:DERIVE:0:U
36
- disk_octets read:DERIVE:0:U, write:DERIVE:0:U
37
- disk_ops_complex value:DERIVE:0:U
38
- disk_ops read:DERIVE:0:U, write:DERIVE:0:U
39
- disk_time read:DERIVE:0:U, write:DERIVE:0:U
40
- dns_answer value:DERIVE:0:U
41
- dns_notify value:DERIVE:0:U
42
- dns_octets queries:DERIVE:0:U, responses:DERIVE:0:U
43
- dns_opcode value:DERIVE:0:U
44
- dns_qtype_cached value:GAUGE:0:4294967295
45
- dns_qtype value:DERIVE:0:U
46
- dns_query value:DERIVE:0:U
47
- dns_question value:DERIVE:0:U
48
- dns_rcode value:DERIVE:0:U
49
- dns_reject value:DERIVE:0:U
50
- dns_request value:DERIVE:0:U
51
- dns_resolver value:DERIVE:0:U
52
- dns_response value:DERIVE:0:U
53
- dns_transfer value:DERIVE:0:U
54
- dns_update value:DERIVE:0:U
55
- dns_zops value:DERIVE:0:U
56
- duration seconds:GAUGE:0:U
57
- email_check value:GAUGE:0:U
58
- email_count value:GAUGE:0:U
59
- email_size value:GAUGE:0:U
60
- entropy value:GAUGE:0:4294967295
61
- fanspeed value:GAUGE:0:U
62
- file_size value:GAUGE:0:U
63
- files value:GAUGE:0:U
64
- fork_rate value:DERIVE:0:U
65
- frequency_offset value:GAUGE:-1000000:1000000
66
- frequency value:GAUGE:0:U
67
- fscache_stat value:DERIVE:0:U
68
- gauge value:GAUGE:U:U
69
- hash_collisions value:DERIVE:0:U
70
- http_request_methods value:DERIVE:0:U
71
- http_requests value:DERIVE:0:U
72
- http_response_codes value:DERIVE:0:U
73
- humidity value:GAUGE:0:100
74
- if_collisions value:DERIVE:0:U
75
- if_dropped rx:DERIVE:0:U, tx:DERIVE:0:U
76
- if_errors rx:DERIVE:0:U, tx:DERIVE:0:U
77
- if_multicast value:DERIVE:0:U
78
- if_octets rx:DERIVE:0:U, tx:DERIVE:0:U
79
- if_packets rx:DERIVE:0:U, tx:DERIVE:0:U
80
- if_rx_errors value:DERIVE:0:U
81
- if_rx_octets value:DERIVE:0:U
82
- if_tx_errors value:DERIVE:0:U
83
- if_tx_octets value:DERIVE:0:U
84
- invocations value:DERIVE:0:U
85
- io_octets rx:DERIVE:0:U, tx:DERIVE:0:U
86
- io_packets rx:DERIVE:0:U, tx:DERIVE:0:U
87
- ipt_bytes value:DERIVE:0:U
88
- ipt_packets value:DERIVE:0:U
89
- irq value:DERIVE:0:U
90
- latency value:GAUGE:0:U
91
- links value:GAUGE:0:U
92
- load shortterm:GAUGE:0:5000, midterm:GAUGE:0:5000, longterm:GAUGE:0:5000
93
- md_disks value:GAUGE:0:U
94
- memcached_command value:DERIVE:0:U
95
- memcached_connections value:GAUGE:0:U
96
- memcached_items value:GAUGE:0:U
97
- memcached_octets rx:DERIVE:0:U, tx:DERIVE:0:U
98
- memcached_ops value:DERIVE:0:U
99
- memory value:GAUGE:0:281474976710656
100
- multimeter value:GAUGE:U:U
101
- mutex_operations value:DERIVE:0:U
102
- mysql_commands value:DERIVE:0:U
103
- mysql_handler value:DERIVE:0:U
104
- mysql_locks value:DERIVE:0:U
105
- mysql_log_position value:DERIVE:0:U
106
- mysql_octets rx:DERIVE:0:U, tx:DERIVE:0:U
107
- nfs_procedure value:DERIVE:0:U
108
- nginx_connections value:GAUGE:0:U
109
- nginx_requests value:DERIVE:0:U
110
- node_octets rx:DERIVE:0:U, tx:DERIVE:0:U
111
- node_rssi value:GAUGE:0:255
112
- node_stat value:DERIVE:0:U
113
- node_tx_rate value:GAUGE:0:127
114
- objects value:GAUGE:0:U
115
- operations value:DERIVE:0:U
116
- percent value:GAUGE:0:100.1
117
- percent_bytes value:GAUGE:0:100.1
118
- percent_inodes value:GAUGE:0:100.1
119
- pf_counters value:DERIVE:0:U
120
- pf_limits value:DERIVE:0:U
121
- pf_source value:DERIVE:0:U
122
- pf_states value:GAUGE:0:U
123
- pf_state value:DERIVE:0:U
124
- pg_blks value:DERIVE:0:U
125
- pg_db_size value:GAUGE:0:U
126
- pg_n_tup_c value:DERIVE:0:U
127
- pg_n_tup_g value:GAUGE:0:U
128
- pg_numbackends value:GAUGE:0:U
129
- pg_scan value:DERIVE:0:U
130
- pg_xact value:DERIVE:0:U
131
- ping_droprate value:GAUGE:0:100
132
- ping_stddev value:GAUGE:0:65535
133
- ping value:GAUGE:0:65535
134
- players value:GAUGE:0:1000000
135
- power value:GAUGE:0:U
136
- protocol_counter value:DERIVE:0:U
137
- ps_code value:GAUGE:0:9223372036854775807
138
- ps_count processes:GAUGE:0:1000000, threads:GAUGE:0:1000000
139
- ps_cputime user:DERIVE:0:U, syst:DERIVE:0:U
140
- ps_data value:GAUGE:0:9223372036854775807
141
- ps_disk_octets read:DERIVE:0:U, write:DERIVE:0:U
142
- ps_disk_ops read:DERIVE:0:U, write:DERIVE:0:U
143
- ps_pagefaults minflt:DERIVE:0:U, majflt:DERIVE:0:U
144
- ps_rss value:GAUGE:0:9223372036854775807
145
- ps_stacksize value:GAUGE:0:9223372036854775807
146
- ps_state value:GAUGE:0:65535
147
- ps_vm value:GAUGE:0:9223372036854775807
148
- queue_length value:GAUGE:0:U
149
- records value:GAUGE:0:U
150
- requests value:GAUGE:0:U
151
- response_time value:GAUGE:0:U
152
- response_code value:GAUGE:0:U
153
- route_etx value:GAUGE:0:U
154
- route_metric value:GAUGE:0:U
155
- routes value:GAUGE:0:U
156
- serial_octets rx:DERIVE:0:U, tx:DERIVE:0:U
157
- signal_noise value:GAUGE:U:0
158
- signal_power value:GAUGE:U:0
159
- signal_quality value:GAUGE:0:U
160
- snr value:GAUGE:0:U
161
- spam_check value:GAUGE:0:U
162
- spam_score value:GAUGE:U:U
163
- spl value:GAUGE:U:U
164
- swap_io value:DERIVE:0:U
165
- swap value:GAUGE:0:1099511627776
166
- tcp_connections value:GAUGE:0:4294967295
167
- temperature value:GAUGE:U:U
168
- threads value:GAUGE:0:U
169
- time_dispersion value:GAUGE:-1000000:1000000
170
- timeleft value:GAUGE:0:U
171
- time_offset value:GAUGE:-1000000:1000000
172
- total_bytes value:DERIVE:0:U
173
- total_connections value:DERIVE:0:U
174
- total_objects value:DERIVE:0:U
175
- total_operations value:DERIVE:0:U
176
- total_requests value:DERIVE:0:U
177
- total_sessions value:DERIVE:0:U
178
- total_threads value:DERIVE:0:U
179
- total_time_in_ms value:DERIVE:0:U
180
- total_values value:DERIVE:0:U
181
- uptime value:GAUGE:0:4294967295
182
- users value:GAUGE:0:65535
183
- vcl value:GAUGE:0:65535
184
- vcpu value:GAUGE:0:U
185
- virt_cpu_total value:DERIVE:0:U
186
- virt_vcpu value:DERIVE:0:U
187
- vmpage_action value:DERIVE:0:U
188
- vmpage_faults minflt:DERIVE:0:U, majflt:DERIVE:0:U
189
- vmpage_io in:DERIVE:0:U, out:DERIVE:0:U
190
- vmpage_number value:GAUGE:0:4294967295
191
- volatile_changes value:GAUGE:0:U
192
- voltage_threshold value:GAUGE:U:U, threshold:GAUGE:U:U
193
- voltage value:GAUGE:U:U
194
- vs_memory value:GAUGE:0:9223372036854775807
195
- vs_processes value:GAUGE:0:65535
196
- vs_threads value:GAUGE:0:65535
197
-
198
- #
199
- # Legacy types
200
- # (required for the v5 upgrade target)
201
- #
202
- arc_counts demand_data:COUNTER:0:U, demand_metadata:COUNTER:0:U, prefetch_data:COUNTER:0:U, prefetch_metadata:COUNTER:0:U
203
- arc_l2_bytes read:COUNTER:0:U, write:COUNTER:0:U
204
- arc_l2_size value:GAUGE:0:U
205
- arc_ratio value:GAUGE:0:U
206
- arc_size current:GAUGE:0:U, target:GAUGE:0:U, minlimit:GAUGE:0:U, maxlimit:GAUGE:0:U
207
- mysql_qcache hits:COUNTER:0:U, inserts:COUNTER:0:U, not_cached:COUNTER:0:U, lowmem_prunes:COUNTER:0:U, queries_in_cache:GAUGE:0:U
208
- mysql_threads running:GAUGE:0:U, connected:GAUGE:0:U, cached:GAUGE:0:U, created:COUNTER:0:U