SNMP::Info::Layer2 - Perl5 Interface to Layer2 network devices.
Provides abstraction to the configuration information obtainable from a Layer2 device through SNMP. Information is stored in a number of MIBs.
See super classes for descriptions of other available methods.
Inherits from:
SNMP::Info SNMP::Info::Bridge SNMP::Info::CDP
MIBS:
CISCO-PRODUCTS-MIB - Needed for ID of Cisco Products CISCO-STACK-MIB - Needed for ID of Cisco Products HP-ICF-OID - Needed for ID of HP Products MIBS listed in SNMP::Info::Bridge and SNMP::Info::CDP
Cisco MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
HP MIBs can be found at http://www.hp.com/rnd/software
Max Baker (max@warped.org)
max@warped.org
my $l2 = new SNMP::Info::Layer2(DestHost => 'mybridge' , Community => 'public' );
Arguments passed to new() are passed on to SNMP::Session::new()
my $l2 = new SNMP::Info::Layer2( DestHost => $host, Community => 'public', Version => 3,... ) die "Couldn't connect.\n" unless defined $l2;
Sets or returns the SNMP::Session object
# Get my $sess = $l2->session(); # Set my $newsession = new SNMP::Session(...); $l2->session($newsession);
Cross references $l2->id() with product IDs in the Cisco and HP specific MIBs.
For HP devices, removes 'hpswitch' from the name
For Cisco devices, removes 'sysid' from the name
Trys to discover the vendor from $l2->model() and $l2->vendor()
Creates a map between the interface identifier (iid) and the physical port name.
Defaults to ifDescr but checks and overrides with ifName
Returns reference to hash. Increments value of IID if port is to be ignored.
Ignores ports with ifType of loopback,propvirtual,other, and cpu
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.