SNMP::Info::Layer3(3pm) | User Contributed Perl Documentation | SNMP::Info::Layer3(3pm) |
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 "REQUIREMENTS" 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.
See "Required MIBs" in SNMP::Info::LLDP for its MIB requirements.
See "Required MIBs" in SNMP::Info::DocsisHE for its MIB requirements.
See "Required MIBs" in SNMP::Info::AdslLine for its MIB requirements.
These are methods that return scalar value from SNMP
("ifPhysAddress.1")
Returns the BGP identifier of the local system
("bgpLocalAs.0")
Removes 'cisco' from cisco devices for readability.
See "USAGE" 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.
See "GLOBALS" in SNMP::Info::PowerEthernet for details.
See "GLOBALS" in SNMP::Info::IPv6 for details.
See "GLOBALS" in SNMP::Info::LLDP for details.
See "GLOBALS" in SNMP::Info::DocsisHE for details.
See "GLOBALS" in SNMP::Info::AdslLine for details.
These are methods that return tables of information in the form of a reference to a hash.
Only returns those iids that have a description listed in $l3->i_description()
Example: my $interfaces = $l3->interfaces(); my $i_subs = $l3->i_subinterfaces(); foreach my $iid (sort keys %$interfaces) { my $port = $interfaces->{$iid}; my $subs = join(',', sort(map {$interfaces->{$_}} @{$i_subs->{$iid}})); print "Port: $port has subinterfaces: $subs\n"; }
Defaults to "ifName", but checks for an "ifAlias"
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.
("ipNetToMediaIfIndex")
If the device doesn't support "ipNetToMediaIfIndex", this will try the deprecated "atIfIndex".
("ipNetToMediaPhysAddress")
If the device doesn't support "ipNetToMediaPhysAddress", this will try the deprecated "atPhysAddress".
("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.
("atIfIndex")
("atPhysAddress")
("atNetAddress")
("bgpPeerLocalAddr")
("bgpPeerIdentifier")
("bgpPeerState")
("bgpPeerRemoteAs")
("bgpPeerRemoteAddr")
("bgpPeerFsmEstablishedTransitions")
("bgpPeerInTotalMessages")
("bgpPeerInUpdateElapsedTime")
("bgpPeerInUpdates")
("bgpPeerOutTotalMessages")
("bgpPeerOutUpdates")
("ospfIfIpAddress")
("ospfIfAreaId")
("ospfIfType")
("ospfIfHelloInterval")
("ospfIfRtrDeadInterval")
("ospfIfAdminStat")
("ospfIfState")
("ospfNbrIpAddr")
("ospfNbrRtrId")
("ospfNbrState")
("isisCircAdminState")
("isisCircType")
("isisCircLevelType")
("isisISAdjNeighSysID")
("isisISAdjNeighSysType")
("isisISAdjNeighUsage")
("isisISAdjIPAddrType")
("isisISAdjIPAddrAddress")
See "USAGE" 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.
See "TABLE METHODS" in SNMP::Info::LLDP for details.
See "TABLE METHODS" in SNMP::Info::DocsisHE for details.
See "TABLE METHODS" in SNMP::Info::AdslLine for details.
2023-09-30 | perl v5.36.0 |