snmp-open 0.1.1 → 0.1.2
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/lib/snmp/open.rb +5 -3
- data/lib/snmp/open/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55313ea1a6642173d99b42f50c381593adcaf93e
|
4
|
+
data.tar.gz: 4500b9b1250ab216871cf0e517b8a1d47f683bed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9ac99bdf0c59be35c8934a4376e7a51a6fa54816608395654d2ef40e5892e62809f40154b654297672a686c86b52e0b80330470b62cf29c7c1fdb440709ce53
|
7
|
+
data.tar.gz: 19f0e812245542f3ba4161287c41960f414ab3cf39b5546d661e415adbe7e76883a2ba01ceea46ea2e3218c85f546e950d24a7da1ca4ed4f471338642c222462
|
data/lib/snmp/open.rb
CHANGED
@@ -72,14 +72,16 @@ module SNMP
|
|
72
72
|
# Perform an SNMP get using the "snmpget" command and parse the output
|
73
73
|
def get(oids)
|
74
74
|
return enum_for(:get, oids) unless block_given?
|
75
|
-
texts = oids.map { |oid| capture_command(:
|
75
|
+
texts = oids.map { |oid| capture_command(:get, oid) }
|
76
76
|
Parser.new(oids).parse(texts).each { |arg, *| yield(arg) }
|
77
77
|
end
|
78
78
|
|
79
79
|
# Perform an SNMP walk using the "snmpwalk" or "snmpbulkwalk" commands and
|
80
80
|
# parse the output
|
81
|
-
def walk(oids,
|
82
|
-
|
81
|
+
def walk(oids, **kwargs)
|
82
|
+
kwargs = { bulk: true, non_repeaters: 0, max_repetitions: 10 }
|
83
|
+
.merge(kwargs)
|
84
|
+
return enum_for(:walk, oids, **kwargs) unless block_given?
|
83
85
|
cmd = bulk ? :bulkwalk : :walk
|
84
86
|
options = bulk ? { '-Cn' => non_repeaters, '-Cr' => max_repetitions } : {}
|
85
87
|
texts = oids.map { |oid| capture_command(cmd, oid, options) }
|
data/lib/snmp/open/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snmp-open
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Miller
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|