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