logstash-input-snmp 1.3.2 → 1.3.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
  SHA256:
3
- metadata.gz: 3fe1c5f85dcfcd638d7a15c9798f34d27cee90599d45b984e3a6a9d578233894
4
- data.tar.gz: 4261ebb2f0e9d7ab9b7f73d11bc2e4b1af37c176131b14c97b4808c249176d45
3
+ metadata.gz: 10af98fea9ec23b72d7b713cd503c4b34167cf5cebd494f4e73e52f5b02a12c1
4
+ data.tar.gz: f009f89f26dc5b8fff9d3fa07dacd577999c13589a175417178db1219063c98c
5
5
  SHA512:
6
- metadata.gz: 89ee144bd1e2a3d40dcdd355bac9b330a93b0b011739367721c82e33adca7762e716c53db4f95ae5816a87f004a1155f824603acf0c8f57025ac14502f5b4f11
7
- data.tar.gz: d7879c1a5de45a5e8f50574223dc883723cdda586540409ced17442f79396fb42669ce6bec8302c3f62d97a2b49927e3e62e7157ac23bec6ebbf05831e753e32
6
+ metadata.gz: 1db41b3f534bac5a03dbfd45210ebe2e944b361029d80e1bcc1131c4b1e35f363b72c07ad7771a3c54eca21c31b67e11fac8a725bcabd0b31e11a68bdbecdbdd
7
+ data.tar.gz: ece59ff5c72ccea90e8223fed33978ed4a7b6d486928d6c63eaf8f5696d85ec41e3a352ead03e6bcdb9abca8ae60a9fe5da6908f1a1cb43ea72666461b13cd8a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
+ ## 1.3.3
2
+ - Silence warnings when loading dictionary MIB files [#118](https://github.com/logstash-plugins/logstash-input-snmp/pull/118)
3
+
1
4
  ## 1.3.2
2
- - Docs: add troubleshooting help for "failed to locate MIB module" error when using smidump to convert MIBs
5
+ - [DOC] Add troubleshooting help for "failed to locate MIB module" error when using smidump to convert MIBs [#112](https://github.com/logstash-plugins/logstash-input-snmp/pull/112)
6
+ - Fix CI failures [#113](https://github.com/logstash-plugins/logstash-input-snmp/pull/113)
3
7
 
4
8
  ## 1.3.1
5
9
  - Refactor: handle no response(s) wout error logging [#105](https://github.com/logstash-plugins/logstash-input-snmp/pull/105)
@@ -15,7 +19,7 @@
15
19
  - Added integration tests to ensure SNMP server and IPv6 connections [#90](https://github.com/logstash-plugins/logstash-input-snmp/issues/90). Fixes[#87](https://github.com/logstash-plugins/logstash-input-snmp/issues/87).
16
20
 
17
21
  ## 1.2.6
18
- - Docs: example on setting IPv6 hosts [#89](https://github.com/logstash-plugins/logstash-input-snmp/pull/89)
22
+ - [DOC] Add example on setting IPv6 hosts [#89](https://github.com/logstash-plugins/logstash-input-snmp/pull/89)
19
23
 
20
24
  ## 1.2.5
21
25
  - Updated snmp4j library to v2.8.4 [#86](https://github.com/logstash-plugins/logstash-input-snmp/pull/86)
data/README.md CHANGED
@@ -17,7 +17,7 @@ Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/log
17
17
 
18
18
  ## Developing
19
19
 
20
- ### 1. Plugin Developement and Testing
20
+ ### 1. Plugin Development and Testing
21
21
 
22
22
  #### Code
23
23
  - To get started, you'll need JRuby with the Bundler gem installed.
data/docs/index.asciidoc CHANGED
@@ -54,7 +54,7 @@ libsmi is available and installable on most operating systems.
54
54
 
55
55
  To import a MIB, you need to first convert the ASN.1 MIB file into a `.dic` file using the libsmi `smidump` command line utility.
56
56
 
57
- Example (using `RFC1213-MIB` file)
57
+ *Example (using `RFC1213-MIB` file)*
58
58
 
59
59
  [source,sh]
60
60
  -----
@@ -63,37 +63,48 @@ $ smidump --level=1 -k -f python RFC1213-MIB > RFC1213-MIB.dic
63
63
 
64
64
  Note that the resulting file as output by `smidump` must have the `.dic` extension.
65
65
 
66
- As `smidump` only looks for mib dependencies in its pre-configured path lists as defined in the documentaion in the https://www.ibr.cs.tu-bs.de/projects/libsmi/smi_config.html["MODULES LOCATIONS"] section, you may need to provide the paths to locations of MIBs in your particular environment to avoid a `failed to locate MIB module` error.
66
+ [id="plugins-{type}s-{plugin}-locate-mibs"]
67
+ ===== Preventing a `failed to locate MIB module` error
67
68
 
68
- Two ways to achieve this are by using an environment variable or a config file to provide the additional path configuration.
69
+ The `smidump` function looks for mib dependencies in its pre-configured path lists.
70
+ You may need to provide the paths to locations of MIBs in your particular environment.
69
71
 
70
- Set the `SMIPATH` env var with the path to your mibs ensuring you include a prepended colon `:` for the path, for example:
72
+ You can avoid to avoid a `failed to locate MIB module` error by providing the additional path configuration information with:
73
+
74
+ * an environment variable, or
75
+ * a config file to provide the additional path configuration.
76
+
77
+ See the "MODULE LOCATIONS" section of the https://www.ibr.cs.tu-bs.de/projects/libsmi/smi_config.html[smi_config documentation] for more info.
78
+
79
+ [id="plugins-{type}s-{plugin}-env-var"]
80
+ ===== Option 1: Use an environment variable
81
+
82
+ Set the `SMIPATH` env var with the path to your mibs.
83
+ Be sure to include a prepended colon (`:`) for the path.
71
84
 
72
85
  [source,sh]
73
86
  -----
74
- $ SMIPATH=":/path/to/mibs/" smidump -k -f python CISCO-PROCESS-MIB.mib > CISCO-PROCESS-MIB_my.dic
87
+ $ SMIPATH=":/path/to/mibs/" smidump -k -f python CISCO-PROCESS-MIB.mib > CISCO-PROCESS-MIB_my.dic <1>
75
88
  -----
89
+ <1> Notice the colon that preceeds the path definition.
76
90
 
77
- NOTE: SMI docs on the prepended colon:
91
+ [id="plugins-{type}s-{plugin}-mib-config"]
92
+ ===== Option 2: Provide a coniguration file
78
93
 
79
- The ‘path’ command argument and the environment variable either start with a path separator character (‘:’ on UNIX-like systems, ‘;’ on MS-Windows systems) to append to the path, or end with a path separator character to prepend to the path, or otherwise completely replace the path.
80
-
81
-
82
- The other way is to create a configuration file eg `smi.conf` with the `path` option.
94
+ The other approach is to create a configuration file with the `path` option. For example, you could create a file called `smi.conf`.
83
95
 
84
96
  [source,sh]
85
97
  -----
86
98
  path :/path/to/mibs/
87
99
  -----
88
100
 
89
- and use that config with smidump:
101
+ Use the config with smidump:
90
102
 
91
103
  [source,sh]
92
104
  -----
93
105
  $ smidump -c smi.conf -k -f python CISCO-PROCESS-MIB.mib > CISCO-PROCESS-MIB_my.dic
94
106
  -----
95
107
 
96
-
97
108
  [id="plugins-{type}s-{plugin}-options"]
98
109
  ==== SNMP Input Configuration Options
99
110
 
@@ -157,11 +157,23 @@ module LogStash
157
157
  sub('MIB =', 'mib =')
158
158
 
159
159
  mib = nil
160
- eval(mib_hash)
160
+ silence_warnings do
161
+ eval(mib_hash)
162
+ end
161
163
  mib
162
164
  rescue Exception => e
163
165
  # rescuing Exception class is important here to rescue SyntaxError from eval
164
166
  raise(SnmpMibError, "error parsing mib dic file: #{filename}, error: #{e.message}")
165
167
  end
168
+
169
+ # MIB definition files may have duplicate entries that, since Ruby 2.7, generate warnings when they are converted to a hash.
170
+ # This method will suppress these warnings, unless `debug` logging is enabled.
171
+ def silence_warnings
172
+ warn_level = $VERBOSE
173
+ $VERBOSE = logger.debug? ? warn_level : nil
174
+ yield
175
+ ensure
176
+ $VERBOSE = warn_level
177
+ end
166
178
  end
167
179
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-snmp'
3
- s.version = '1.3.2'
3
+ s.version = '1.3.3'
4
4
  s.licenses = ['Apache-2.0']
5
5
  s.summary = "SNMP input plugin"
6
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"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-snmp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elasticsearch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-30 00:00:00.000000000 Z
11
+ date: 2023-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement