snmp_table_viewer 0.0.5 → 0.0.6
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/.travis.yml +1 -1
- data/Gemfile +1 -1
- data/Guardfile +1 -2
- data/LICENSE.rdoc +0 -1
- data/README.md +0 -1
- data/data/iftable/type.tsv +272 -0
- data/lib/snmp_table_viewer/converter/if_table.rb +8 -279
- data/spec/snmp_table_viewer/converter/if_table_spec.rb +8 -12
- data/spec/snmp_table_viewer/formatter/table_spec.rb +2 -2
- data/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fddbb2b7c0fbd75714ec61ce5346cd7b01698455
|
|
4
|
+
data.tar.gz: 81c5465e4b119a32976d6e6fd4c49993bc823533
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0c3da99972511e7f1584f35d92ef243c664f36173bf173973fb1ecc367e257fa2e70679fdc3b9897971a40d00cd08280c1ad831c0408028832c667c33cbcb992
|
|
7
|
+
data.tar.gz: 9d7604b4a08bf4fb33e4e9c8641dff71bf3e1dbf59b4e126377328c335487c6f2698f90b8e659115c360db35b6d9d0bf952a65f4692cc56def525c86e35555e8
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Guardfile
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# A sample Guardfile
|
|
2
2
|
# More info at https://github.com/guard/guard#readme
|
|
3
3
|
|
|
4
|
-
guard 'rspec', all_on_start: true, all_after_pass: true do
|
|
4
|
+
guard 'rspec', all_on_start: true, all_after_pass: true, cmd: 'bundle exec rspec' do
|
|
5
5
|
watch(%r{^spec/.+_spec\.rb$})
|
|
6
6
|
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
|
7
|
-
watch(%r{^lib/([^/]+)/(.+)\.rb$}) { |m| "spec/#{m[1]}/#{m[2]}_spec.rb" }
|
|
8
7
|
watch('spec/spec_helper.rb') { "spec" }
|
|
9
8
|
end
|
data/LICENSE.rdoc
CHANGED
|
@@ -12,7 +12,6 @@ then Robert Gauld shall have the right to re-license their commits on their beha
|
|
|
12
12
|
For the purposes of this project the community will be taken to include:
|
|
13
13
|
|
|
14
14
|
- GitHub (make sure you can be contacted through the user name making the commit)
|
|
15
|
-
- The Online Scout Manager forum
|
|
16
15
|
|
|
17
16
|
|
|
18
17
|
===BSD License
|
data/README.md
CHANGED
|
@@ -9,7 +9,6 @@ Master branch:
|
|
|
9
9
|
Staging branch:
|
|
10
10
|
[](http://travis-ci.org/robertgauld/snmp_table_viewer)
|
|
11
11
|
[](https://coveralls.io/r/robertgauld/snmp_table_viewer)
|
|
12
|
-
[](https://codeclimate.com/github/robertgauld/snmp_table_viewer)
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
## Build State
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
1 other
|
|
2
|
+
2 regular1822
|
|
3
|
+
3 hdh1822
|
|
4
|
+
4 ddnX25
|
|
5
|
+
5 rfc877x25
|
|
6
|
+
6 ethernetCsmacd
|
|
7
|
+
7 iso88023Csmacd
|
|
8
|
+
8 iso88024TokenBus
|
|
9
|
+
9 iso88025TokenRing
|
|
10
|
+
10 iso88026Man
|
|
11
|
+
11 starLan
|
|
12
|
+
12 proteon10Mbit
|
|
13
|
+
13 proteon80Mbit
|
|
14
|
+
14 hyperchannel
|
|
15
|
+
15 fddi
|
|
16
|
+
16 lapb
|
|
17
|
+
17 sdlc
|
|
18
|
+
18 ds1
|
|
19
|
+
19 e1
|
|
20
|
+
20 basicISDN
|
|
21
|
+
21 primaryISDN
|
|
22
|
+
22 propPointToPointSerial
|
|
23
|
+
23 ppp
|
|
24
|
+
24 softwareLoopback
|
|
25
|
+
25 eon
|
|
26
|
+
26 ethernet3Mbit
|
|
27
|
+
27 nsip
|
|
28
|
+
28 slip
|
|
29
|
+
29 ultra
|
|
30
|
+
30 ds3
|
|
31
|
+
31 sip
|
|
32
|
+
32 frameRelay
|
|
33
|
+
33 rs232
|
|
34
|
+
34 para
|
|
35
|
+
35 arcnet
|
|
36
|
+
36 arcnetPlus
|
|
37
|
+
37 atm
|
|
38
|
+
38 miox25
|
|
39
|
+
39 sonet
|
|
40
|
+
40 x25ple
|
|
41
|
+
41 iso88022llc
|
|
42
|
+
42 localTalk
|
|
43
|
+
43 smdsDxi
|
|
44
|
+
44 frameRelayService
|
|
45
|
+
45 v35
|
|
46
|
+
46 hssi
|
|
47
|
+
47 hippi
|
|
48
|
+
48 modem
|
|
49
|
+
49 aal5
|
|
50
|
+
50 sonetPath
|
|
51
|
+
51 sonetVT
|
|
52
|
+
52 smdsIcip
|
|
53
|
+
53 propVirtual
|
|
54
|
+
54 propMultiplexor
|
|
55
|
+
55 ieee80212
|
|
56
|
+
56 fibreChannel
|
|
57
|
+
57 hippiInterface
|
|
58
|
+
58 frameRelayInterconnect
|
|
59
|
+
59 aflane8023
|
|
60
|
+
60 aflane8025
|
|
61
|
+
61 cctEmul
|
|
62
|
+
62 fastEther
|
|
63
|
+
63 isdn
|
|
64
|
+
64 v11
|
|
65
|
+
65 v36
|
|
66
|
+
66 g703at64k
|
|
67
|
+
67 g703at2mb
|
|
68
|
+
68 qllc
|
|
69
|
+
69 fastEtherFX
|
|
70
|
+
70 channel
|
|
71
|
+
71 ieee80211
|
|
72
|
+
72 ibm370parChan
|
|
73
|
+
73 escon
|
|
74
|
+
74 dlsw
|
|
75
|
+
75 isdns
|
|
76
|
+
76 isdnu
|
|
77
|
+
77 lapd
|
|
78
|
+
78 ipSwitch
|
|
79
|
+
79 rsrb
|
|
80
|
+
80 atmLogical
|
|
81
|
+
81 ds0
|
|
82
|
+
82 ds0Bundle
|
|
83
|
+
83 bsc
|
|
84
|
+
84 async
|
|
85
|
+
85 cnr
|
|
86
|
+
86 iso88025Dtr
|
|
87
|
+
87 eplrs
|
|
88
|
+
88 arap
|
|
89
|
+
89 propCnls
|
|
90
|
+
90 hostPad
|
|
91
|
+
91 termPad
|
|
92
|
+
92 frameRelayMPI
|
|
93
|
+
93 x213
|
|
94
|
+
94 adsl
|
|
95
|
+
95 radsl
|
|
96
|
+
96 sdsl
|
|
97
|
+
97 vdsl
|
|
98
|
+
98 iso88025CRFPInt
|
|
99
|
+
99 myrinet
|
|
100
|
+
100 voiceEM
|
|
101
|
+
101 voiceFXO
|
|
102
|
+
102 voiceFXS
|
|
103
|
+
103 voiceEncap
|
|
104
|
+
104 voiceOverIp
|
|
105
|
+
105 atmDxi
|
|
106
|
+
106 atmFuni
|
|
107
|
+
107 atmIma
|
|
108
|
+
108 pppMultilinkBundle
|
|
109
|
+
109 ipOverCdlc
|
|
110
|
+
110 ipOverClaw
|
|
111
|
+
111 stackToStack
|
|
112
|
+
112 virtualIpAddress
|
|
113
|
+
113 mpc
|
|
114
|
+
114 ipOverAtm
|
|
115
|
+
115 iso88025Fiber
|
|
116
|
+
116 tdlc
|
|
117
|
+
117 gigabitEthernet
|
|
118
|
+
118 hdlc
|
|
119
|
+
119 lapf
|
|
120
|
+
120 v37
|
|
121
|
+
121 x25mlp
|
|
122
|
+
122 x25huntGroup
|
|
123
|
+
123 transpHdlc
|
|
124
|
+
124 interleave
|
|
125
|
+
125 fast
|
|
126
|
+
126 ip
|
|
127
|
+
127 docsCableMaclayer
|
|
128
|
+
128 docsCableDownstream
|
|
129
|
+
129 docsCableUpstream
|
|
130
|
+
130 a12MppSwitch
|
|
131
|
+
131 tunnel
|
|
132
|
+
132 coffee
|
|
133
|
+
133 ces
|
|
134
|
+
134 atmSubInterface
|
|
135
|
+
135 l2vlan
|
|
136
|
+
136 l3ipvlan
|
|
137
|
+
137 l3ipxvlan
|
|
138
|
+
138 digitalPowerline
|
|
139
|
+
139 mediaMailOverIp
|
|
140
|
+
140 dtm
|
|
141
|
+
141 dcn
|
|
142
|
+
142 ipForward
|
|
143
|
+
143 msdsl
|
|
144
|
+
144 ieee1394
|
|
145
|
+
145 if-gsn
|
|
146
|
+
146 dvbRccMacLayer
|
|
147
|
+
147 dvbRccDownstream
|
|
148
|
+
148 dvbRccUpstream
|
|
149
|
+
149 atmVirtual
|
|
150
|
+
150 mplsTunnel
|
|
151
|
+
151 srp
|
|
152
|
+
152 voiceOverAtm
|
|
153
|
+
153 voiceOverFrameRelay
|
|
154
|
+
154 idsl
|
|
155
|
+
155 compositeLink
|
|
156
|
+
156 ss7SigLink
|
|
157
|
+
157 propWirelessP2P
|
|
158
|
+
158 frForward
|
|
159
|
+
159 rfc1483
|
|
160
|
+
160 usb
|
|
161
|
+
161 ieee8023adLag
|
|
162
|
+
162 bgppolicyaccounting
|
|
163
|
+
163 frf16MfrBundle
|
|
164
|
+
164 h323Gatekeeper
|
|
165
|
+
165 h323Proxy
|
|
166
|
+
166 mpls
|
|
167
|
+
167 mfSigLink
|
|
168
|
+
168 hdsl2
|
|
169
|
+
169 shdsl
|
|
170
|
+
170 ds1FDL
|
|
171
|
+
171 pos
|
|
172
|
+
172 dvbAsiIn
|
|
173
|
+
173 dvbAsiOut
|
|
174
|
+
174 plc
|
|
175
|
+
175 nfas
|
|
176
|
+
176 tr008
|
|
177
|
+
177 gr303RDT
|
|
178
|
+
178 gr303IDT
|
|
179
|
+
179 isup
|
|
180
|
+
180 propDocsWirelessMaclayer
|
|
181
|
+
181 propDocsWirelessDownstream
|
|
182
|
+
182 propDocsWirelessUpstream
|
|
183
|
+
183 hiperlan2
|
|
184
|
+
184 propBWAp2Mp
|
|
185
|
+
185 sonetOverheadChannel
|
|
186
|
+
186 digitalWrapperOverheadChannel
|
|
187
|
+
187 aal2
|
|
188
|
+
188 radioMAC
|
|
189
|
+
189 atmRadio
|
|
190
|
+
190 imt
|
|
191
|
+
191 mvl
|
|
192
|
+
192 reachDSL
|
|
193
|
+
193 frDlciEndPt
|
|
194
|
+
194 atmVciEndPt
|
|
195
|
+
195 opticalChannel
|
|
196
|
+
196 opticalTransport
|
|
197
|
+
197 propAtm
|
|
198
|
+
198 voiceOverCable
|
|
199
|
+
199 infiniband
|
|
200
|
+
200 teLink
|
|
201
|
+
201 q2931
|
|
202
|
+
202 virtualTg
|
|
203
|
+
203 sipTg
|
|
204
|
+
204 sipSig
|
|
205
|
+
205 docsCableUpstreamChannel
|
|
206
|
+
206 econet
|
|
207
|
+
207 pon155
|
|
208
|
+
208 pon622
|
|
209
|
+
209 bridge
|
|
210
|
+
210 linegroup
|
|
211
|
+
211 voiceEMFGD
|
|
212
|
+
212 voiceFGDEANA
|
|
213
|
+
213 voiceDID
|
|
214
|
+
214 mpegTransport
|
|
215
|
+
215 sixToFour
|
|
216
|
+
216 gtp
|
|
217
|
+
217 pdnEtherLoop1
|
|
218
|
+
218 pdnEtherLoop2
|
|
219
|
+
219 opticalChannelGroup
|
|
220
|
+
220 homepna
|
|
221
|
+
221 gfp
|
|
222
|
+
222 ciscoISLvlan
|
|
223
|
+
223 actelisMetaLOOP
|
|
224
|
+
224 fcipLink
|
|
225
|
+
225 rpr
|
|
226
|
+
226 qam
|
|
227
|
+
227 lmp
|
|
228
|
+
228 cblVectaStar
|
|
229
|
+
229 docsCableMCmtsDownstream
|
|
230
|
+
230 adsl2
|
|
231
|
+
231 macSecControlledIF
|
|
232
|
+
232 macSecUncontrolledIF
|
|
233
|
+
233 aviciOpticalEther
|
|
234
|
+
234 atmbond
|
|
235
|
+
235 voiceFGDOS
|
|
236
|
+
236 mocaVersion1
|
|
237
|
+
237 ieee80216WMAN
|
|
238
|
+
238 adsl2plus
|
|
239
|
+
239 dvbRcsMacLayer
|
|
240
|
+
240 dvbTdm
|
|
241
|
+
241 dvbRcsTdma
|
|
242
|
+
242 x86Laps
|
|
243
|
+
243 wwanPP
|
|
244
|
+
244 wwanPP2
|
|
245
|
+
245 voiceEBS
|
|
246
|
+
246 ifPwType
|
|
247
|
+
247 ilan
|
|
248
|
+
248 pip
|
|
249
|
+
249 aluELP
|
|
250
|
+
250 gpon
|
|
251
|
+
251 vdsl2
|
|
252
|
+
252 capwapDot11Profile
|
|
253
|
+
253 capwapDot11Bss
|
|
254
|
+
254 capwapWtpVirtualRadio
|
|
255
|
+
255 bits
|
|
256
|
+
256 docsCableUpstreamRfPort
|
|
257
|
+
257 cableDownstreamRfPort
|
|
258
|
+
258 vmwareVirtualNic
|
|
259
|
+
259 ieee802154
|
|
260
|
+
260 otnOdu
|
|
261
|
+
261 otnOtu
|
|
262
|
+
262 ifVfiType
|
|
263
|
+
263 g9981
|
|
264
|
+
264 g9982
|
|
265
|
+
265 g9983
|
|
266
|
+
266 aluEpon
|
|
267
|
+
267 aluEponOnu
|
|
268
|
+
268 aluEponPhysicalUni
|
|
269
|
+
269 aluEponLogicalLink
|
|
270
|
+
270 aluGponOnu
|
|
271
|
+
271 aluGponPhysicalUni
|
|
272
|
+
272 vmwareNicTeam
|
|
@@ -6,287 +6,16 @@ module SNMPTableViewer
|
|
|
6
6
|
# Replaces oper state with "number (meaning)"
|
|
7
7
|
# Replaces last change with "Timeticks: (number) D days, H:M:S.ms"
|
|
8
8
|
class Converter::IfTable < Converter
|
|
9
|
+
ADMIN_STATES = ['up', 'down', 'testing']
|
|
10
|
+
OPER_STATES = ['up', 'down', 'testing', 'unknown', 'dormant', 'notPresent', 'lowerLayerDown']
|
|
11
|
+
TYPES = CSV.read(File.join(__dir__, '..', '..', '..', 'data', 'iftable', 'type.tsv'), col_sep: "\t").each{ |i| i[0] = i[0].to_i }.to_h
|
|
12
|
+
private_constant :ADMIN_STATES, :OPER_STATES, :TYPES
|
|
13
|
+
|
|
9
14
|
def self.convert(data)
|
|
10
|
-
admin_states = ['up', 'down', 'testing']
|
|
11
|
-
oper_states = ['up', 'down', 'testing', 'unknown', 'dormant', 'notPresent', 'lowerLayerDown']
|
|
12
|
-
types = {
|
|
13
|
-
1 => 'other',
|
|
14
|
-
2 => 'regular1822',
|
|
15
|
-
3 => 'hdh1822',
|
|
16
|
-
4 => 'ddnX25',
|
|
17
|
-
5 => 'rfc877x25',
|
|
18
|
-
6 => 'ethernetCsmacd',
|
|
19
|
-
7 => 'iso88023Csmacd',
|
|
20
|
-
8 => 'iso88024TokenBus',
|
|
21
|
-
9 => 'iso88025TokenRing',
|
|
22
|
-
10 => 'iso88026Man',
|
|
23
|
-
11 => 'starLan',
|
|
24
|
-
12 => 'proteon10Mbit',
|
|
25
|
-
13 => 'proteon80Mbit',
|
|
26
|
-
14 => 'hyperchannel',
|
|
27
|
-
15 => 'fddi',
|
|
28
|
-
16 => 'lapb',
|
|
29
|
-
17 => 'sdlc',
|
|
30
|
-
18 => 'ds1',
|
|
31
|
-
19 => 'e1',
|
|
32
|
-
20 => 'basicISDN',
|
|
33
|
-
21 => 'primaryISDN',
|
|
34
|
-
22 => 'propPointToPointSerial',
|
|
35
|
-
23 => 'ppp',
|
|
36
|
-
24 => 'softwareLoopback',
|
|
37
|
-
25 => 'eon',
|
|
38
|
-
26 => 'ethernet3Mbit',
|
|
39
|
-
27 => 'nsip',
|
|
40
|
-
28 => 'slip',
|
|
41
|
-
29 => 'ultra',
|
|
42
|
-
30 => 'ds3',
|
|
43
|
-
31 => 'sip',
|
|
44
|
-
32 => 'frameRelay',
|
|
45
|
-
33 => 'rs232',
|
|
46
|
-
34 => 'para',
|
|
47
|
-
35 => 'arcnet',
|
|
48
|
-
36 => 'arcnetPlus',
|
|
49
|
-
37 => 'atm',
|
|
50
|
-
38 => 'miox25',
|
|
51
|
-
39 => 'sonet',
|
|
52
|
-
40 => 'x25ple',
|
|
53
|
-
41 => 'iso88022llc',
|
|
54
|
-
42 => 'localTalk',
|
|
55
|
-
43 => 'smdsDxi',
|
|
56
|
-
44 => 'frameRelayService',
|
|
57
|
-
45 => 'v35',
|
|
58
|
-
46 => 'hssi',
|
|
59
|
-
47 => 'hippi',
|
|
60
|
-
48 => 'modem',
|
|
61
|
-
49 => 'aal5',
|
|
62
|
-
50 => 'sonetPath',
|
|
63
|
-
51 => 'sonetVT',
|
|
64
|
-
52 => 'smdsIcip',
|
|
65
|
-
53 => 'propVirtual',
|
|
66
|
-
54 => 'propMultiplexor',
|
|
67
|
-
55 => 'ieee80212',
|
|
68
|
-
56 => 'fibreChannel',
|
|
69
|
-
57 => 'hippiInterface',
|
|
70
|
-
58 => 'frameRelayInterconnect',
|
|
71
|
-
59 => 'aflane8023',
|
|
72
|
-
60 => 'aflane8025',
|
|
73
|
-
61 => 'cctEmul',
|
|
74
|
-
62 => 'fastEther',
|
|
75
|
-
63 => 'isdn',
|
|
76
|
-
64 => 'v11',
|
|
77
|
-
65 => 'v36',
|
|
78
|
-
66 => 'g703at64k',
|
|
79
|
-
67 => 'g703at2mb',
|
|
80
|
-
68 => 'qllc',
|
|
81
|
-
69 => 'fastEtherFX',
|
|
82
|
-
70 => 'channel',
|
|
83
|
-
71 => 'ieee80211',
|
|
84
|
-
72 => 'ibm370parChan',
|
|
85
|
-
73 => 'escon',
|
|
86
|
-
74 => 'dlsw',
|
|
87
|
-
75 => 'isdns',
|
|
88
|
-
76 => 'isdnu',
|
|
89
|
-
77 => 'lapd',
|
|
90
|
-
78 => 'ipSwitch',
|
|
91
|
-
79 => 'rsrb',
|
|
92
|
-
80 => 'atmLogical',
|
|
93
|
-
81 => 'ds0',
|
|
94
|
-
82 => 'ds0Bundle',
|
|
95
|
-
83 => 'bsc',
|
|
96
|
-
84 => 'async',
|
|
97
|
-
85 => 'cnr',
|
|
98
|
-
86 => 'iso88025Dtr',
|
|
99
|
-
87 => 'eplrs',
|
|
100
|
-
88 => 'arap',
|
|
101
|
-
89 => 'propCnls',
|
|
102
|
-
90 => 'hostPad',
|
|
103
|
-
91 => 'termPad',
|
|
104
|
-
92 => 'frameRelayMPI',
|
|
105
|
-
93 => 'x213',
|
|
106
|
-
94 => 'adsl',
|
|
107
|
-
95 => 'radsl',
|
|
108
|
-
96 => 'sdsl',
|
|
109
|
-
97 => 'vdsl',
|
|
110
|
-
98 => 'iso88025CRFPInt',
|
|
111
|
-
99 => 'myrinet',
|
|
112
|
-
100 => 'voiceEM',
|
|
113
|
-
101 => 'voiceFXO',
|
|
114
|
-
102 => 'voiceFXS',
|
|
115
|
-
103 => 'voiceEncap',
|
|
116
|
-
104 => 'voiceOverIp',
|
|
117
|
-
105 => 'atmDxi',
|
|
118
|
-
106 => 'atmFuni',
|
|
119
|
-
107 => 'atmIma',
|
|
120
|
-
108 => 'pppMultilinkBundle',
|
|
121
|
-
109 => 'ipOverCdlc',
|
|
122
|
-
110 => 'ipOverClaw',
|
|
123
|
-
111 => 'stackToStack',
|
|
124
|
-
112 => 'virtualIpAddress',
|
|
125
|
-
113 => 'mpc',
|
|
126
|
-
114 => 'ipOverAtm',
|
|
127
|
-
115 => 'iso88025Fiber',
|
|
128
|
-
116 => 'tdlc',
|
|
129
|
-
117 => 'gigabitEthernet',
|
|
130
|
-
118 => 'hdlc',
|
|
131
|
-
119 => 'lapf',
|
|
132
|
-
120 => 'v37',
|
|
133
|
-
121 => 'x25mlp',
|
|
134
|
-
122 => 'x25huntGroup',
|
|
135
|
-
123 => 'transpHdlc',
|
|
136
|
-
124 => 'interleave',
|
|
137
|
-
125 => 'fast',
|
|
138
|
-
126 => 'ip',
|
|
139
|
-
127 => 'docsCableMaclayer',
|
|
140
|
-
128 => 'docsCableDownstream',
|
|
141
|
-
129 => 'docsCableUpstream',
|
|
142
|
-
130 => 'a12MppSwitch',
|
|
143
|
-
131 => 'tunnel',
|
|
144
|
-
132 => 'coffee',
|
|
145
|
-
133 => 'ces',
|
|
146
|
-
134 => 'atmSubInterface',
|
|
147
|
-
135 => 'l2vlan',
|
|
148
|
-
136 => 'l3ipvlan',
|
|
149
|
-
137 => 'l3ipxvlan',
|
|
150
|
-
138 => 'digitalPowerline',
|
|
151
|
-
139 => 'mediaMailOverIp',
|
|
152
|
-
140 => 'dtm',
|
|
153
|
-
141 => 'dcn',
|
|
154
|
-
142 => 'ipForward',
|
|
155
|
-
143 => 'msdsl',
|
|
156
|
-
144 => 'ieee1394',
|
|
157
|
-
145 => 'if-gsn',
|
|
158
|
-
146 => 'dvbRccMacLayer',
|
|
159
|
-
147 => 'dvbRccDownstream',
|
|
160
|
-
148 => 'dvbRccUpstream',
|
|
161
|
-
149 => 'atmVirtual',
|
|
162
|
-
150 => 'mplsTunnel',
|
|
163
|
-
151 => 'srp',
|
|
164
|
-
152 => 'voiceOverAtm',
|
|
165
|
-
153 => 'voiceOverFrameRelay',
|
|
166
|
-
154 => 'idsl',
|
|
167
|
-
155 => 'compositeLink',
|
|
168
|
-
156 => 'ss7SigLink',
|
|
169
|
-
157 => 'propWirelessP2P',
|
|
170
|
-
158 => 'frForward',
|
|
171
|
-
159 => 'rfc1483',
|
|
172
|
-
160 => 'usb',
|
|
173
|
-
161 => 'ieee8023adLag',
|
|
174
|
-
162 => 'bgppolicyaccounting',
|
|
175
|
-
163 => 'frf16MfrBundle',
|
|
176
|
-
164 => 'h323Gatekeeper',
|
|
177
|
-
165 => 'h323Proxy',
|
|
178
|
-
166 => 'mpls',
|
|
179
|
-
167 => 'mfSigLink',
|
|
180
|
-
168 => 'hdsl2',
|
|
181
|
-
169 => 'shdsl',
|
|
182
|
-
170 => 'ds1FDL',
|
|
183
|
-
171 => 'pos',
|
|
184
|
-
172 => 'dvbAsiIn',
|
|
185
|
-
173 => 'dvbAsiOut',
|
|
186
|
-
174 => 'plc',
|
|
187
|
-
175 => 'nfas',
|
|
188
|
-
176 => 'tr008',
|
|
189
|
-
177 => 'gr303RDT',
|
|
190
|
-
178 => 'gr303IDT',
|
|
191
|
-
179 => 'isup',
|
|
192
|
-
180 => 'propDocsWirelessMaclayer',
|
|
193
|
-
181 => 'propDocsWirelessDownstream',
|
|
194
|
-
182 => 'propDocsWirelessUpstream',
|
|
195
|
-
183 => 'hiperlan2',
|
|
196
|
-
184 => 'propBWAp2Mp',
|
|
197
|
-
185 => 'sonetOverheadChannel',
|
|
198
|
-
186 => 'digitalWrapperOverheadChannel',
|
|
199
|
-
187 => 'aal2',
|
|
200
|
-
188 => 'radioMAC',
|
|
201
|
-
189 => 'atmRadio',
|
|
202
|
-
190 => 'imt',
|
|
203
|
-
191 => 'mvl',
|
|
204
|
-
192 => 'reachDSL',
|
|
205
|
-
193 => 'frDlciEndPt',
|
|
206
|
-
194 => 'atmVciEndPt',
|
|
207
|
-
195 => 'opticalChannel',
|
|
208
|
-
196 => 'opticalTransport',
|
|
209
|
-
197 => 'propAtm',
|
|
210
|
-
198 => 'voiceOverCable',
|
|
211
|
-
199 => 'infiniband',
|
|
212
|
-
200 => 'teLink',
|
|
213
|
-
201 => 'q2931',
|
|
214
|
-
202 => 'virtualTg',
|
|
215
|
-
203 => 'sipTg',
|
|
216
|
-
204 => 'sipSig',
|
|
217
|
-
205 => 'docsCableUpstreamChannel',
|
|
218
|
-
206 => 'econet',
|
|
219
|
-
207 => 'pon155',
|
|
220
|
-
208 => 'pon622',
|
|
221
|
-
209 => 'bridge',
|
|
222
|
-
210 => 'linegroup',
|
|
223
|
-
211 => 'voiceEMFGD',
|
|
224
|
-
212 => 'voiceFGDEANA',
|
|
225
|
-
213 => 'voiceDID',
|
|
226
|
-
214 => 'mpegTransport',
|
|
227
|
-
215 => 'sixToFour',
|
|
228
|
-
216 => 'gtp',
|
|
229
|
-
217 => 'pdnEtherLoop1',
|
|
230
|
-
218 => 'pdnEtherLoop2',
|
|
231
|
-
219 => 'opticalChannelGroup',
|
|
232
|
-
220 => 'homepna',
|
|
233
|
-
221 => 'gfp',
|
|
234
|
-
222 => 'ciscoISLvlan',
|
|
235
|
-
223 => 'actelisMetaLOOP',
|
|
236
|
-
224 => 'fcipLink',
|
|
237
|
-
225 => 'rpr',
|
|
238
|
-
226 => 'qam',
|
|
239
|
-
227 => 'lmp',
|
|
240
|
-
228 => 'cblVectaStar',
|
|
241
|
-
229 => 'docsCableMCmtsDownstream',
|
|
242
|
-
230 => 'adsl2',
|
|
243
|
-
231 => 'macSecControlledIF',
|
|
244
|
-
232 => 'macSecUncontrolledIF',
|
|
245
|
-
233 => 'aviciOpticalEther',
|
|
246
|
-
234 => 'atmbond',
|
|
247
|
-
235 => 'voiceFGDOS',
|
|
248
|
-
236 => 'mocaVersion1',
|
|
249
|
-
237 => 'ieee80216WMAN',
|
|
250
|
-
238 => 'adsl2plus',
|
|
251
|
-
239 => 'dvbRcsMacLayer',
|
|
252
|
-
240 => 'dvbTdm',
|
|
253
|
-
241 => 'dvbRcsTdma',
|
|
254
|
-
242 => 'x86Laps',
|
|
255
|
-
243 => 'wwanPP',
|
|
256
|
-
244 => 'wwanPP2',
|
|
257
|
-
245 => 'voiceEBS',
|
|
258
|
-
246 => 'ifPwType',
|
|
259
|
-
247 => 'ilan',
|
|
260
|
-
248 => 'pip',
|
|
261
|
-
249 => 'aluELP',
|
|
262
|
-
250 => 'gpon',
|
|
263
|
-
251 => 'vdsl2',
|
|
264
|
-
252 => 'capwapDot11Profile',
|
|
265
|
-
253 => 'capwapDot11Bss',
|
|
266
|
-
254 => 'capwapWtpVirtualRadio',
|
|
267
|
-
255 => 'bits',
|
|
268
|
-
256 => 'docsCableUpstreamRfPort',
|
|
269
|
-
257 => 'cableDownstreamRfPort',
|
|
270
|
-
258 => 'vmwareVirtualNic',
|
|
271
|
-
259 => 'ieee802154',
|
|
272
|
-
260 => 'otnOdu',
|
|
273
|
-
261 => 'otnOtu',
|
|
274
|
-
262 => 'ifVfiType',
|
|
275
|
-
263 => 'g9981',
|
|
276
|
-
264 => 'g9982',
|
|
277
|
-
265 => 'g9983',
|
|
278
|
-
266 => 'aluEpon',
|
|
279
|
-
267 => 'aluEponOnu',
|
|
280
|
-
268 => 'aluEponPhysicalUni',
|
|
281
|
-
269 => 'aluEponLogicalLink',
|
|
282
|
-
270 => 'aluGponOnu',
|
|
283
|
-
271 => 'aluGponPhysicalUni',
|
|
284
|
-
272 => 'vmwareNicTeam',
|
|
285
|
-
}
|
|
286
15
|
data.map do |item|
|
|
287
|
-
item[2] = "#{item[2]} (#{
|
|
288
|
-
item[6] = "#{item[6]} (#{
|
|
289
|
-
item[7] = "#{item[7]} (#{
|
|
16
|
+
item[2] = "#{item[2]} (#{TYPES[item[2]]})"
|
|
17
|
+
item[6] = "#{item[6]} (#{ADMIN_STATES[item[6]-1]})"
|
|
18
|
+
item[7] = "#{item[7]} (#{OPER_STATES[item[7]-1]})"
|
|
290
19
|
item[8] = item[8].to_s # Timeticks for last change
|
|
291
20
|
item
|
|
292
21
|
end
|
|
@@ -1,36 +1,32 @@
|
|
|
1
1
|
describe SNMPTableViewer::Converter::IfTable do
|
|
2
2
|
|
|
3
3
|
describe '#convert' do
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
let(:input) do
|
|
5
|
+
[
|
|
6
|
+
[1, "lo", 24, 65536, nil, "", 1, 2, NETSNMP::Timetick.new(100), 18985, 220, 0, 0, 0, 0, 18985, 220, 0, 0, 0, nil, "0.0"]
|
|
7
|
+
]
|
|
7
8
|
end
|
|
8
9
|
|
|
9
10
|
it 'Converts type' do
|
|
10
|
-
output = described_class.convert(
|
|
11
|
+
output = described_class.convert(input)[0]
|
|
11
12
|
expect(output[2]).to eq '24 (softwareLoopback)'
|
|
12
13
|
end
|
|
13
14
|
|
|
14
15
|
it 'Converts admin state' do
|
|
15
|
-
output = described_class.convert(
|
|
16
|
+
output = described_class.convert(input)[0]
|
|
16
17
|
expect(output[6]).to eq '1 (up)'
|
|
17
18
|
end
|
|
18
19
|
|
|
19
20
|
it 'Converts oper state' do
|
|
20
|
-
output = described_class.convert(
|
|
21
|
+
output = described_class.convert(input)[0]
|
|
21
22
|
expect(output[7]).to eq '2 (down)'
|
|
22
23
|
end
|
|
23
24
|
|
|
24
25
|
it 'Converts last change' do
|
|
25
|
-
output = described_class.convert(
|
|
26
|
+
output = described_class.convert(input)[0]
|
|
26
27
|
expect(output[8]).to eq 'Timeticks: (100) 0 days, 0:0:1.0'
|
|
27
28
|
end
|
|
28
29
|
|
|
29
30
|
end # describe #convert
|
|
30
31
|
|
|
31
32
|
end
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
# [1, "lo", 24, 65536, nil, "", 1, 1, NETSNMP::Timetick.new(100), 18985, 220, 0, 0, 0, 0, 18985, 220, 0, 0, 0, nil, "0.0"]
|
|
@@ -33,7 +33,7 @@ describe SNMPTableViewer::Formatter::Table do
|
|
|
33
33
|
].join("\n")
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
context 'Transposes output' do
|
|
37
37
|
|
|
38
38
|
it 'With headings' do
|
|
39
39
|
headings = ['heading1', 'heading2', 'heading3']
|
|
@@ -66,7 +66,7 @@ describe SNMPTableViewer::Formatter::Table do
|
|
|
66
66
|
].join("\n")
|
|
67
67
|
end
|
|
68
68
|
|
|
69
|
-
end #
|
|
69
|
+
end # context transposes output
|
|
70
70
|
|
|
71
71
|
end # describe #output
|
|
72
72
|
|
data/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: snmp_table_viewer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Robert Gauld
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-07-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: netsnmp
|
|
@@ -156,6 +156,7 @@ files:
|
|
|
156
156
|
- Rakefile
|
|
157
157
|
- bin/table-from-snmp
|
|
158
158
|
- bin/table-from-stdin
|
|
159
|
+
- data/iftable/type.tsv
|
|
159
160
|
- lib/snmp_table_viewer.rb
|
|
160
161
|
- lib/snmp_table_viewer/converter.rb
|
|
161
162
|
- lib/snmp_table_viewer/converter/if_table.rb
|