1SNMP::Info::Layer3(3) User Contributed Perl DocumentationSNMP::Info::Layer3(3)
2
3
4
6 SNMP::Info::Layer3 - SNMP Interface to network devices serving Layer3
7 or Layers 2 & 3
8
10 Max Baker
11
13 # Let SNMP::Info determine the correct subclass for you.
14 my $l3 = new SNMP::Info(
15 AutoSpecify => 1,
16 Debug => 1,
17 DestHost => 'myswitch',
18 Community => 'public',
19 Version => 2
20 )
21 or die "Can't connect to DestHost.\n";
22
23 my $class = $l3->class();
24 print "SNMP::Info determined this device to fall under subclass : $class\n";
25
26 # Let's get some basic Port information
27 my $interfaces = $l3->interfaces();
28 my $i_up = $l3->i_up();
29 my $i_speed = $l3->i_speed();
30 foreach my $iid (keys %$interfaces) {
31 my $port = $interfaces->{$iid};
32 my $up = $i_up->{$iid};
33 my $speed = $i_speed->{$iid}
34 print "Port $port is $up. Port runs at $speed.\n";
35 }
36
38 This class is usually used as a superclass for more specific device
39 classes listed under SNMP::Info::Layer3::* Please read all docs under
40 SNMP::Info first.
41
42 Provides generic methods for accessing SNMP data for Layer 3 network
43 devices. Includes support for Layer2+3 devices.
44
45 For speed or debugging purposes you can call the subclass directly, but
46 not after determining a more specific class using the method above.
47
48 my $l3 = new SNMP::Info::Layer3(...);
49
50 Inherited Classes
51 SNMP::Info
52 SNMP::Info::Bridge (For L2/L3 devices)
53 SNMP::Info::EtherLike
54 SNMP::Info::Entity
55 SNMP::Info::PowerEthernet
56 SNMP::Info::IPv6
57 SNMP::Info::LLDP
58 SNMP::Info::DocsisHE
59 SNMP::Info::AdslLine
60
61 Required MIBs
62 IP-MIB
63 ISIS-MIB
64 OSPF-MIB
65 BGP4-MIB
66
67 Inherited MIBs
68 See "REQUIREMENTS" in SNMP::Info for its MIB requirements.
69
70 See "Required MIBs" in SNMP::Info::Bridge for its MIB requirements.
71
72 See "Required MIBs" in SNMP::Info::EtherLike for its MIB requirements.
73
74 See "Required MIBs" in SNMP::Info::Entity for its MIB requirements.
75
76 See "Required MIBs" in SNMP::Info::PowerEthernet for its MIB
77 requirements.
78
79 See "Required MIBs" in SNMP::Info::IPv6 for its MIB requirements.
80
81 See "Required MIBs" in SNMP::Info::LLDP for its MIB requirements.
82
83 See "Required MIBs" in SNMP::Info::DocsisHE for its MIB requirements.
84
85 See "Required MIBs" in SNMP::Info::AdslLine for its MIB requirements.
86
88 These are methods that return scalar value from SNMP
89
90 $l3->mac()
91 Returns root port mac address
92
93 ("ifPhysAddress.1")
94
95 $l3->router_ip()
96 ("ospfRouterId.0")
97
98 $l3->bgp_id()
99 ("bgpIdentifier.0")
100
101 Returns the BGP identifier of the local system
102
103 $l3->bgp_local_as()
104 Returns the local autonomous system number
105
106 ("bgpLocalAs.0")
107
108 Overrides
109 $l3->model()
110 Tries to reference $l3->id() to one of the product MIBs listed
111 above
112
113 Removes 'cisco' from cisco devices for readability.
114
115 $l3->serial()
116 Returns a serial number if found from ENTITY-MIB and OLD-CISCO-...
117 MIB.
118
119 $l3->vendor()
120 Tries to cull a Vendor name from "sysDescr"
121
122 $l3->root_ip()
123 Returns the primary IP used to communicate with the device.
124 Returns the first found: OSPF Router ID ("ospfRouterId") or any
125 OSPF Host IP Address ("ospfHostIpAddress").
126
127 Globals imported from SNMP::Info
128 See "USAGE" in SNMP::Info for details.
129
130 Global Methods imported from SNMP::Info::Bridge
131 See "GLOBALS" in SNMP::Info::Bridge for details.
132
133 Global Methods imported from SNMP::Info::EtherLike
134 See "GLOBALS" in SNMP::Info::EtherLike for details.
135
136 Global Methods imported from SNMP::Info::Entity
137 See "GLOBALS" in SNMP::Info::Entity for details.
138
139 Global Methods imported from SNMP::Info:PowerEthernet
140 See "GLOBALS" in SNMP::Info::PowerEthernet for details.
141
142 Global Methods imported from SNMP::Info::IPv6
143 See "GLOBALS" in SNMP::Info::IPv6 for details.
144
145 Global Methods imported from SNMP::Info::LLDP
146 See "GLOBALS" in SNMP::Info::LLDP for details.
147
148 Global Methods imported from SNMP::Info::DocsisHE
149 See "GLOBALS" in SNMP::Info::DocsisHE for details.
150
151 Global Methods imported from SNMP::Info::AdslLine
152 See "GLOBALS" in SNMP::Info::AdslLine for details.
153
155 These are methods that return tables of information in the form of a
156 reference to a hash.
157
158 Overrides
159 $l3->interfaces()
160 Returns the map between SNMP Interface Identifier (iid) and
161 physical port name.
162
163 Only returns those iids that have a description listed in
164 $l3->i_description()
165
166 $l3->i_name()
167 Returns reference to hash of iid to human set name.
168
169 Defaults to "ifName", but checks for an "ifAlias"
170
171 $l3->i_duplex()
172 Returns reference to hash of iid to current link duplex setting.
173
174 Maps $l3->el_index() to $l3->el_duplex, then culls out full,half,
175 or auto and sets the map to that value.
176
177 See SNMP::Info::EtherLike for the el_index() and el_duplex()
178 methods.
179
180 IP-MIB Arp Cache Table ("ipNetToMediaTable")
181 $l3->at_index()
182 Returns reference to hash. Maps ARP table entries to Interface
183 IIDs
184
185 ("ipNetToMediaIfIndex")
186
187 If the device doesn't support "ipNetToMediaIfIndex", this will try
188 the deprecated "atIfIndex".
189
190 $l3->at_paddr()
191 Returns reference to hash. Maps ARP table entries to MAC
192 addresses.
193
194 ("ipNetToMediaPhysAddress")
195
196 If the device doesn't support "ipNetToMediaPhysAddress", this will
197 try the deprecated "atPhysAddress".
198
199 $l3->at_netaddr()
200 Returns reference to hash. Maps ARP table entries to IP addresses.
201
202 ("ipNetToMediaNetAddress")
203
204 If the device doesn't support "ipNetToMediaNetAddress", this will
205 try the deprecated "atNetAddress".
206
207 ARP Cache Entries
208 The "atTable" has been deprecated since 1991. You should never need to
209 use these methods. See "ipNetToMediaTable" above.
210
211 $l3->old_at_index()
212 Returns reference to map of IID to Arp Cache Entry
213
214 ("atIfIndex")
215
216 $l3->old_at_paddr()
217 Returns reference to hash of Arp Cache Entries to MAC address
218
219 ("atPhysAddress")
220
221 $l3->old_at_netaddr()
222 Returns reference to hash of Arp Cache Entries to IP Address
223
224 ("atNetAddress")
225
226 BGP Peer Table ("bgpPeerTable")
227 $l3->bgp_peers()
228 Returns reference to hash of BGP peer to local IP address
229
230 ("bgpPeerLocalAddr")
231
232 $l3->bgp_peer_id()
233 Returns reference to hash of BGP peer to BGP peer identifier
234
235 ("bgpPeerIdentifier")
236
237 $l3->bgp_peer_state()
238 Returns reference to hash of BGP peer to BGP peer state
239
240 ("bgpPeerState")
241
242 $l3->bgp_peer_as()
243 Returns reference to hash of BGP peer to BGP peer autonomous system
244 number
245
246 ("bgpPeerRemoteAs")
247
248 $l3->bgp_peer_addr()
249 Returns reference to hash of BGP peer to BGP peer IP address
250
251 ("bgpPeerRemoteAddr")
252
253 $l3->bgp_peer_fsm_est_trans()
254 Returns reference to hash of BGP peer to the total number of times
255 the BGP FSM transitioned into the established state
256
257 ("bgpPeerFsmEstablishedTransitions")
258
259 $l3->bgp_peer_in_tot_msgs()
260 Returns reference to hash of BGP peer to the total number of
261 messages received from the remote peer on this connection
262
263 ("bgpPeerInTotalMessages")
264
265 $l3->bgp_peer_in_upd_el_time()
266 Returns reference to hash of BGP peer to the elapsed time in
267 seconds since the last BGP UPDATE message was received from the
268 peer.
269
270 ("bgpPeerInUpdateElapsedTime")
271
272 $l3->bgp_peer_in_upd()
273 Returns reference to hash of BGP peer to the number of BGP UPDATE
274 messages received on this connection
275
276 ("bgpPeerInUpdates")
277
278 $l3->bgp_peer_out_tot_msgs()
279 Returns reference to hash of BGP peer to the total number of
280 messages transmitted to the remote peer on this connection
281
282 ("bgpPeerOutTotalMessages")
283
284 $l3->bgp_peer_out_upd()
285 Returns reference to hash of BGP peer to the number of BGP UPDATE
286 messages transmitted on this connection
287
288 ("bgpPeerOutUpdates")
289
290 OSPF Interface Table ("ospfIfTable")
291 $l3->ospf_if_ip()
292 Returns reference to hash of OSPF interface IP addresses
293
294 ("ospfIfIpAddress")
295
296 $l3->ospf_if_area()
297 Returns reference to hash of the OSPF area to which the interfaces
298 connect
299
300 ("ospfIfAreaId")
301
302 $l3->ospf_if_type()
303 Returns reference to hash of the OSPF interfaces' type
304
305 ("ospfIfType")
306
307 $l3->ospf_if_hello()
308 Returns reference to hash of the OSPF interfaces' hello interval
309
310 ("ospfIfHelloInterval")
311
312 $l3->ospf_if_dead()
313 Returns reference to hash of the OSPF interfaces' dead interval
314
315 ("ospfIfRtrDeadInterval")
316
317 $l3->ospf_if_admin()
318 Returns reference to hash of the OSPF interfaces' administrative
319 status
320
321 ("ospfIfAdminStat")
322
323 $l3->ospf_if_state()
324 Returns reference to hash of the OSPF interfaces' state
325
326 ("ospfIfState")
327
328 OSPF Neighbor Table ("ospfNbrTable")
329 $l3->ospf_peers()
330 Returns reference to hash of IP addresses the neighbor is using in
331 its IP Source Addresses
332
333 ("ospfNbrIpAddr")
334
335 $l3->ospf_peer_id()
336 Returns reference to hash of neighbor Router IDs
337
338 ("ospfNbrRtrId")
339
340 $l3->ospf_peer_state()
341 Returns reference to hash of state of the relationship with the
342 neighbor routers
343
344 ("ospfNbrState")
345
346 IS-IS Circuit Table
347 $l3->isis_circ_if_idx()
348 Returns reference to hash of the interface index associated with
349 the IS-IS circuit ("isisCircIfIndex")
350
351 $l3->isis_circ_admin()
352 Returns reference to hash of the IS-IS circuit's admin status
353
354 ("isisCircAdminState")
355
356 $l3->isis_circ_type()
357 Returns reference to hash of the IS-IS circuit's type
358
359 ("isisCircType")
360
361 $l3->isis_circ_level_type()
362 Returns reference to hash of the IS-IS circuit's level
363
364 ("isisCircLevelType")
365
366 IS-IS Adjacency Table
367 $l3->isis_adj_id()
368 Returns reference to hash of the peer id of adjacencies.
369
370 ("isisISAdjNeighSysID")
371
372 $l3->isis_adj_type()
373 Returns reference to hash of the type of adjacencies (Level 1
374 Intermediate System, Level 2 Intermediate System, Level 1+2
375 Intermediate System, unknown)
376
377 ("isisISAdjNeighSysType")
378
379 $l3->isis_adj_usage()
380 Returns reference to hash of the type of adjacencies in use
381 (undefined, Level 1, Level 2, Level1+2)
382
383 ("isisISAdjNeighUsage")
384
385 $l3->isis_adj_ip_type()
386 Returns reference to hash of type of address (IPv4, IPv6, etc) on
387 adjacencies.
388
389 ("isisISAdjIPAddrType")
390
391 $l3->isis_adj()
392 Returns reference to hash of addresses (IPv4, IPv6, etc) on
393 adjacencies. Note this returns hash-strings, for IPs, use
394 $l3->isis_peers()
395
396 ("isisISAdjIPAddrAddress")
397
398 $l3->isis_peers()
399 Returns reference to hash of addresses (IPv4, IPv6) on adjacencies.
400 Convert hash strings from isis_adj to proper IP (v4 and v6)
401 formatting.
402
403 Table Methods imported from SNMP::Info
404 See "USAGE" in SNMP::Info for details.
405
406 Table Methods imported from SNMP::Info::Bridge
407 See "TABLE METHODS" in SNMP::Info::Bridge for details.
408
409 Table Methods imported from SNMP::Info::EtherLike
410 See "TABLE METHODS" in SNMP::Info::EtherLike for details.
411
412 Table Methods imported from SNMP::Info::Entity
413 See "TABLE METHODS" in SNMP::Info::Entity for details.
414
415 Table Methods imported from SNMP::Info::PowerEthernet
416 See "TABLE METHODS" in SNMP::Info::PowerEthernet for details.
417
418 Table Methods imported from SNMP::Info::IPv6
419 See "TABLE METHODS" in SNMP::Info::IPv6 for details.
420
421 Table Methods imported from SNMP::Info::LLDP
422 See "TABLE METHODS" in SNMP::Info::LLDP for details.
423
424 Table Methods imported from SNMP::Info::DocsisHE
425 See "TABLE METHODS" in SNMP::Info::DocsisHE for details.
426
427 Table Methods imported from SNMP::Info::AdslLine
428 See "TABLE METHODS" in SNMP::Info::AdslLine for details.
429
430
431
432perl v5.36.0 2022-07-22 SNMP::Info::Layer3(3)