SNMP::...::C2900(3pm)
π SNMP::Info::Layer2::C2900 β aka the Cisco Catalyst 2900 glow-up π
okay bestie, so this is the SNMP::Info::Layer2::C2900 page from the User Contributed Perl Documentation, and it's literally the SNMP interface to Cisco Catalyst 2900 Switches running IOS. no cap. let's get into it π¦
β¨ NAME β¨
SNMP::Info::Layer2::C2900 β the SNMP Interface to Cisco Catalyst 2900 Switches running IOS. she's niche, she's specific, she's iconic π
π«Ά AUTHOR π«Ά
Max Baker β ty for your service king π
πΈ SYNOPSIS πΈ
okay so first things first, you let SNMP::Info figure out which subclass you actually belong to. she does the detective work so you don't have to:
# Let SNMP::Info determine the correct subclass for you.
my $c2900 = new SNMP::Info(
AutoSpecify => 1,
Debug => 1,
# These arguments are passed directly 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";
and then you just... ask her what she is. main character behavior fr fr β¨
π DESCRIPTION π
she provides an abstraction to the configuration information you can get off a C2900 device through SNMP. that's the whole vibe. π
π Inherited Classes
SNMP::Info::Layer2::Cisco
π Required MIBs
- CISCO-C2900-MIB β part of the v2 MIBs from Cisco, periodt.
π¦ Inherited MIBs
see "Required MIBs" in SNMP::Info::Layer2::Cisco for its MIB requirements. she's got needs and they're documented π
π GLOBALS π
these are methods that return scalar values from SNMP. little one-value girlypops π
β Overrides
$c2900->vendor()β returns'cisco'. that's it. that's the method.$c2900->cisco_comm_indexing()β returns1. use vlan indexing, bestie.
π Globals imported from SNMP::Info::Layer2::Cisco
see "GLOBALS" in SNMP::Info::Layer2::Cisco for details. she's borrowing, and it's fine.
π₯ TABLE METHODS π₯
these are the methods that return tables of information as a reference to a hash. so much data, so organized, we love a structured queen π
π Overrides
$c2900->interfaces()β returns a reference to the map between IID and physical Port.
so here's the tea: on the 2900 devices, i_name isn't reliable, so we override to just use the description. ngl, bold choice, but correct.
next, all dots get swapped for forward slashes so that the physical port name matches the broad-casted CDP port name. like:
(Ethernet0.1 -> Ethernet0/1)
also, any weird characters get removed, because β and I quote the manpage energy here β I saw a few pop up. bye weird characters π
$c2900->i_duplex()β returns a reference to a map of IIDs to current link duplex. crosses$c2900->c2900_p_index()with$c2900->c2900_p_duplex()π«$c2900->i_duplex_admin()β returns a reference to a hash of IIDs to admin duplex setting. crosses$c2900->c2900_p_index()with$c2900->c2900_p_duplex_admin()π$c2900->i_speed_admin()β returns a reference to a hash of IIDs to admin speed setting. that's the whole sentence, she's efficient β¨
πΈ C2900-MIB Port Entry Table πΈ
$c2900->c2900_p_index()β maps the Switch Port Table to the IID.
("c2900PortIfIndex")
$c2900->c2900_p_duplex()β gives Port Duplex Info.
("c2900PortDuplexStatus")
$c2900->c2900_p_duplex_admin()β gives the admin setting for Duplex Info.
("c2900PortDuplexState")
$c2900->c2900_p_speed_admin()β gives the Admin speed of port.
("c2900PortAdminSpeed")
π Table Methods imported from SNMP::Info::Layer2::Cisco
see "TABLE METHODS" in SNMP::Info::Layer2::Cisco for details. more borrowed slay β¨
π SET METHODS π
these are methods that provide SNMP set functionality for overridden methods, or provide a simpler interface to complex set operations. see "SETTING DATA VIA SNMP" in SNMP::Info for the general info on set operations, iykyk.
β οΈ bestie, these ones actually change stuff on the device. read carefully before you go setting things.
$c2900->set_i_speed_admin(speed, ifIndex)β sets port speed. you must supply it with the speed and the port"ifIndex".
speed choices are 'auto', '10', '100' πββοΈ
crosses $c2900->c2900_p_index() with $c2900->c2900_p_speed_admin() to utilize port "ifIndex".
Example:
my %if_map = reverse %{$c2900->interfaces()};
$c2900->set_i_speed_admin('auto', $if_map{'FastEthernet0/1'})
or die "Couldn't change port speed. ",$c2900->error(1);
$c2900->set_i_duplex_admin(duplex, ifIndex)β sets port duplex. you must supply it with the duplex and the port"ifIndex".
speed choices are 'auto', 'half', 'full' π¦
crosses $c2900->c2900_p_index() with $c2900->c2900_p_duplex_admin() to utilize port "ifIndex".
Example:
my %if_map = reverse %{$c2900->interfaces()};
$c2900->set_i_duplex_admin('auto', $if_map{'FastEthernet0/1'})
or die "Couldn't change port duplex. ",$c2900->error(1);
and that's the whole page bestie, you ate it up π
this little gem came to you courtesy of the User Contributed Perl Documentation, living under perl v5.40.1, dated 2026-02-28. stay connected, stay subclassed, and don't forget to $c2900->error(1) when things go sideways πβ¨π
π¦ where this page comes from
- ubuntu stonking: libsnmp-info-perl 3.975000-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms