logstash-input-snmptrap 3.0.2 → 3.0.3

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: 5177deda174aa3b2f20f4b3722cb523913a4abf0
4
- data.tar.gz: 20d082b031b83ac36126b6a5fcfdd2faa2087c9a
3
+ metadata.gz: 77088e35cbb7f1aae01213ca3181fa6ad3133137
4
+ data.tar.gz: 9724128b3f0b109fe3f6d2efb33e61483617f215
5
5
  SHA512:
6
- metadata.gz: 2436620cb08c55c5c9ab1d542604b888c76db3d4f2ac5111867037634baa2559c5a6717b6fb4325f595563cca474f742adc619503f5e02d6e548098e856a4ac0
7
- data.tar.gz: 2fd8a3952ac47f943624c61aecac5b3622c0f1dc638703c722205926329d3e8aea3c6ef4d45d81ea2f5a9b82734cb2c67295f131be2e1a9e386ff618b26b356a
6
+ metadata.gz: afcb7980861e2d43696ab222fef975febb05330a49dfde8f2e3b112234b67f3ea6fa5a30d8eac0ce57676f9ee26a05fa8f455240c2de984497a9491aba915fbd
7
+ data.tar.gz: 6c640cdbb9a813701986a4098a45c661d03ed421a75ca0e9d90531bfa3e794769ced4fbbf5ca1dbec67cf6c80176fdd4bb2a7f18c66c38f8ce41e03935a5e713
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,88 @@
1
+ :plugin: snmptrap
2
+ :type: input
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
+ === Snmptrap input plugin
18
+
19
+ include::{include_path}/plugin_header.asciidoc[]
20
+
21
+ ==== Description
22
+
23
+ Read snmp trap messages as events
24
+
25
+ Resulting `@message` looks like :
26
+ [source,ruby]
27
+ #<SNMP::SNMPv1_Trap:0x6f1a7a4 @varbind_list=[#<SNMP::VarBind:0x2d7bcd8f @value="teststring",
28
+ @name=[1.11.12.13.14.15]>], @timestamp=#<SNMP::TimeTicks:0x1af47e9d @value=55>, @generic_trap=6,
29
+ @enterprise=[1.2.3.4.5.6], @source_ip="127.0.0.1", @agent_addr=#<SNMP::IpAddress:0x29a4833e @value="\xC0\xC1\xC2\xC3">,
30
+ @specific_trap=99>
31
+
32
+
33
+ [id="plugins-{type}s-{plugin}-options"]
34
+ ==== Snmptrap Input Configuration Options
35
+
36
+ This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
37
+
38
+ [cols="<,<,<",options="header",]
39
+ |=======================================================================
40
+ |Setting |Input type|Required
41
+ | <<plugins-{type}s-{plugin}-community>> |<<array,array>>|No
42
+ | <<plugins-{type}s-{plugin}-host>> |<<string,string>>|No
43
+ | <<plugins-{type}s-{plugin}-port>> |<<number,number>>|No
44
+ | <<plugins-{type}s-{plugin}-yamlmibdir>> |<<string,string>>|No
45
+ |=======================================================================
46
+
47
+ Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
48
+ input plugins.
49
+
50
+ &nbsp;
51
+
52
+ [id="plugins-{type}s-{plugin}-community"]
53
+ ===== `community`
54
+
55
+ * Value type is <<array,array>>
56
+ * Default value is `"public"`
57
+
58
+ SNMP Community String to listen for.
59
+
60
+ [id="plugins-{type}s-{plugin}-host"]
61
+ ===== `host`
62
+
63
+ * Value type is <<string,string>>
64
+ * Default value is `"0.0.0.0"`
65
+
66
+ The address to listen on
67
+
68
+ [id="plugins-{type}s-{plugin}-port"]
69
+ ===== `port`
70
+
71
+ * Value type is <<number,number>>
72
+ * Default value is `1062`
73
+
74
+ The port to listen on. Remember that ports less than 1024 (privileged
75
+ ports) may require root to use. hence the default of 1062.
76
+
77
+ [id="plugins-{type}s-{plugin}-yamlmibdir"]
78
+ ===== `yamlmibdir`
79
+
80
+ * Value type is <<string,string>>
81
+ * There is no default value for this setting.
82
+
83
+ directory of YAML MIB maps (same format ruby-snmp uses)
84
+
85
+
86
+
87
+ [id="plugins-{type}s-{plugin}-common-options"]
88
+ include::{include_path}/{type}.asciidoc[]
@@ -3,6 +3,7 @@ require "logstash/inputs/base"
3
3
  require "logstash/namespace"
4
4
 
5
5
  require "snmp"
6
+ require_relative "snmptrap/patches/trap_listener"
6
7
 
7
8
  # Read snmp trap messages as events
8
9
  #
@@ -0,0 +1,22 @@
1
+ require "snmp"
2
+
3
+ # Patch SNMP::TrapListener#process_traps to ignore exceptions when stopping.
4
+ class SNMP::TrapListener
5
+ alias_method :original_exit, :exit
6
+ def exit
7
+ @stop = true
8
+ original_exit
9
+ end
10
+
11
+ def stop?
12
+ @stop
13
+ end
14
+
15
+ alias_method :original_process_traps, :process_traps
16
+ def process_traps(*args)
17
+ original_process_traps(*args)
18
+ rescue
19
+ raise unless stop?
20
+ end
21
+ end
22
+
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-snmptrap'
4
- s.version = '3.0.2'
4
+ s.version = '3.0.3'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Read snmp trap messages as events"
7
7
  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 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.require_paths = ["lib"]
12
12
 
13
13
  # Files
14
- s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
14
+ s.files = Dir["lib/**/*","spec/**/*","*.gemspec","*.md","CONTRIBUTORS","Gemfile","LICENSE","NOTICE.TXT", "vendor/jar-dependencies/**/*.jar", "vendor/jar-dependencies/**/*.rb", "VERSION", "docs/**/*"]
15
15
 
16
16
  # Tests
17
17
  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-input-snmptrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-14 00:00:00.000000000 Z
11
+ date: 2017-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -84,7 +84,9 @@ files:
84
84
  - LICENSE
85
85
  - NOTICE.TXT
86
86
  - README.md
87
+ - docs/index.asciidoc
87
88
  - lib/logstash/inputs/snmptrap.rb
89
+ - lib/logstash/inputs/snmptrap/patches/trap_listener.rb
88
90
  - logstash-input-snmptrap.gemspec
89
91
  - spec/inputs/snmptrap_spec.rb
90
92
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
@@ -109,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
111
  version: '0'
110
112
  requirements: []
111
113
  rubyforge_project:
112
- rubygems_version: 2.6.3
114
+ rubygems_version: 2.4.8
113
115
  signing_key:
114
116
  specification_version: 4
115
117
  summary: Read snmp trap messages as events