ipNetToMediaTable
)bgpPeerTable
)ospfIfTable
)ospfNbrTable
)
SNMP::Info::Layer3 - SNMP Interface to network devices serving Layer3 or Layers 2 & 3
Max Baker
# Let SNMP::Info determine the correct subclass for you. my $l3 = new SNMP::Info( AutoSpecify => 1, Debug => 1, DestHost => 'myswitch', Community => 'public', Version => 2 ) or die "Can't connect to DestHost.\n";
my $class = $l3->class(); print "SNMP::Info determined this device to fall under subclass : $class\n";
# Let's get some basic Port information my $interfaces = $l3->interfaces(); my $i_up = $l3->i_up(); my $i_speed = $l3->i_speed(); foreach my $iid (keys %$interfaces) { my $port = $interfaces->{$iid}; my $up = $i_up->{$iid}; my $speed = $i_speed->{$iid} print "Port $port is $up. Port runs at $speed.\n"; }
This class is usually used as a superclass for more specific device classes listed under SNMP::Info::Layer3::* Please read all docs under SNMP::Info first.
Provides generic methods for accessing SNMP data for Layer 3 network devices. Includes support for Layer2+3 devices.
For speed or debugging purposes you can call the subclass directly, but not after determining a more specific class using the method above.
my $l3 = new SNMP::Info::Layer3(...);
See Required MIBs in the SNMP::Info manpage for its MIB requirements.
See Required MIBs in the SNMP::Info::Bridge manpage for its MIB requirements.
See Required MIBs in the SNMP::Info::EtherLike manpage for its MIB requirements.
See Required MIBs in the SNMP::Info::Entity manpage for its MIB requirements.
These are methods that return scalar value from SNMP
mac()
Returns root port mac address
(ifPhysAddress.1
)
router_ip()
(ospfRouterId.0
)
bgp_id()
(bgpIdentifier.0
)
Returns the BGP identifier of the local system
bgp_local_as()
Returns the local autonomous system number
(bgpLocalAs.0
)
model()
Tries to reference $l3->id()
to one of the product MIBs listed above
Removes 'cisco' from cisco devices for readability.
serial()
Tries to cull a serial number from ENTITY-MIB, description, and OLD-CISCO-... MIB.
vendor()
Tries to cull a Vendor name from sysDescr
root_ip()
Returns the primary IP used to communicate with the device. Returns the first
found: OSPF Router ID (ospfRouterId
) or any OSPF Host IP Address
(ospfHostIpAddress
).
See GLOBALS in the SNMP::Info manpage for details.
See GLOBALS in the SNMP::Info::Bridge manpage for details.
See GLOBALS in the SNMP::Info::EtherLike manpage for details.
See GLOBALS in the SNMP::Info::Entity manpage for details.
These are methods that return tables of information in the form of a reference to a hash.
interfaces()
Returns the map between SNMP Interface Identifier (iid) and physical port name.
Only returns those iids that have a description listed in $l3->i_description()
i_ignore()
Returns reference to hash. Creates a key for each IID that should be ignored.
Currently looks for tunnel,loopback,lo,null from $l3->interfaces()
i_name()
Returns reference to hash of iid to human set name.
Defaults to ifName
, but checks for an ifAlias
i_duplex()
Returns reference to hash of iid to current link duplex setting.
Maps $l3->el_index()
to $l3->el_duplex, then culls out
full,half, or auto and sets the map to that value.
See the SNMP::Info::Etherlike manpage for the el_index()
and el_duplex()
methods.
ipNetToMediaTable
)at_index()
Returns reference to hash. Maps ARP table entries to Interface IIDs
(ipNetToMediaIfIndex
)
If the device doesn't support ipNetToMediaIfIndex
, this will try
the deprecated atIfIndex
.
at_paddr()
Returns reference to hash. Maps ARP table entries to MAC addresses.
(ipNetToMediaPhysAddress
)
If the device doesn't support ipNetToMediaPhysAddress
, this will try
the deprecated atPhysAddress
.
at_netaddr()
Returns reference to hash. Maps ARP table entries to IP addresses.
(ipNetToMediaNetAddress
)
If the device doesn't support ipNetToMediaNetAddress
, this will try
the deprecated atNetAddress
.
The atTable
has been deprecated since 1991. You should never need
to use these methods. See ipNetToMediaTable
above.
old_at_index()
Returns reference to map of IID to Arp Cache Entry
(atIfIndex
)
old_at_paddr()
Returns reference to hash of Arp Cache Entries to MAC address
(atPhysAddress
)
old_at_netaddr()
Returns reference to hash of Arp Cache Entries to IP Address
(atNetAddress
)
bgpPeerTable
)bgp_peers()
Returns reference to hash of BGP peer to local IP address
(bgpPeerLocalAddr
)
bgp_peer_id()
Returns reference to hash of BGP peer to BGP peer identifier
(bgpPeerIdentifier
)
bgp_peer_state()
Returns reference to hash of BGP peer to BGP peer state
(bgpPeerState
)
bgp_peer_as()
Returns reference to hash of BGP peer to BGP peer autonomous system number
(bgpPeerRemoteAs
)
bgp_peer_addr()
Returns reference to hash of BGP peer to BGP peer IP address
(bgpPeerRemoteAddr
)
bgp_peer_fsm_est_trans()
Returns reference to hash of BGP peer to the total number of times the BGP FSM transitioned into the established state
(bgpPeerFsmEstablishedTransitions
)
bgp_peer_in_tot_msgs()
Returns reference to hash of BGP peer to the total number of messages received from the remote peer on this connection
(bgpPeerInTotalMessages
)
bgp_peer_in_upd_el_time()
Returns reference to hash of BGP peer to the elapsed time in seconds since the last BGP UPDATE message was received from the peer.
(bgpPeerInUpdateElapsedTime
)
bgp_peer_in_upd()
Returns reference to hash of BGP peer to the number of BGP UPDATE messages received on this connection
(bgpPeerInUpdates
)
bgp_peer_out_tot_msgs()
Returns reference to hash of BGP peer to the total number of messages transmitted to the remote peer on this connection
(bgpPeerOutTotalMessages
)
bgp_peer_out_upd()
Returns reference to hash of BGP peer to the number of BGP UPDATE messages transmitted on this connection
(bgpPeerOutUpdates
)
ospfIfTable
)ospf_if_ip()
Returns reference to hash of OSPF interface IP addresses
(ospfIfIpAddress
)
ospf_if_area()
Returns reference to hash of the OSPF area to which the interfaces connect
(ospfIfAreaId
)
ospf_if_type()
Returns reference to hash of the OSPF interfaces' type
(ospfIfType
)
ospf_if_hello()
Returns reference to hash of the OSPF interfaces' hello interval
(ospfIfHelloInterval
)
ospf_if_dead()
Returns reference to hash of the OSPF interfaces' dead interval
(ospfIfRtrDeadInterval
)
ospf_if_admin()
Returns reference to hash of the OSPF interfaces' administrative status
(ospfIfAdminStat
)
ospf_if_state()
Returns reference to hash of the OSPF interfaces' state
(ospfIfState
)
ospfNbrTable
)ospf_peers()
Returns reference to hash of IP addresses the neighbor is using in its IP Source Addresses
(ospfNbrIpAddr
)
ospf_peer_id()
Returns reference to hash of neighbor Router IDs
(ospfNbrRtrId
)
ospf_peer_state()
Returns reference to hash of state of the relationship with the neighbor routers
(ospfNbrState
)
See TABLE METHODS in the SNMP::Info manpage for details.
See TABLE METHODS in the SNMP::Info::Bridge manpage for details.
See TABLE METHODS in the SNMP::Info::EtherLike manpage for details.
See TABLE METHODS in the SNMP::Info::Entity manpage for details.