snmp 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.rdoc +27 -7
- data/data/ruby/snmp/mibs/UCD-SNMP-MIB.yaml +169 -0
- data/lib/snmp.rb +18 -5
- data/lib/snmp/agent.rb +18 -5
- data/lib/snmp/ber.rb +16 -14
- data/lib/snmp/manager.rb +18 -5
- data/lib/snmp/mib.rb +19 -5
- data/lib/snmp/options.rb +18 -5
- data/lib/snmp/pdu.rb +18 -5
- data/lib/snmp/varbind.rb +24 -11
- data/lib/snmp/version.rb +1 -1
- data/test/test_ber.rb +16 -16
- data/test/test_manager.rb +36 -8
- data/test/test_mib.rb +9 -5
- data/test/test_pdu.rb +11 -9
- data/test/test_retry.rb +3 -3
- data/test/test_smi.rb +2 -2
- data/test/test_varbind.rb +41 -34
- data/test/test_walk.rb +3 -3
- metadata +42 -43
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: baf1b5ca4fab2f9e72b070e973a034ae0766ac06
|
4
|
+
data.tar.gz: ccb1aa2e53f6119879d7c8c38b20872d16d467bf
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: deaa30dfe998d0b9f7fdf9f53cfb13d03243c09691041b5190ab94c69a2785f663e181762a0412ba99812b5a34832e5bdde878c945bb3ee1068eafb8102278c8
|
7
|
+
data.tar.gz: 7524c15b26a70c5b2df9026234817fdba489759e2886cd0abefe038d30fb34e1f8bfc5390ed4ab3cd0c6d394a8ecce1443fdabf49aae4e0235f9a7967fc33771
|
data/README.rdoc
CHANGED
@@ -19,13 +19,17 @@ This release supports the following:
|
|
19
19
|
* Symbolic OID values (ie. "ifTable" instead of "1.3.6.1.2.1.2.2") as
|
20
20
|
parameters to the SNMP::Manager API
|
21
21
|
* Includes symbol data files for all current IETF MIBs
|
22
|
-
*
|
22
|
+
* Compatible with Ruby 1.9 and higher
|
23
23
|
|
24
24
|
See the SNMP::Manager, SNMP::TrapListener, and SNMP::MIB classes and the
|
25
25
|
examples below for more details.
|
26
26
|
|
27
27
|
== Changes
|
28
28
|
|
29
|
+
Changes for version 1.2.0:
|
30
|
+
* Removed support for Ruby 1.8
|
31
|
+
* Changed license to MIT License
|
32
|
+
|
29
33
|
Changes for version 1.1.1:
|
30
34
|
|
31
35
|
* Incorporate various small pull requests
|
@@ -76,8 +80,8 @@ install the latest version of the SNMP library.
|
|
76
80
|
== Testing
|
77
81
|
|
78
82
|
This library has received limited testing:
|
79
|
-
* The unit tests have been executed with both Ruby 1.
|
80
|
-
Mac OS X 10.
|
83
|
+
* The unit tests have been executed with both Ruby 1.9.3 and Ruby 2.1.2 on
|
84
|
+
Mac OS X 10.9.
|
81
85
|
* Basic interoperability testing has been done with the
|
82
86
|
net-snmp[http://www.net-snmp.org/] tools.
|
83
87
|
|
@@ -181,9 +185,25 @@ Log traps to STDOUT.
|
|
181
185
|
|
182
186
|
== License
|
183
187
|
|
184
|
-
This SNMP Library is
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
+
This SNMP Library is released under the MIT License.
|
189
|
+
|
190
|
+
Copyright (c) 2004-2014 David R. Halliday
|
191
|
+
|
192
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
193
|
+
of this software and associated documentation files (the "Software"), to deal
|
194
|
+
in the Software without restriction, including without limitation the rights
|
195
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
196
|
+
copies of the Software, and to permit persons to whom the Software is
|
197
|
+
furnished to do so, subject to the following conditions:
|
198
|
+
|
199
|
+
The above copyright notice and this permission notice shall be included in
|
200
|
+
all copies or substantial portions of the Software.
|
188
201
|
|
202
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
203
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
204
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
205
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
206
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
207
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
208
|
+
THE SOFTWARE.
|
189
209
|
|
@@ -0,0 +1,169 @@
|
|
1
|
+
---
|
2
|
+
ucdavis: 1.3.6.1.4.1.2021
|
3
|
+
prTable: 1.3.6.1.4.1.2021.2
|
4
|
+
prEntry: 1.3.6.1.4.1.2021.2.1
|
5
|
+
prIndex: 1.3.6.1.4.1.2021.2.1.1
|
6
|
+
prNames: 1.3.6.1.4.1.2021.2.1.2
|
7
|
+
prMin: 1.3.6.1.4.1.2021.2.1.3
|
8
|
+
prMax: 1.3.6.1.4.1.2021.2.1.4
|
9
|
+
prCount: 1.3.6.1.4.1.2021.2.1.5
|
10
|
+
prErrorFlag: 1.3.6.1.4.1.2021.2.1.100
|
11
|
+
prErrMessage: 1.3.6.1.4.1.2021.2.1.101
|
12
|
+
prErrFix: 1.3.6.1.4.1.2021.2.1.102
|
13
|
+
prErrFixCmd: 1.3.6.1.4.1.2021.2.1.103
|
14
|
+
memory: 1.3.6.1.4.1.2021.4
|
15
|
+
memIndex: 1.3.6.1.4.1.2021.4.1
|
16
|
+
memErrorName: 1.3.6.1.4.1.2021.4.2
|
17
|
+
memTotalSwap: 1.3.6.1.4.1.2021.4.3
|
18
|
+
memAvailSwap: 1.3.6.1.4.1.2021.4.4
|
19
|
+
memTotalReal: 1.3.6.1.4.1.2021.4.5
|
20
|
+
memAvailReal: 1.3.6.1.4.1.2021.4.6
|
21
|
+
memTotalSwapTXT: 1.3.6.1.4.1.2021.4.7
|
22
|
+
memAvailSwapTXT: 1.3.6.1.4.1.2021.4.8
|
23
|
+
memTotalRealTXT: 1.3.6.1.4.1.2021.4.9
|
24
|
+
memAvailRealTXT: 1.3.6.1.4.1.2021.4.10
|
25
|
+
memTotalFree: 1.3.6.1.4.1.2021.4.11
|
26
|
+
memMinimumSwap: 1.3.6.1.4.1.2021.4.12
|
27
|
+
memShared: 1.3.6.1.4.1.2021.4.13
|
28
|
+
memBuffer: 1.3.6.1.4.1.2021.4.14
|
29
|
+
memCached: 1.3.6.1.4.1.2021.4.15
|
30
|
+
memUsedSwapTXT: 1.3.6.1.4.1.2021.4.16
|
31
|
+
memUsedRealTXT: 1.3.6.1.4.1.2021.4.17
|
32
|
+
memSwapError: 1.3.6.1.4.1.2021.4.100
|
33
|
+
memSwapErrorMsg: 1.3.6.1.4.1.2021.4.101
|
34
|
+
extTable: 1.3.6.1.4.1.2021.8
|
35
|
+
extEntry: 1.3.6.1.4.1.2021.8.1
|
36
|
+
extIndex: 1.3.6.1.4.1.2021.8.1.1
|
37
|
+
extNames: 1.3.6.1.4.1.2021.8.1.2
|
38
|
+
extCommand: 1.3.6.1.4.1.2021.8.1.3
|
39
|
+
extResult: 1.3.6.1.4.1.2021.8.1.100
|
40
|
+
extOutput: 1.3.6.1.4.1.2021.8.1.101
|
41
|
+
extErrFix: 1.3.6.1.4.1.2021.8.1.102
|
42
|
+
extErrFixCmd: 1.3.6.1.4.1.2021.8.1.103
|
43
|
+
dskTable: 1.3.6.1.4.1.2021.9
|
44
|
+
dskEntry: 1.3.6.1.4.1.2021.9.1
|
45
|
+
dskIndex: 1.3.6.1.4.1.2021.9.1.1
|
46
|
+
dskPath: 1.3.6.1.4.1.2021.9.1.2
|
47
|
+
dskDevice: 1.3.6.1.4.1.2021.9.1.3
|
48
|
+
dskMinimum: 1.3.6.1.4.1.2021.9.1.4
|
49
|
+
dskMinPercent: 1.3.6.1.4.1.2021.9.1.5
|
50
|
+
dskTotal: 1.3.6.1.4.1.2021.9.1.6
|
51
|
+
dskAvail: 1.3.6.1.4.1.2021.9.1.7
|
52
|
+
dskUsed: 1.3.6.1.4.1.2021.9.1.8
|
53
|
+
dskPercent: 1.3.6.1.4.1.2021.9.1.9
|
54
|
+
dskPercentNode: 1.3.6.1.4.1.2021.9.1.10
|
55
|
+
dskTotalLow: 1.3.6.1.4.1.2021.9.1.11
|
56
|
+
dskTotalHigh: 1.3.6.1.4.1.2021.9.1.12
|
57
|
+
dskAvailLow: 1.3.6.1.4.1.2021.9.1.13
|
58
|
+
dskAvailHigh: 1.3.6.1.4.1.2021.9.1.14
|
59
|
+
dskUsedLow: 1.3.6.1.4.1.2021.9.1.15
|
60
|
+
dskUsedHigh: 1.3.6.1.4.1.2021.9.1.16
|
61
|
+
dskErrorFlag: 1.3.6.1.4.1.2021.9.1.100
|
62
|
+
dskErrorMsg: 1.3.6.1.4.1.2021.9.1.101
|
63
|
+
laTable: 1.3.6.1.4.1.2021.10
|
64
|
+
laEntry: 1.3.6.1.4.1.2021.10.1
|
65
|
+
laIndex: 1.3.6.1.4.1.2021.10.1.1
|
66
|
+
laNames: 1.3.6.1.4.1.2021.10.1.2
|
67
|
+
laLoad: 1.3.6.1.4.1.2021.10.1.3
|
68
|
+
laConfig: 1.3.6.1.4.1.2021.10.1.4
|
69
|
+
laLoadInt: 1.3.6.1.4.1.2021.10.1.5
|
70
|
+
laLoadFloat: 1.3.6.1.4.1.2021.10.1.6
|
71
|
+
laErrorFlag: 1.3.6.1.4.1.2021.10.1.100
|
72
|
+
laErrMessage: 1.3.6.1.4.1.2021.10.1.101
|
73
|
+
systemStats: 1.3.6.1.4.1.2021.11
|
74
|
+
ssIndex: 1.3.6.1.4.1.2021.11.1
|
75
|
+
ssErrorName: 1.3.6.1.4.1.2021.11.2
|
76
|
+
ssSwapIn: 1.3.6.1.4.1.2021.11.3
|
77
|
+
ssSwapOut: 1.3.6.1.4.1.2021.11.4
|
78
|
+
ssIOSent: 1.3.6.1.4.1.2021.11.5
|
79
|
+
ssIOReceive: 1.3.6.1.4.1.2021.11.6
|
80
|
+
ssSysInterrupts: 1.3.6.1.4.1.2021.11.7
|
81
|
+
ssSysContext: 1.3.6.1.4.1.2021.11.8
|
82
|
+
ssCpuUser: 1.3.6.1.4.1.2021.11.9
|
83
|
+
ssCpuSystem: 1.3.6.1.4.1.2021.11.10
|
84
|
+
ssCpuIdle: 1.3.6.1.4.1.2021.11.11
|
85
|
+
ssCpuRawUser: 1.3.6.1.4.1.2021.11.50
|
86
|
+
ssCpuRawNice: 1.3.6.1.4.1.2021.11.51
|
87
|
+
ssCpuRawSystem: 1.3.6.1.4.1.2021.11.52
|
88
|
+
ssCpuRawIdle: 1.3.6.1.4.1.2021.11.53
|
89
|
+
ssCpuRawWait: 1.3.6.1.4.1.2021.11.54
|
90
|
+
ssCpuRawKernel: 1.3.6.1.4.1.2021.11.55
|
91
|
+
ssCpuRawInterrupt: 1.3.6.1.4.1.2021.11.56
|
92
|
+
ssIORawSent: 1.3.6.1.4.1.2021.11.57
|
93
|
+
ssIORawReceived: 1.3.6.1.4.1.2021.11.58
|
94
|
+
ssRawInterrupts: 1.3.6.1.4.1.2021.11.59
|
95
|
+
ssRawContexts: 1.3.6.1.4.1.2021.11.60
|
96
|
+
ssCpuRawSoftIRQ: 1.3.6.1.4.1.2021.11.61
|
97
|
+
ssRawSwapIn: 1.3.6.1.4.1.2021.11.62
|
98
|
+
ssRawSwapOut: 1.3.6.1.4.1.2021.11.63
|
99
|
+
ssCpuRawSteal: 1.3.6.1.4.1.2021.11.64
|
100
|
+
ssCpuRawGuest: 1.3.6.1.4.1.2021.11.65
|
101
|
+
ssCpuRawGuestNice: 1.3.6.1.4.1.2021.11.66
|
102
|
+
ucdInternal: 1.3.6.1.4.1.2021.12
|
103
|
+
ucdExperimental: 1.3.6.1.4.1.2021.13
|
104
|
+
fileTable: 1.3.6.1.4.1.2021.15
|
105
|
+
fileEntry: 1.3.6.1.4.1.2021.15.1
|
106
|
+
fileIndex: 1.3.6.1.4.1.2021.15.1.1
|
107
|
+
fileName: 1.3.6.1.4.1.2021.15.1.2
|
108
|
+
fileSize: 1.3.6.1.4.1.2021.15.1.3
|
109
|
+
fileMax: 1.3.6.1.4.1.2021.15.1.4
|
110
|
+
fileErrorFlag: 1.3.6.1.4.1.2021.15.1.100
|
111
|
+
fileErrorMsg: 1.3.6.1.4.1.2021.15.1.101
|
112
|
+
logMatch: 1.3.6.1.4.1.2021.16
|
113
|
+
logMatchMaxEntries: 1.3.6.1.4.1.2021.16.1
|
114
|
+
logMatchTable: 1.3.6.1.4.1.2021.16.2
|
115
|
+
logMatchEntry: 1.3.6.1.4.1.2021.16.2.1
|
116
|
+
logMatchIndex: 1.3.6.1.4.1.2021.16.2.1.1
|
117
|
+
logMatchName: 1.3.6.1.4.1.2021.16.2.1.2
|
118
|
+
logMatchFilename: 1.3.6.1.4.1.2021.16.2.1.3
|
119
|
+
logMatchRegEx: 1.3.6.1.4.1.2021.16.2.1.4
|
120
|
+
logMatchGlobalCounter: 1.3.6.1.4.1.2021.16.2.1.5
|
121
|
+
logMatchGlobalCount: 1.3.6.1.4.1.2021.16.2.1.6
|
122
|
+
logMatchCurrentCounter: 1.3.6.1.4.1.2021.16.2.1.7
|
123
|
+
logMatchCurrentCount: 1.3.6.1.4.1.2021.16.2.1.8
|
124
|
+
logMatchCounter: 1.3.6.1.4.1.2021.16.2.1.9
|
125
|
+
logMatchCount: 1.3.6.1.4.1.2021.16.2.1.10
|
126
|
+
logMatchCycle: 1.3.6.1.4.1.2021.16.2.1.11
|
127
|
+
logMatchErrorFlag: 1.3.6.1.4.1.2021.16.2.1.100
|
128
|
+
logMatchRegExCompilation: 1.3.6.1.4.1.2021.16.2.1.101
|
129
|
+
version: 1.3.6.1.4.1.2021.100
|
130
|
+
versionIndex: 1.3.6.1.4.1.2021.100.1
|
131
|
+
versionTag: 1.3.6.1.4.1.2021.100.2
|
132
|
+
versionDate: 1.3.6.1.4.1.2021.100.3
|
133
|
+
versionCDate: 1.3.6.1.4.1.2021.100.4
|
134
|
+
versionIdent: 1.3.6.1.4.1.2021.100.5
|
135
|
+
versionConfigureOptions: 1.3.6.1.4.1.2021.100.6
|
136
|
+
versionClearCache: 1.3.6.1.4.1.2021.100.10
|
137
|
+
versionUpdateConfig: 1.3.6.1.4.1.2021.100.11
|
138
|
+
versionRestartAgent: 1.3.6.1.4.1.2021.100.12
|
139
|
+
versionSavePersistentData: 1.3.6.1.4.1.2021.100.13
|
140
|
+
versionDoDebugging: 1.3.6.1.4.1.2021.100.20
|
141
|
+
snmperrs: 1.3.6.1.4.1.2021.101
|
142
|
+
snmperrIndex: 1.3.6.1.4.1.2021.101.1
|
143
|
+
snmperrNames: 1.3.6.1.4.1.2021.101.2
|
144
|
+
snmperrErrorFlag: 1.3.6.1.4.1.2021.101.100
|
145
|
+
snmperrErrMessage: 1.3.6.1.4.1.2021.101.101
|
146
|
+
mrTable: 1.3.6.1.4.1.2021.102
|
147
|
+
mrEntry: 1.3.6.1.4.1.2021.102.1
|
148
|
+
mrIndex: 1.3.6.1.4.1.2021.102.1.1
|
149
|
+
mrModuleName: 1.3.6.1.4.1.2021.102.1.2
|
150
|
+
ucdSnmpAgent: 1.3.6.1.4.1.2021.250
|
151
|
+
hpux9: 1.3.6.1.4.1.2021.250.1
|
152
|
+
sunos4: 1.3.6.1.4.1.2021.250.2
|
153
|
+
solaris: 1.3.6.1.4.1.2021.250.3
|
154
|
+
osf: 1.3.6.1.4.1.2021.250.4
|
155
|
+
ultrix: 1.3.6.1.4.1.2021.250.5
|
156
|
+
hpux10: 1.3.6.1.4.1.2021.250.6
|
157
|
+
netbsd1: 1.3.6.1.4.1.2021.250.7
|
158
|
+
freebsd: 1.3.6.1.4.1.2021.250.8
|
159
|
+
irix: 1.3.6.1.4.1.2021.250.9
|
160
|
+
linux: 1.3.6.1.4.1.2021.250.10
|
161
|
+
bsdi: 1.3.6.1.4.1.2021.250.11
|
162
|
+
openbsd: 1.3.6.1.4.1.2021.250.12
|
163
|
+
win32: 1.3.6.1.4.1.2021.250.13
|
164
|
+
hpux11: 1.3.6.1.4.1.2021.250.14
|
165
|
+
aix: 1.3.6.1.4.1.2021.250.15
|
166
|
+
macosx: 1.3.6.1.4.1.2021.250.16
|
167
|
+
dragonfly: 1.3.6.1.4.1.2021.250.17
|
168
|
+
unknown: 1.3.6.1.4.1.2021.250.255
|
169
|
+
ucdTraps: 1.3.6.1.4.1.2021.251
|
data/lib/snmp.rb
CHANGED
@@ -1,10 +1,23 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2004 David R. Halliday
|
3
|
-
# All rights reserved.
|
2
|
+
# Copyright (c) 2004-2014 David R. Halliday
|
4
3
|
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
# THE SOFTWARE.
|
8
21
|
#
|
9
22
|
|
10
23
|
require 'snmp/manager'
|
data/lib/snmp/agent.rb
CHANGED
@@ -1,10 +1,23 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2004 David R. Halliday
|
3
|
-
# All rights reserved.
|
2
|
+
# Copyright (c) 2004-2014 David R. Halliday
|
4
3
|
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
# THE SOFTWARE.
|
8
21
|
#
|
9
22
|
|
10
23
|
require 'snmp'
|
data/lib/snmp/ber.rb
CHANGED
@@ -1,23 +1,25 @@
|
|
1
1
|
# encoding: ascii-8bit
|
2
2
|
#
|
3
|
-
# Copyright (c) 2004 David R. Halliday
|
4
|
-
# All rights reserved.
|
3
|
+
# Copyright (c) 2004-2014 David R. Halliday
|
5
4
|
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
9
11
|
#
|
10
|
-
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
11
14
|
#
|
12
|
-
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
13
22
|
#
|
14
|
-
if "a"[0].kind_of? Fixnum
|
15
|
-
unless Fixnum.methods.include? :ord
|
16
|
-
class Fixnum
|
17
|
-
def ord; self; end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
23
|
|
22
24
|
#
|
23
25
|
# This module implements methods for encoding and decoding SNMP packets
|
data/lib/snmp/manager.rb
CHANGED
@@ -1,10 +1,23 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2004-
|
3
|
-
# All rights reserved.
|
2
|
+
# Copyright (c) 2004-2014 David R. Halliday
|
4
3
|
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
# THE SOFTWARE.
|
8
21
|
#
|
9
22
|
|
10
23
|
require 'snmp/pdu'
|
data/lib/snmp/mib.rb
CHANGED
@@ -1,10 +1,23 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2004 David R. Halliday
|
3
|
-
# All rights reserved.
|
2
|
+
# Copyright (c) 2004-2014 David R. Halliday
|
4
3
|
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
# THE SOFTWARE.
|
8
21
|
#
|
9
22
|
|
10
23
|
require 'snmp/varbind'
|
@@ -170,6 +183,7 @@ module SNMP
|
|
170
183
|
# - list of VarBinds
|
171
184
|
#
|
172
185
|
def varbind_list(object_list, option=:KeepValue)
|
186
|
+
raise ArgumentError, "A list of ObjectId or VarBind objects is NilClass" if object_list.nil?
|
173
187
|
vb_list = VarBindList.new
|
174
188
|
if object_list.respond_to? :to_str
|
175
189
|
vb_list << oid(object_list).to_varbind
|
data/lib/snmp/options.rb
CHANGED
@@ -1,10 +1,23 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2004 David R. Halliday
|
3
|
-
# All rights reserved.
|
2
|
+
# Copyright (c) 2004-2014 David R. Halliday
|
4
3
|
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
# THE SOFTWARE.
|
8
21
|
#
|
9
22
|
|
10
23
|
module SNMP
|
data/lib/snmp/pdu.rb
CHANGED
@@ -1,10 +1,23 @@
|
|
1
1
|
#
|
2
|
-
# Copyright (c) 2004 David R. Halliday
|
3
|
-
# All rights reserved.
|
2
|
+
# Copyright (c) 2004-2014 David R. Halliday
|
4
3
|
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
# THE SOFTWARE.
|
8
21
|
#
|
9
22
|
|
10
23
|
require 'snmp/ber'
|