logstash-integration-snmp 4.3.0-java → 4.3.1-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/lib/logstash/inputs/snmp.rb +1 -1
- data/lib/logstash-integration-snmp_jars.rb +1 -1
- data/spec/unit/inputs/snmp_spec.rb +40 -29
- data/vendor/jar-dependencies/org/logstash/integrations/plugin/{4.3.0/plugin-4.3.0.jar → 4.3.1/plugin-4.3.1.jar} +0 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 00b54144b7fb2f7a2504757c195376ea69d30baf878855007afb969f9c6bb372
|
|
4
|
+
data.tar.gz: 6f8f31cdf110ce9a2b16d632efe00ad888e1145d4dbbce739b885f74a618149a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c7262768b0db4a1ccee95e57f979813652860e2ccd3cbc7bde0d3d945216a36d0c6b0a539db5d790be05f0100f9f29713106c1e9acca41be0eebdf0d2d063871
|
|
7
|
+
data.tar.gz: 94c9a90d25ccf4da3008433c9fb45e001402415a060a26d9d9bb8833bae1a8c29a9303b99eccd26854b743d9680aa8dc7c466fc4b42bc28825dc4a9a4e85d365
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
## 4.3.1
|
|
2
|
+
- Fix: generate error events with _snmpfailure tag when all SNMP operations fail and the response data is empty (e.g., timeout) [#92](https://github.com/logstash-plugins/logstash-integration-snmp/pull/92)
|
|
3
|
+
|
|
1
4
|
## 4.3.0
|
|
2
5
|
- Handle partial responses and errors gracefully: add `tag_on_failure` (default: `["_snmpfailure"]`) to tag events when SNMP operations fail, and `allow_partial_response` (default: `false`) to preserve partial data from failed `walk`/`table` operations [#91](https://github.com/logstash-plugins/logstash-integration-snmp/pull/91)
|
|
3
6
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.3.
|
|
1
|
+
4.3.1
|
data/lib/logstash/inputs/snmp.rb
CHANGED
|
@@ -195,7 +195,7 @@ class LogStash::Inputs::Snmp < LogStash::Inputs::Base
|
|
|
195
195
|
definition = req[:definition]
|
|
196
196
|
result_consumer = lambda do |request_result|
|
|
197
197
|
result = request_result.data
|
|
198
|
-
if result&.any?
|
|
198
|
+
if result&.any? || request_result.has_errors
|
|
199
199
|
event = targeted_event_factory.new_event(result)
|
|
200
200
|
event.set(@host_protocol_field, definition[:host_protocol])
|
|
201
201
|
event.set(@host_address_field, definition[:host_address])
|
|
@@ -4,4 +4,4 @@ require 'jar_dependencies'
|
|
|
4
4
|
require_jar('org.snmp4j', 'snmp4j-log4j', '2.8.11')
|
|
5
5
|
require_jar('org.snmp4j', 'snmp4j', '3.8.0')
|
|
6
6
|
require_jar('org.snakeyaml', 'snakeyaml-engine', '2.7')
|
|
7
|
-
require_jar('org.logstash.integrations', 'plugin', '4.3.
|
|
7
|
+
require_jar('org.logstash.integrations', 'plugin', '4.3.1')
|
|
@@ -342,21 +342,41 @@ describe LogStash::Inputs::Snmp, :ecs_compatibility_support do
|
|
|
342
342
|
})
|
|
343
343
|
end
|
|
344
344
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
345
|
+
context 'when result data is not empty' do
|
|
346
|
+
before(:each) do
|
|
347
|
+
expect(mock_aggregator_request).to receive(:get)
|
|
348
|
+
expect(mock_aggregator_request).to receive(:get_result_async) do |consumer|
|
|
349
|
+
consumer.call(RequestResult.new({ 'foo' => 'bar' }, true))
|
|
350
|
+
end
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
it 'should tag event with default failure tag' do
|
|
354
|
+
plugin.register
|
|
355
|
+
plugin.poll_clients(queue)
|
|
356
|
+
event = queue.pop
|
|
357
|
+
|
|
358
|
+
expect(event.get("foo")).to eq("bar")
|
|
359
|
+
expect(event.get("tags")).to include("_snmpfailure")
|
|
360
|
+
expect(event.get("_snmp_request_errors")).to be_nil
|
|
349
361
|
end
|
|
350
362
|
end
|
|
351
363
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
364
|
+
context 'when result data is empty' do
|
|
365
|
+
before(:each) do
|
|
366
|
+
expect(mock_aggregator_request).to receive(:get)
|
|
367
|
+
expect(mock_aggregator_request).to receive(:get_result_async) do |consumer|
|
|
368
|
+
consumer.call(RequestResult.new({}, true))
|
|
369
|
+
end
|
|
370
|
+
end
|
|
356
371
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
372
|
+
it 'should generate an event with failure tag when all operations fail' do
|
|
373
|
+
plugin.register
|
|
374
|
+
plugin.poll_clients(queue)
|
|
375
|
+
event = queue.pop
|
|
376
|
+
|
|
377
|
+
expect(event).not_to be_nil
|
|
378
|
+
expect(event.get("tags")).to include("_snmpfailure")
|
|
379
|
+
end
|
|
360
380
|
end
|
|
361
381
|
end
|
|
362
382
|
|
|
@@ -364,41 +384,32 @@ describe LogStash::Inputs::Snmp, :ecs_compatibility_support do
|
|
|
364
384
|
let(:config) do
|
|
365
385
|
super().merge({
|
|
366
386
|
'get' => ['1.3.6.1.2.1.1.1.0'],
|
|
367
|
-
'hosts' => [{ 'host' => 'udp:127.0.0.1/161', 'community' => 'public' }]
|
|
368
|
-
'allow_partial_response' => allow_partial_response_value
|
|
387
|
+
'hosts' => [{ 'host' => 'udp:127.0.0.1/161', 'community' => 'public' }]
|
|
369
388
|
})
|
|
370
389
|
end
|
|
371
390
|
|
|
372
391
|
before(:each) do
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
consumer.call(RequestResult.new({ 'partial' => 'data' }, true))
|
|
376
|
-
end
|
|
392
|
+
allow(mock_aggregator_request).to receive(:get)
|
|
393
|
+
allow(mock_aggregator_request).to receive(:get_result_async)
|
|
377
394
|
end
|
|
378
395
|
|
|
379
396
|
context 'when set to false (default)' do
|
|
380
|
-
let(:
|
|
397
|
+
let(:config) { super().merge('allow_partial_response' => false) }
|
|
381
398
|
|
|
382
|
-
it '
|
|
399
|
+
it 'uses complete result aggregator' do
|
|
400
|
+
expect(mock_aggregator).to receive(:create_request_for_complete_result).and_return(mock_aggregator_request)
|
|
383
401
|
plugin.register
|
|
384
402
|
plugin.poll_clients(queue)
|
|
385
|
-
event = queue.pop
|
|
386
|
-
|
|
387
|
-
expect(event.get("partial")).to eq("data")
|
|
388
|
-
expect(event.get("tags")).to include("_snmpfailure")
|
|
389
403
|
end
|
|
390
404
|
end
|
|
391
405
|
|
|
392
406
|
context 'when set to true' do
|
|
393
|
-
let(:
|
|
407
|
+
let(:config) { super().merge('allow_partial_response' => true) }
|
|
394
408
|
|
|
395
|
-
it '
|
|
409
|
+
it 'uses partial result aggregator' do
|
|
410
|
+
expect(mock_aggregator).to receive(:create_request_for_partial_result).and_return(mock_aggregator_request)
|
|
396
411
|
plugin.register
|
|
397
412
|
plugin.poll_clients(queue)
|
|
398
|
-
event = queue.pop
|
|
399
|
-
|
|
400
|
-
expect(event.get("partial")).to eq("data")
|
|
401
|
-
expect(event.get("tags")).to include("_snmpfailure")
|
|
402
413
|
end
|
|
403
414
|
end
|
|
404
415
|
end
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: logstash-integration-snmp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.3.
|
|
4
|
+
version: 4.3.1
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- Elastic
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-05-
|
|
10
|
+
date: 2026-05-20 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: logstash-core-plugin-api
|
|
@@ -468,7 +468,7 @@ files:
|
|
|
468
468
|
- spec/unit/inputs/common_spec.rb
|
|
469
469
|
- spec/unit/inputs/snmp_spec.rb
|
|
470
470
|
- spec/unit/inputs/snmptrap_spec.rb
|
|
471
|
-
- vendor/jar-dependencies/org/logstash/integrations/plugin/4.3.
|
|
471
|
+
- vendor/jar-dependencies/org/logstash/integrations/plugin/4.3.1/plugin-4.3.1.jar
|
|
472
472
|
- vendor/jar-dependencies/org/snakeyaml/snakeyaml-engine/2.7/snakeyaml-engine-2.7.jar
|
|
473
473
|
- vendor/jar-dependencies/org/snmp4j/snmp4j-log4j/2.8.11/snmp4j-log4j-2.8.11.jar
|
|
474
474
|
- vendor/jar-dependencies/org/snmp4j/snmp4j/3.8.0/snmp4j-3.8.0.jar
|