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() β€” returns 1. 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