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 to IID for ports that are physical ports β€” not vlans, not whatever else snuck in there. real ones only ✨
  • $stack->i_type() Crosses p_port() with p_type() and returns the results.

Overrides with "ifType" if p_type() isn't available.

  • $stack->i_duplex() Returns a reference to a hash of iid β†’ 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 of iid β†’ 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 of iid β†’ administrative speed setting.

"portAdminSpeed"

  • $stack->set_i_speed_admin(speed, ifIndex) Sets port speed. You must supply it with the speed and the port ifIndex. 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 port ifIndex. 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