SNMP::Info::Layer2::C2900 - SNMP Interface to Cisco Catalyst 2900 Switches running IOS
Max Baker (max@warped.org)
# Let SNMP::Info determine the correct subclass for you.
my $c2900 = new SNMP::Info(
AutoSpecify => 1,
Debug => 1,
# These arguments are passed directly on to SNMP::Session
DestHost => 'myswitch',
Community => 'public',
Version => 2
)
or die "Can't connect to DestHost.\n";
my $class = $c2900->class(); print "SNMP::Info determined this device to fall under subclass : $class\n";
Provides abstraction to the configuration information obtainable from a C2900 device through SNMP.
For speed or debugging purposes you can call the subclass directly, but not after determining a more specific class using the method above.
my $c2900 = new SNMP::Info::Layer2::C2900(...);
See SNMP::Info::CiscoVTP for its own MIB requirements.
These are methods that return scalar value from SNMP
vendor()
Returns 'cisco' :)
See documentation in SNMP::Info::Layer2 for details.
See documentation in SNMP::Info::CiscoVTP for details.
These are methods that return tables of information in the form of a reference to a hash.
interfaces()
Returns reference to the map between IID and physical Port.
On the 2900 devices i_name isn't reliable, so we override to just the description.
Next all dots are changed for forward slashes so that the physical port name
is the same as the broadcasted CDP port name.
(Ethernet0.1 -> Ethernet0/1)
Also, any weird characters are removed, as I saw a few pop up.
i_duplex()
Returns reference to map of IIDs to current link duplex
Crosses $c2900->c2900_p_index() with $c2900->c2900_p_duplex;
i_duplex_admin()
Returns reference to hash of IIDs to admin duplex setting
Crosses $c2900->c2900_p_index() with $c2900->c2900_p_duplex_admin;
c2900_p_index()
Maps the Switch Port Table to the IID
B<c2900PortIfIndex>
c2900_p_duplex()
Gives Port Duplex Info
B<c2900PortDuplexStatus>
c2900_p_duplex_admin()
Gives admin setting for Duplex Info
B<c2900PortDuplexState>
c2900_p_speed_admin()
Gives Admin speed of port
B<c2900PortAdminSpeed>
See documentation in SNMP::Info::Layer2 for details.
See documentation in SNMP::Info::CiscoVTP for details.