NAME

SNMP::Info::Layer3 - SNMP Interface to network devices serving Layer3 or Layers 2 & 3

AUTHOR

Max Baker

SYNOPSIS

# 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";
}

DESCRIPTION

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(...);

Inherited Classes

SNMP::Info
SNMP::Info::Bridge (For L2/L3 devices)
SNMP::Info::EtherLike
SNMP::Info::Entity
SNMP::Info::PowerEthernet
SNMP::Info::IPv6

Required MIBs

IP-MIB
OSPF-MIB
BGP4-MIB

Inherited MIBs

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.

GLOBALS

These are methods that return scalar value from SNMP

$l3->mac()

Returns root port mac address

(ifPhysAddress.1)

$l3->router_ip()

(ospfRouterId.0)

$l3->bgp_id()

(bgpIdentifier.0)

Returns the BGP identifier of the local system

$l3->bgp_local_as()

Returns the local autonomous system number

(bgpLocalAs.0)

Overrides

$l3->model()

Tries to reference $l3->id() to one of the product MIBs listed above

Removes 'cisco' from cisco devices for readability.

$l3->serial()

Tries to cull a serial number from ENTITY-MIB, description, and OLD-CISCO-... MIB.

$l3->vendor()

Tries to cull a Vendor name from sysDescr

$l3->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).

Globals imported from SNMP::Info

See "GLOBALS" in SNMP::Info for details.

Global Methods imported from SNMP::Info::Bridge

See "GLOBALS" in SNMP::Info::Bridge for details.

Global Methods imported from SNMP::Info::EtherLike

See "GLOBALS" in SNMP::Info::EtherLike for details.

Global Methods imported from SNMP::Info::Entity

See "GLOBALS" in SNMP::Info::Entity for details.

TABLE METHODS

These are methods that return tables of information in the form of a reference to a hash.

Overrides

$l3->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()

$l3->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()

$l3->i_name()

Returns reference to hash of iid to human set name.

Defaults to ifName, but checks for an ifAlias

$l3->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 SNMP::Info::Etherlike for the el_index() and el_duplex() methods.

IP-MIB Arp Cache Table (ipNetToMediaTable)

$l3->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.

$l3->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.

$l3->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.

ARP Cache Entries

The atTable has been deprecated since 1991. You should never need to use these methods. See ipNetToMediaTable above.

$l3->old_at_index()

Returns reference to map of IID to Arp Cache Entry

(atIfIndex)

$l3->old_at_paddr()

Returns reference to hash of Arp Cache Entries to MAC address

(atPhysAddress)

$l3->old_at_netaddr()

Returns reference to hash of Arp Cache Entries to IP Address

(atNetAddress)

BGP Peer Table (bgpPeerTable)

$l3->bgp_peers()

Returns reference to hash of BGP peer to local IP address

(bgpPeerLocalAddr)

$l3->bgp_peer_id()

Returns reference to hash of BGP peer to BGP peer identifier

(bgpPeerIdentifier)

$l3->bgp_peer_state()

Returns reference to hash of BGP peer to BGP peer state

(bgpPeerState)

$l3->bgp_peer_as()

Returns reference to hash of BGP peer to BGP peer autonomous system number

(bgpPeerRemoteAs)

$l3->bgp_peer_addr()

Returns reference to hash of BGP peer to BGP peer IP address

(bgpPeerRemoteAddr)

$l3->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)

$l3->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)

$l3->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)

$l3->bgp_peer_in_upd()

Returns reference to hash of BGP peer to the number of BGP UPDATE messages received on this connection

(bgpPeerInUpdates)

$l3->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)

$l3->bgp_peer_out_upd()

Returns reference to hash of BGP peer to the number of BGP UPDATE messages transmitted on this connection

(bgpPeerOutUpdates)

OSPF Interface Table (ospfIfTable)

$l3->ospf_if_ip()

Returns reference to hash of OSPF interface IP addresses

(ospfIfIpAddress)

$l3->ospf_if_area()

Returns reference to hash of the OSPF area to which the interfaces connect

(ospfIfAreaId)

$l3->ospf_if_type()

Returns reference to hash of the OSPF interfaces' type

(ospfIfType)

$l3->ospf_if_hello()

Returns reference to hash of the OSPF interfaces' hello interval

(ospfIfHelloInterval)

$l3->ospf_if_dead()

Returns reference to hash of the OSPF interfaces' dead interval

(ospfIfRtrDeadInterval)

$l3->ospf_if_admin()

Returns reference to hash of the OSPF interfaces' administrative status

(ospfIfAdminStat)

$l3->ospf_if_state()

Returns reference to hash of the OSPF interfaces' state

(ospfIfState)

OSPF Neighbor Table (ospfNbrTable)

$l3->ospf_peers()

Returns reference to hash of IP addresses the neighbor is using in its IP Source Addresses

(ospfNbrIpAddr)

$l3->ospf_peer_id()

Returns reference to hash of neighbor Router IDs

(ospfNbrRtrId)

$l3->ospf_peer_state()

Returns reference to hash of state of the relationship with the neighbor routers

(ospfNbrState)

Table Methods imported from SNMP::Info

See "TABLE METHODS" in SNMP::Info for details.

Table Methods imported from SNMP::Info::Bridge

See "TABLE METHODS" in SNMP::Info::Bridge for details.

Table Methods imported from SNMP::Info::EtherLike

See "TABLE METHODS" in SNMP::Info::EtherLike for details.

Table Methods imported from SNMP::Info::Entity

See "TABLE METHODS" in SNMP::Info::Entity for details.

Table Methods imported from SNMP::Info::PowerEthernet

See "TABLE METHODS" in SNMP::Info::PowerEthernet for details.

Table Methods imported from SNMP::Info::IPv6

See "TABLE METHODS" in SNMP::Info::IPv6 for details.