SNMP::...::C1900(3pm)

πŸ’– SNMP::...::C1900(3pm) β€” the manual page, but make it make sense

okay bestie, welcome to SNMP::Info::Layer2::C1900 β€” it's part of the User Contributed Perl Documentation and it's literally your little backstage pass to Cisco Catalyst 1900 switches. pull up a chair, we're doing SNMP and we're doing it cute πŸ’…

✨ NAME ✨

SNMP::Info::Layer2::C1900 β€” an SNMP interface to data from Cisco Catalyst 1900 Network Switches running CatOS. that's the whole vibe, that's the whole job πŸ¦‹

🌸 AUTHOR 🌸

Max Baker β€” thank you for your service, icon πŸ‘‘

πŸŽ€ SYNOPSIS πŸŽ€

okay so here's how you actually use it. let SNMP::Info figure out the correct subclass for you (yes, it does the work, you just vibe):

# Let SNMP::Info determine the correct subclass for you.
my $c1900 = new SNMP::Info(
                         AutoSpecify => 1,
                         Debug       => 1,
                         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";

the AutoSpecify => 1 is doing the heavy lifting, and the or die is your emotional support safety net, fr fr 😭

πŸ¦‹ DESCRIPTION πŸ¦‹

it provides abstraction to the configuration information obtainable from a Catalyst 1900 device through SNMP. if you want the full tea, go read SNMP::Info β€” that's where all the full documentation lives πŸ“š

heads up: most of these devices only talk SNMP version 1, but not all. so don't go assuming, bestie πŸ™ˆ

πŸ’œ Inherited classes

the family tree, in order:

  • SNMP::Info::CDP
  • SNMP::Info::CiscoStats
  • SNMP::Info::CiscoConfig
  • SNMP::Info::CiscoStpExtensions
  • SNMP::Info::CiscoAgg
  • SNMP::Info::Layer2

⭐ Required MIBs

  • STAND-ALONE-ETHERNET-SWITCH-MIB (ESSWITCH-MIB) β€” ESSWITCH-MIB is included in the Version 1 MIBs from Cisco. no extra downloads, slay ✨

🌈 Inherited MIBs

go read these, one by one:

  • See "Required MIBs" in SNMP::Info::CDP for its MIB requirements.
  • See "Required MIBs" in SNMP::Info::CiscoStats for its MIB requirements.
  • See "Required MIBs" in SNMP::Info::CiscoConfig for its MIB requirements.
  • See "Required MIBs" in SNMP::Info::CiscoStpExtensions for its MIB requirements.
  • See "Required MIBs" in SNMP::Info::CiscoAgg for its MIB requirements.
  • See "Required MIBs" in SNMP::Info::Layer2 for its MIB requirements.

πŸ‘‘ GLOBALS πŸ‘‘

these are methods that return scalar values from SNMP. scalars. single values. one (1) answer each 🫢

  • $c1900->c1900_flash_status() β€” usually contains the version of the software loaded in flash. it's used by os_ver().
"STAND-ALONE-ETHERNET-SWITCH-MIB::upgradeFlashBankStatus"
  • $c1900->os() β€” returns 'catalyst'.
  • $c1900->os_ver() β€” returns the CatOS version if obtainable. first it tries to use SNMP::Info::CiscoStats->os_ver(). if that fails, it checks for the presence of $c1900->c1900_flash_status() and culls the version from there. plan A, then plan B, no cap πŸ”₯
  • $c1900->vendor() β€” returns 'cisco'.

πŸ’… Overrides

  • $c1900->cisco_comm_indexing() β€” returns 1. use vlan indexing.
  • $c1900->bulkwalk_no β€” return 1. bulkwalk is turned off for this class.

🧚 Globals imported from SNMP::Info::CDP

  • See "GLOBALS" in SNMP::Info::CDP for details.

🧚 Globals imported from SNMP::Info::CiscoStats

  • See "GLOBALS" in SNMP::Info::CiscoStats for details.

🧚 Globals imported from SNMP::Info::CiscoConfig

  • See "GLOBALS" in SNMP::Info::CiscoConfig for details.

🧚 Globals imported from SNMP::Info::CiscoStpExtensions

  • See "GLOBALS" in SNMP::Info::CiscoStpExtensions for details.

🧚 Globals imported from SNMP::Info::Layer2

  • See "GLOBALS" in SNMP::Info::Layer2 for details.

πŸ“ TABLE METHODS πŸ“

these are the methods that return tables of information β€” and because it's Perl, "a table" means a reference to a hash. love that for us 🌸

πŸ’– Overrides

  • $c1900->interfaces() β€” returns a reference to the map between IID and physical Port.
  • $c1900->i_duplex() β€” returns a reference to the map of IIDs to current link duplex.
  • $c1900->i_duplex_admin() β€” returns a reference to a hash of IIDs to admin duplex setting.
  • $c1900->i_name() β€” crosses "ifName" with $c1900->c1900_p_name() and returns the human set port name if it exists.
  • $c1900->i_vlan() β€” returns a mapping between the interface and the VLAN / bridge group, if overlap is not enabled.
  • $c1900->i_vlan_membership() β€” returns a reference to a hash of arrays: key = interface, value = array of VLAN / bridge group IDs.

Example:

my $interfaces = $c1900->interfaces();
my $vlans      = $c1900->i_vlan_membership();

foreach my $iid (sort keys %$interfaces) {
  my $port = $interfaces->{$iid};
  my $vlan = join(',', sort(@{$vlans->{$iid}}));
  print "Port: $port VLAN: $vlan\n";
}
  • $c1900->i_vlan_membership_untagged() β€” unsupported. returns nothing. it's giving ghosting πŸ’€
  • $c1900->bp_index() β€” returns a bp_index that contains the original bp_index entries plus extra entries for those interfaces listed in if_index, because some C1900 devices do not return complete bp_indexes. so it fills in the gaps, bestie 🫢

🌟 STAND-ALONE-ETHERNET-SWITCH-MIB Switch Port Table Entries:

  • $c1900->c1900_p_index() β€” maps the Switch Port Table to the IID.
"swPortIfIndex"
  • $c1900->c1900_p_duplex() β€” gives Port Duplex Info.
("swPortDuplexStatus")
  • $c1900->c1900_p_duplex_admin() β€” gives the admin setting for Duplex Info.
("swPortFullDuplex")
  • $c1900->c1900_p_name() β€” gives the human set name for the port.
("swPortName")
  • $c1900->c1900_p_up_admin() β€” gives the Admin status of port enabled.
("swPortAdminStatus")
  • $c1900->c1900_p_type() β€” gives the Type of port, i.e. "general-ethernet".
("swPortMediaCapability")
  • $c1900->c1900_p_media() β€” gives the media of the port, i.e. ""fiber-sc"".
("swPortConnectorType")

🧚 Table Methods imported from SNMP::Info::CDP

  • See "TABLE METHODS" in SNMP::Info::CDP for details.

🧚 Table Methods imported from SNMP::Info::CiscoStats

  • See "TABLE METHODS" in SNMP::Info::CiscoStats for details.

🧚 Table Methods imported from SNMP::Info::CiscoConfig

  • See "TABLE METHODS" in SNMP::Info::CiscoConfig for details.

🧚 Table Methods imported from SNMP::Info::CiscoStpExtensions

  • See "TABLE METHODS" in SNMP::Info::CiscoStpExtensions for details.

🧚 Table Methods imported from SNMP::Info::CiscoAgg

  • See "TABLE METHODS" in SNMP::Info::CiscoAgg for details.

🧚 Table Methods imported from SNMP::Info::Layer2

  • See "TABLE METHODS" in SNMP::Info::Layer2 for details.

πŸ”₯ SET METHODS πŸ”₯

these are methods that provide SNMP set functionality for overridden methods, or that give you a simpler interface to complex set operations. for the general tea on set operations, see "SETTING DATA VIA SNMP" in SNMP::Info. this is the part where you change stuff, so like, be normal about it πŸ™ˆ

  • $c1900->set_i_duplex_admin(duplex, ifIndex) β€” sets port duplex. you must supply both the duplex and the port "ifIndex". the speed choices are 'auto', 'half', 'full'.

Example:

my %if_map = reverse %{$c1900->interfaces()};
$c1900->set_i_duplex_admin('auto', $if_map{'1'})
  or die "Couldn't change port duplex. ",$c1900->error(1);

and that's the whole page, bestie β€” every last flag, method, MIB and example, preserved with love πŸ’–

this absolute gem is perl v5.40.1, dated 2026-02-28, and it's the SNMP::...::C1900(3pm) page. go forth and poll responsibly πŸŽ€βœ¨

πŸ“¦ where this page comes from