SNMP::...oStack(3pm)
π SNMP::Info::CiscoStack π
okay bestie, welcome to the SNMP::...oStack(3pm) page from User Contributed Perl Documentation β yes that's its actual name, the ellipsis is doing icon behaviour. This is the whole thing, translated into vibes, with zero facts dropped. Let's go π¦
πΈ NAME πΈ
SNMP::Info::CiscoStack β the SNMP Interface to data from CISCO-STACK-MIB π
π AUTHOR π
Max Baker
β¨ SYNOPSIS β¨
# Let SNMP::Info determine the correct subclass for you.
my $ciscostack = new SNMP::Info(
AutoSpecify => 1,
Debug => 1,
DestHost => 'myswitch',
Community => 'public',
Version => 2
)
or die "Can't connect to DestHost.\n";
my $class = $ciscostack->class();
print "SNMP::Info determined this device to fall under subclass : $class\n";
like, let the module figure out what your switch is before you start making demands of it. main character energy fr fr π«Ά
π DESCRIPTION π
SNMP::Info::CiscoStack is a subclass of SNMP::Info that hands you an interface to the "CISCO-STACK-MIB". That MIB gets used everywhere across the Catalyst family, under both CatOS and IOS. iconic lineage honestly π
Use it β or create it β in a subclass of SNMP::Info. Do not use it directly. it is not built for that kind of attention π
π§ Inherited Classes
none. it's a self-made queen, no ancestors to speak of π
π Required MIBs
CISCO-STACK-MIB
π GLOBALS π
$stack->broadcast()β ("sysBroadcast")$stack->fan()β ("chassisFanStatus")$stack->model()β ("chassisModel")$stack->netmask()β ("sysNetMask")$stack->ps1_type()β ("chassisPs1Type")$stack->ps2_type()β ("chassisPs2Type")$stack->ps1_status()β ("chassisPs1Status")$stack->ps2_status()β ("chassisPs2Status")$stack->serial()β ("chassisSerialNumberString") or ("chassisSerialNumber") β yeah it'll take either one, flexible queen π$stack->slots()β ("chassisNumSlots")
π₯ TABLE METHODS π₯
π¦ Interface Tables
$stack->i_physical()Returns a map toIIDfor ports that are physical ports β not vlans, not whatever else snuck in there. real ones only β¨$stack->i_type()Crossesp_port()withp_type()and returns the results.
Overrides with "ifType" if p_type() isn't available.
$stack->i_duplex()Returns a reference to a hash ofiidβ current link duplex setting.
First it checks for fixed gigabit ports, which are always full duplex (no debate, they said what they said). Next, if the port is not operational and the reported port duplex ("portDuplex") is auto, then the operational duplex can not be determined. Otherwise it uses the reported port duplex ("portDuplex").
$stack->i_duplex_admin()Returns a reference to a hash ofiidβ administrative duplex setting.
First, fixed gigabit ports again β always full duplex, always. Next it checks the port administrative speed ("portAdminSpeed"): if that's set to autonegotiate, then the duplex will also autonegotiate; otherwise it uses the reported port duplex ("portDuplex").
$stack->i_speed_admin()Returns a reference to a hash ofiidβ administrative speed setting.
"portAdminSpeed"
$stack->set_i_speed_admin(speed, ifIndex)Sets port speed. You must supply it with the speed and the portifIndex. no shortcuts bestie π
Speed choices are 'auto', '10', '100', '1000'
Crosses $stack->p_port() with $stack->p_duplex() to utilize the port ifIndex.
Example:
my %if_map = reverse %{$stack->interfaces()};
$stack->set_i_speed_admin('auto', $if_map{'FastEthernet0/1'})
or die "Couldn't change port speed. ",$stack->error(1);
$stack->set_i_duplex_admin(duplex, ifIndex)Sets port duplex. You must supply it with the duplex and the portifIndex. same rules, same energy π
Speed choices are 'auto', 'half', 'full'
Crosses $stack->p_port() with $stack->p_duplex() to utilize the port ifIndex.
Example:
my %if_map = reverse %{$stack->interfaces()};
$stack->set_i_duplex_admin('auto', $if_map{'FastEthernet0/1'})
or die "Couldn't change port duplex. ",$stack->error(1);
π« Module table
This table holds configuration information for each of the blades installed in the Catalyst device. every blade gets its moment π
$stack->m_type()β ("moduleType")$stack->m_model()β ("moduleModel")$stack->m_serial()β ("moduleSerialNumber")$stack->m_status()β ("moduleStatus")$stack->m_name()β ("moduleName")$stack->m_ports()β ("moduleNumPorts")$stack->m_ports_status()Returns a list of space separated status strings for the ports.
To see the status of port 4:
@ports_status = split(' ', $stack->m_ports_status() );
$port4 = $ports_status[3];
("modulePortStatus")
$stack->m_ports_hwver()β ("moduleHwVersion")$stack->m_ports_fwver()β ("moduleFwVersion")$stack->m_ports_swver()β ("moduleSwVersion")$stack->m_ports_ip()β ("moduleIPAddress")$stack->m_ports_sub1()β ("moduleSubType")$stack->m_ports_sub2()β ("moduleSubType2")
π Modules - Router Blades
$stack->m_ip()β ("moduleIPAddress")$stack->m_sub1()β ("moduleSubType")$stack->m_sub2()β ("moduleSubType2")
π Port Entry Table ("CISCO-STACK-MIB::portTable")
$stack->p_name()β ("portName")$stack->p_type()β ("portType")$stack->p_status()β ("portOperStatus")$stack->p_status2()β ("portAdditionalStatus")$stack->p_speed()β ("portAdminSpeed")$stack->p_duplex()β ("portDuplex")$stack->p_port()β ("portIfIndex")$stack->p_rx_flow_control()Can be either"on","off"or"disagree"
"Indicates the receive flow control operational status of the port. If the port could not agree with the far end on a link protocol, its operational status will be disagree(3)."
("portOperRxFlowControl")
$stack->p_tx_flow_control()Can be either"on","off"or"disagree"
"Indicates the transmit flow control operational status of the port. If the port could not agree with the far end on a link protocol, its operational status will be disagree(3)."
("portOperTxFlowControl")
$stack->p_rx_flow_control_admin()Can be either"on","off"or"desired"
"Indicates the receive flow control administrative status set on the port. If the status is set to on(1), the port will require the far end to send flow control. If the status is set to off(2), the port will not allow far end to send flow control. If the status is set to desired(3), the port will allow the far end to send the flow control."
("portAdminRxFlowControl")
$stack->p_tx_flow_control_admin()Can be either"on","off"or"desired"
"Indicates the transmit flow control administrative status set on the port. If the status is set to on(1), the port will send flow control to the far end. If the status is set to off(2), the port will not send flow control to the far end. If the status is set to desired(3), the port will send flow control to the far end if the far end supports it."
("portAdminTxFlowControl")
π Port Capability Table ("CISCO-STACK-MIB::portCpbTable")
$stack->p_speed_admin()β ("portCpbSpeed")$stack->p_duplex_admin()β ("portCpbDuplex")
πΈ Data Munging Callback Subroutines πΈ
$stack->munge_port_status()Munges a binary byte describing each port into ascii, and returns an ascii list separated by spaces. little glow-up for boring bytes, we love to see it β¨
and that's the whole page, bestie, nothing skipped, nothing invented π this doc was living as perl v5.40.1, dated 2026-02-28, on the SNMP::...oStack(3pm) page β stay hydrated, read your MIBs, and slay π«Άπ
π¦ 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