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
59 Required MIBs
60 IP-MIB
61 OSPF-MIB
62 BGP4-MIB
63
64 Inherited MIBs
65 See "Required MIBs" in SNMP::Info for its MIB requirements.
66
67 See "Required MIBs" in SNMP::Info::Bridge for its MIB requirements.
68
69 See "Required MIBs" in SNMP::Info::EtherLike for its MIB requirements.
70
71 See "Required MIBs" in SNMP::Info::Entity for its MIB requirements.
72
73 See "Required MIBs" in SNMP::Info::PowerEthernet for its MIB
74 requirements.
75
76 See "Required MIBs" in SNMP::Info::IPv6 for its MIB requirements.
77
78 See "Required MIBs" in SNMP::Info::LLDP for its MIB requirements.
79
81 These are methods that return scalar value from SNMP
82
83 $l3->mac()
84 Returns root port mac address
85
86 ("ifPhysAddress.1")
87
88 $l3->router_ip()
89 ("ospfRouterId.0")
90
91 $l3->bgp_id()
92 ("bgpIdentifier.0")
93
94 Returns the BGP identifier of the local system
95
96 $l3->bgp_local_as()
97 Returns the local autonomous system number
98
99 ("bgpLocalAs.0")
100
101 Overrides
102 $l3->model()
103 Tries to reference $l3->id() to one of the product MIBs listed
104 above
105
106 Removes 'cisco' from cisco devices for readability.
107
108 $l3->serial()
109 Returns a serial number if found from ENTITY-MIB and OLD-CISCO-...
110 MIB.
111
112 $l3->vendor()
113 Tries to cull a Vendor name from "sysDescr"
114
115 $l3->root_ip()
116 Returns the primary IP used to communicate with the device.
117 Returns the first found: OSPF Router ID ("ospfRouterId") or any
118 OSPF Host IP Address ("ospfHostIpAddress").
119
120 Globals imported from SNMP::Info
121 See "GLOBALS" in SNMP::Info for details.
122
123 Global Methods imported from SNMP::Info::Bridge
124 See "GLOBALS" in SNMP::Info::Bridge for details.
125
126 Global Methods imported from SNMP::Info::EtherLike
127 See "GLOBALS" in SNMP::Info::EtherLike for details.
128
129 Global Methods imported from SNMP::Info::Entity
130 See "GLOBALS" in SNMP::Info::Entity for details.
131
132 Global Methods imported from SNMP::Info:PowerEthernet
133 See "GLOBALS" in SNMP::Info::PowerEthernet for details.
134
135 Global Methods imported from SNMP::Info::IPv6
136 See "GLOBALS" in SNMP::Info::IPv6 for details.
137
138 Global Methods imported from SNMP::Info::LLDP
139 See "GLOBALS" in SNMP::Info::LLDP for details.
140
142 These are methods that return tables of information in the form of a
143 reference to a hash.
144
145 Overrides
146 $l3->interfaces()
147 Returns the map between SNMP Interface Identifier (iid) and
148 physical port name.
149
150 Only returns those iids that have a description listed in
151 $l3->i_description()
152
153 $l3->i_name()
154 Returns reference to hash of iid to human set name.
155
156 Defaults to "ifName", but checks for an "ifAlias"
157
158 $l3->i_duplex()
159 Returns reference to hash of iid to current link duplex setting.
160
161 Maps $l3->el_index() to $l3->el_duplex, then culls out full,half,
162 or auto and sets the map to that value.
163
164 See SNMP::Info::Etherlike for the el_index() and el_duplex()
165 methods.
166
167 IP-MIB Arp Cache Table ("ipNetToMediaTable")
168 $l3->at_index()
169 Returns reference to hash. Maps ARP table entries to Interface
170 IIDs
171
172 ("ipNetToMediaIfIndex")
173
174 If the device doesn't support "ipNetToMediaIfIndex", this will try
175 the deprecated "atIfIndex".
176
177 $l3->at_paddr()
178 Returns reference to hash. Maps ARP table entries to MAC
179 addresses.
180
181 ("ipNetToMediaPhysAddress")
182
183 If the device doesn't support "ipNetToMediaPhysAddress", this will
184 try the deprecated "atPhysAddress".
185
186 $l3->at_netaddr()
187 Returns reference to hash. Maps ARP table entries to IP addresses.
188
189 ("ipNetToMediaNetAddress")
190
191 If the device doesn't support "ipNetToMediaNetAddress", this will
192 try the deprecated "atNetAddress".
193
194 ARP Cache Entries
195 The "atTable" has been deprecated since 1991. You should never need to
196 use these methods. See "ipNetToMediaTable" above.
197
198 $l3->old_at_index()
199 Returns reference to map of IID to Arp Cache Entry
200
201 ("atIfIndex")
202
203 $l3->old_at_paddr()
204 Returns reference to hash of Arp Cache Entries to MAC address
205
206 ("atPhysAddress")
207
208 $l3->old_at_netaddr()
209 Returns reference to hash of Arp Cache Entries to IP Address
210
211 ("atNetAddress")
212
213 BGP Peer Table ("bgpPeerTable")
214 $l3->bgp_peers()
215 Returns reference to hash of BGP peer to local IP address
216
217 ("bgpPeerLocalAddr")
218
219 $l3->bgp_peer_id()
220 Returns reference to hash of BGP peer to BGP peer identifier
221
222 ("bgpPeerIdentifier")
223
224 $l3->bgp_peer_state()
225 Returns reference to hash of BGP peer to BGP peer state
226
227 ("bgpPeerState")
228
229 $l3->bgp_peer_as()
230 Returns reference to hash of BGP peer to BGP peer autonomous system
231 number
232
233 ("bgpPeerRemoteAs")
234
235 $l3->bgp_peer_addr()
236 Returns reference to hash of BGP peer to BGP peer IP address
237
238 ("bgpPeerRemoteAddr")
239
240 $l3->bgp_peer_fsm_est_trans()
241 Returns reference to hash of BGP peer to the total number of times
242 the BGP FSM transitioned into the established state
243
244 ("bgpPeerFsmEstablishedTransitions")
245
246 $l3->bgp_peer_in_tot_msgs()
247 Returns reference to hash of BGP peer to the total number of
248 messages received from the remote peer on this connection
249
250 ("bgpPeerInTotalMessages")
251
252 $l3->bgp_peer_in_upd_el_time()
253 Returns reference to hash of BGP peer to the elapsed time in
254 seconds since the last BGP UPDATE message was received from the
255 peer.
256
257 ("bgpPeerInUpdateElapsedTime")
258
259 $l3->bgp_peer_in_upd()
260 Returns reference to hash of BGP peer to the number of BGP UPDATE
261 messages received on this connection
262
263 ("bgpPeerInUpdates")
264
265 $l3->bgp_peer_out_tot_msgs()
266 Returns reference to hash of BGP peer to the total number of
267 messages transmitted to the remote peer on this connection
268
269 ("bgpPeerOutTotalMessages")
270
271 $l3->bgp_peer_out_upd()
272 Returns reference to hash of BGP peer to the number of BGP UPDATE
273 messages transmitted on this connection
274
275 ("bgpPeerOutUpdates")
276
277 OSPF Interface Table ("ospfIfTable")
278 $l3->ospf_if_ip()
279 Returns reference to hash of OSPF interface IP addresses
280
281 ("ospfIfIpAddress")
282
283 $l3->ospf_if_area()
284 Returns reference to hash of the OSPF area to which the interfaces
285 connect
286
287 ("ospfIfAreaId")
288
289 $l3->ospf_if_type()
290 Returns reference to hash of the OSPF interfaces' type
291
292 ("ospfIfType")
293
294 $l3->ospf_if_hello()
295 Returns reference to hash of the OSPF interfaces' hello interval
296
297 ("ospfIfHelloInterval")
298
299 $l3->ospf_if_dead()
300 Returns reference to hash of the OSPF interfaces' dead interval
301
302 ("ospfIfRtrDeadInterval")
303
304 $l3->ospf_if_admin()
305 Returns reference to hash of the OSPF interfaces' administrative
306 status
307
308 ("ospfIfAdminStat")
309
310 $l3->ospf_if_state()
311 Returns reference to hash of the OSPF interfaces' state
312
313 ("ospfIfState")
314
315 OSPF Neighbor Table ("ospfNbrTable")
316 $l3->ospf_peers()
317 Returns reference to hash of IP addresses the neighbor is using in
318 its IP Source Addresses
319
320 ("ospfNbrIpAddr")
321
322 $l3->ospf_peer_id()
323 Returns reference to hash of neighbor Router IDs
324
325 ("ospfNbrRtrId")
326
327 $l3->ospf_peer_state()
328 Returns reference to hash of state of the relationship with the
329 neighbor routers
330
331 ("ospfNbrState")
332
333 Table Methods imported from SNMP::Info
334 See "TABLE METHODS" in SNMP::Info for details.
335
336 Table Methods imported from SNMP::Info::Bridge
337 See "TABLE METHODS" in SNMP::Info::Bridge for details.
338
339 Table Methods imported from SNMP::Info::EtherLike
340 See "TABLE METHODS" in SNMP::Info::EtherLike for details.
341
342 Table Methods imported from SNMP::Info::Entity
343 See "TABLE METHODS" in SNMP::Info::Entity for details.
344
345 Table Methods imported from SNMP::Info::PowerEthernet
346 See "TABLE METHODS" in SNMP::Info::PowerEthernet for details.
347
348 Table Methods imported from SNMP::Info::IPv6
349 See "TABLE METHODS" in SNMP::Info::IPv6 for details.
350
351 Table Methods imported from SNMP::Info::LLDP
352 See "TABLE METHODS" in SNMP::Info::LLDP for details.
353
354
355
356perl v5.28.0 2018-11-29 SNMP::Info::Layer3(3)