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 SNMP::Info for its MIB requirements.
See "Required MIBs" in SNMP::Info::Bridge for its MIB requirements.
See "Required MIBs" in SNMP::Info::EtherLike for its MIB requirements.
See "Required MIBs" in SNMP::Info::Entity for its MIB requirements.
See "Required MIBs" in SNMP::Info::PowerEthernet for its MIB requirements.
See "Required MIBs" in SNMP::Info::Ipv6 for its MIB requirements.
These are methods that return scalar value from SNMP
Returns root port mac address
(ifPhysAddress.1)
ifPhysAddress.1
(ospfRouterId.0)
ospfRouterId.0
(bgpIdentifier.0)
bgpIdentifier.0
Returns the BGP identifier of the local system
Returns the local autonomous system number
(bgpLocalAs.0)
bgpLocalAs.0
Tries to reference $l3->id() to one of the product MIBs listed above
Removes 'cisco' from cisco devices for readability.
Tries to cull a serial number from ENTITY-MIB, description, and OLD-CISCO-... MIB.
Tries to cull a Vendor name from sysDescr
sysDescr
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).
ospfRouterId
ospfHostIpAddress
See "GLOBALS" in SNMP::Info for details.
See "GLOBALS" in SNMP::Info::Bridge for details.
See "GLOBALS" in SNMP::Info::EtherLike for details.
See "GLOBALS" in SNMP::Info::Entity for details.
These are methods that return tables of information in the form of a reference to a hash.
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()
Returns reference to hash. Creates a key for each IID that should be ignored.
Currently looks for tunnel,loopback,lo,null from $l3->interfaces()
Returns reference to hash of iid to human set name.
Defaults to ifName, but checks for an ifAlias
ifName
ifAlias
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 SNMP::Info::Etherlike for the el_index() and el_duplex() methods.
ipNetToMediaTable
Returns reference to hash. Maps ARP table entries to Interface IIDs
(ipNetToMediaIfIndex)
ipNetToMediaIfIndex
If the device doesn't support ipNetToMediaIfIndex, this will try the deprecated atIfIndex.
atIfIndex
Returns reference to hash. Maps ARP table entries to MAC addresses.
(ipNetToMediaPhysAddress)
ipNetToMediaPhysAddress
If the device doesn't support ipNetToMediaPhysAddress, this will try the deprecated atPhysAddress.
atPhysAddress
Returns reference to hash. Maps ARP table entries to IP addresses.
(ipNetToMediaNetAddress)
ipNetToMediaNetAddress
If the device doesn't support ipNetToMediaNetAddress, this will try the deprecated atNetAddress.
atNetAddress
The atTable has been deprecated since 1991. You should never need to use these methods. See ipNetToMediaTable above.
atTable
Returns reference to map of IID to Arp Cache Entry
(atIfIndex)
Returns reference to hash of Arp Cache Entries to MAC address
(atPhysAddress)
Returns reference to hash of Arp Cache Entries to IP Address
(atNetAddress)
bgpPeerTable
Returns reference to hash of BGP peer to local IP address
(bgpPeerLocalAddr)
bgpPeerLocalAddr
Returns reference to hash of BGP peer to BGP peer identifier
(bgpPeerIdentifier)
bgpPeerIdentifier
Returns reference to hash of BGP peer to BGP peer state
(bgpPeerState)
bgpPeerState
Returns reference to hash of BGP peer to BGP peer autonomous system number
(bgpPeerRemoteAs)
bgpPeerRemoteAs
Returns reference to hash of BGP peer to BGP peer IP address
(bgpPeerRemoteAddr)
bgpPeerRemoteAddr
Returns reference to hash of BGP peer to the total number of times the BGP FSM transitioned into the established state
(bgpPeerFsmEstablishedTransitions)
bgpPeerFsmEstablishedTransitions
Returns reference to hash of BGP peer to the total number of messages received from the remote peer on this connection
(bgpPeerInTotalMessages)
bgpPeerInTotalMessages
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)
bgpPeerInUpdateElapsedTime
Returns reference to hash of BGP peer to the number of BGP UPDATE messages received on this connection
(bgpPeerInUpdates)
bgpPeerInUpdates
Returns reference to hash of BGP peer to the total number of messages transmitted to the remote peer on this connection
(bgpPeerOutTotalMessages)
bgpPeerOutTotalMessages
Returns reference to hash of BGP peer to the number of BGP UPDATE messages transmitted on this connection
(bgpPeerOutUpdates)
bgpPeerOutUpdates
ospfIfTable
Returns reference to hash of OSPF interface IP addresses
(ospfIfIpAddress)
ospfIfIpAddress
Returns reference to hash of the OSPF area to which the interfaces connect
(ospfIfAreaId)
ospfIfAreaId
Returns reference to hash of the OSPF interfaces' type
(ospfIfType)
ospfIfType
Returns reference to hash of the OSPF interfaces' hello interval
(ospfIfHelloInterval)
ospfIfHelloInterval
Returns reference to hash of the OSPF interfaces' dead interval
(ospfIfRtrDeadInterval)
ospfIfRtrDeadInterval
Returns reference to hash of the OSPF interfaces' administrative status
(ospfIfAdminStat)
ospfIfAdminStat
Returns reference to hash of the OSPF interfaces' state
(ospfIfState)
ospfIfState
ospfNbrTable
Returns reference to hash of IP addresses the neighbor is using in its IP Source Addresses
(ospfNbrIpAddr)
ospfNbrIpAddr
Returns reference to hash of neighbor Router IDs
(ospfNbrRtrId)
ospfNbrRtrId
Returns reference to hash of state of the relationship with the neighbor routers
(ospfNbrState)
ospfNbrState
See "TABLE METHODS" in SNMP::Info for details.
See "TABLE METHODS" in SNMP::Info::Bridge for details.
See "TABLE METHODS" in SNMP::Info::EtherLike for details.
See "TABLE METHODS" in SNMP::Info::Entity for details.
See "TABLE METHODS" in SNMP::Info::PowerEthernet for details.
See "TABLE METHODS" in SNMP::Info::Ipv6 for details.
To install SNMP::Info, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SNMP::Info
CPAN shell
perl -MCPAN -e shell install SNMP::Info
For more information on module installation, please visit the detailed CPAN module installation guide.