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::CDPSNMP::Info::CiscoStatsSNMP::Info::CiscoConfigSNMP::Info::CiscoStpExtensionsSNMP::Info::CiscoAggSNMP::Info::Layer2
β Required MIBs
STAND-ALONE-ETHERNET-SWITCH-MIB(ESSWITCH-MIB) βESSWITCH-MIBis 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::CDPfor its MIB requirements. - See "Required MIBs" in
SNMP::Info::CiscoStatsfor its MIB requirements. - See "Required MIBs" in
SNMP::Info::CiscoConfigfor its MIB requirements. - See "Required MIBs" in
SNMP::Info::CiscoStpExtensionsfor its MIB requirements. - See "Required MIBs" in
SNMP::Info::CiscoAggfor its MIB requirements. - See "Required MIBs" in
SNMP::Info::Layer2for 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 byos_ver().
"STAND-ALONE-ETHERNET-SWITCH-MIB::upgradeFlashBankStatus"
$c1900->os()β returns'catalyst'.$c1900->os_ver()β returns the CatOS version if obtainable. first it tries to useSNMP::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()β returns1. use vlan indexing.$c1900->bulkwalk_noβ return1. bulkwalk is turned off for this class.
π§ Globals imported from SNMP::Info::CDP
- See "GLOBALS" in
SNMP::Info::CDPfor details.
π§ Globals imported from SNMP::Info::CiscoStats
- See "GLOBALS" in
SNMP::Info::CiscoStatsfor details.
π§ Globals imported from SNMP::Info::CiscoConfig
- See "GLOBALS" in
SNMP::Info::CiscoConfigfor details.
π§ Globals imported from SNMP::Info::CiscoStpExtensions
- See "GLOBALS" in
SNMP::Info::CiscoStpExtensionsfor details.
π§ Globals imported from SNMP::Info::Layer2
- See "GLOBALS" in
SNMP::Info::Layer2for 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 abp_indexthat contains the originalbp_indexentries plus extra entries for those interfaces listed inif_index, because some C1900 devices do not return completebp_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::CDPfor details.
π§ Table Methods imported from SNMP::Info::CiscoStats
- See "TABLE METHODS" in
SNMP::Info::CiscoStatsfor details.
π§ Table Methods imported from SNMP::Info::CiscoConfig
- See "TABLE METHODS" in
SNMP::Info::CiscoConfigfor details.
π§ Table Methods imported from SNMP::Info::CiscoStpExtensions
- See "TABLE METHODS" in
SNMP::Info::CiscoStpExtensionsfor details.
π§ Table Methods imported from SNMP::Info::CiscoAgg
- See "TABLE METHODS" in
SNMP::Info::CiscoAggfor details.
π§ Table Methods imported from SNMP::Info::Layer2
- See "TABLE METHODS" in
SNMP::Info::Layer2for 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
- 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