SNMP::Info::Layer2::C1900 - Perl5 Interface to SNMP data from Cisco Catlyst 1900 Network Switches running CatOS
Max Baker (max@warped.org)
max@warped.org
# Let SNMP::Info determine the correct subclass for you. my $c1900 = new SNMP::Info( AutoSpecify => 1, Debug => 1, # These arguments are passed directly on to SNMP::Session DestHost => 'myswitch', Community => 'public', Version => 1 ) or die "Can't connect to DestHost.\n"; my $class = $c1900->class(); print "SNMP::Info determined this device to fall under subclass : $class\n";
Provides abstraction to the configuration information obtainable from a Catalyst 1900 device through SNMP. See SNMP::Info for full documentation
Note that most of these devices only talk SNMP version 1, but not all.
For speed or debugging purposes you can call the subclass directly, but not after determining a more specific class using the method above.
my $c1900 = new SNMP::Info::Layer2::C1900(...);
ESSWITCH-MIB is included in the Version 1 MIBS from Cisco.
They can be found at ftp://ftp.cisco.com/pub/mibs/v1/v1.tar.gz
MIBs listed in SNMP::Info::Layer2
These are methods that return scalar value from SNMP
Usually contains the version of the software loaded in flash. Used by os_ver()
STAND-ALONE-ETHERNET-SWITCH-MIB::upgradeFlashBankStatus
Returns 'catalyst'
Returns CatOS version if obtainable. First tries to use SNMP::Info::CiscoStats->os_ver() . If that fails then it checks for the presence of $c1900->c1900_flash_status() and culls the version from there.
Returns 'cisco' :)
See documentation in SNMP::Info::Layer2 for details.
Returns reference to map of IIDs to current link duplex
Crosses $c1900->c1900_p_index() with $c1900->c1900_p_duplex;
Returns reference to hash of IIDs to admin duplex setting
Crosses $c1900->c1900_p_index() with $c1900->c1900_p_duplex_admin;
Crosses ifName with c1900_p_name() and returns the human set port name if exists.
Returns reference to hash of IID to port type
Takes the default ifType and overrides it with
c1900_p_type() and c1900_p_media() if they exist.
Maps the Switch Port Table to the IID
swPortIfIndex
Gives Port Duplex Info
swPortDuplexStatus
Gives admin setting for Duplex Info
swPortFullDuplex
Gives human set name for port
swPortName
Gives Admin status of port enabled.
swPortAdminStatus
Gives Type of port, ie. "general-ethernet"
swPortMediaCapability
Gives the media of the port , ie "fiber-sc"
swPortConnectorType
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.