GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SNMP::Info::Layer2(3) User Contributed Perl Documentation SNMP::Info::Layer2(3)

SNMP::Info::Layer2 - SNMP Interface to network devices serving Layer2 only.

Max Baker

 # Let SNMP::Info determine the correct subclass for you.
 my $l2 = new SNMP::Info(
                          AutoSpecify => 1,
                          Debug       => 1,
                          DestHost    => 'myswitch',
                          Community   => 'public',
                          Version     => 2
                        )
    or die "Can't connect to DestHost.\n";

 my $class      = $l2->class();
 print "SNMP::Info determined this device to fall under subclass : $class\n";

 # Let's get some basic Port information
 my $interfaces = $l2->interfaces();
 my $i_up       = $l2->i_up();
 my $i_speed    = $l2->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::Layer2::* Please read all docs under SNMP::Info first.

Provides abstraction to the configuration information obtainable from a Layer2 device through SNMP. Information is stored in a number of MIBs.

For speed or debugging purposes you can call the subclass directly, but not after determining a more specific class using the method above.

 my $l2 = new SNMP::Info::Layer2(...);

SNMP::Info
SNMP::Info::Bridge
SNMP::Info::DocsisHE
SNMP::Info::Entity
SNMP::Info::LLDP
SNMP::Info::PowerEthernet

Inherited Classes
MIBs required by the inherited classes listed above.

MIBs can be found in netdisco-mibs package.

These are methods that return scalar value from SNMP

$l2->model()
Cross references $l2->id() with product IDs in the Cisco MIBs.

For HP devices, removes 'hpswitch' from the name

For Cisco devices, removes c<'sysid'> from the name

$l2->vendor()
Tries to discover the vendor from $l2->model() and $l2->description()
$l2->serial()
Returns a serial number if found from ENTITY-MIB and OLD-CISCO-... MIB.

See documentation in "USAGE" in SNMP::Info for details.

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

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

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

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

$l2->interfaces()
Creates a map between the interface identifier (iid) and the physical port name.

Defaults to "ifDescr" but checks and overrides with "ifName"

See documentation in "USAGE" in SNMP::Info for details.

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

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

See documentation in "TABLE METHODS" in SNMP::Info::LLDP for details.
2022-04-07 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.