logstash-input-snmp 1.3.2 → 1.3.3
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 +6 -2
- data/README.md +1 -1
- data/docs/index.asciidoc +23 -12
- data/lib/logstash/inputs/snmp/mib.rb +13 -1
- data/logstash-input-snmp.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10af98fea9ec23b72d7b713cd503c4b34167cf5cebd494f4e73e52f5b02a12c1
|
4
|
+
data.tar.gz: f009f89f26dc5b8fff9d3fa07dacd577999c13589a175417178db1219063c98c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
-
|
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
|
-
-
|
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
|
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
|
-
|
66
|
+
[id="plugins-{type}s-{plugin}-locate-mibs"]
|
67
|
+
===== Preventing a `failed to locate MIB module` error
|
67
68
|
|
68
|
-
|
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
|
-
|
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
|
-
|
91
|
+
[id="plugins-{type}s-{plugin}-mib-config"]
|
92
|
+
===== Option 2: Provide a coniguration file
|
78
93
|
|
79
|
-
|
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
|
-
|
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
|
-
|
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
|
data/logstash-input-snmp.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-input-snmp'
|
3
|
-
s.version = '1.3.
|
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.
|
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-
|
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
|