SNMP::Info::CiscoStack - SNMP Interface to data from CISCO-STACK-MIB and CISCO-PORT-SECURITY-MIB
Max Baker
# Let SNMP::Info determine the correct subclass for you. my $ciscostats = new SNMP::Info( AutoSpecify => 1, Debug => 1, DestHost => 'myswitch', Community => 'public', Version => 2 ) or die "Can't connect to DestHost.\n"; my $class = $ciscostats->class(); print "SNMP::Info determined this device to fall under subclass : $class\n";
SNMP::Info::CiscoStack is a subclass of SNMP::Info that provides an interface to the CISCO-STACK-MIB. This MIB is used across the Catalyst family under CatOS and IOS.
CISCO-STACK-MIB
Use or create in a subclass of SNMP::Info. Do not use directly.
none.
(sysBroadcast)
sysBroadcast
(chassisFanStatus)
chassisFanStatus
(chassisModel)
chassisModel
(sysNetMask)
sysNetMask
(chassisPs1Type)
chassisPs1Type
(chassisPs2Type)
chassisPs2Type
(chassisPs1Status)
chassisPs1Status
(chassisPs2Status)
chassisPs2Status
(chassisSerialNumberString) or (chassisSerialNumber)
chassisSerialNumberString
chassisSerialNumber
(chassisNumSlots)
chassisNumSlots
Returns a map to IID for ports that are physical ports, not vlans, etc.
Crosses p_port() with p_type() and returns the results.
Overrides with ifType if p_type() isn't available.
ifType
Returns reference to hash of iid to current link duplex setting.
First checks for fixed gigabit ports which are always full duplex. Next, if the port is not operational and reported port duplex (portDuplex) is auto then the operational duplex can not be determined. Otherwise it uses the reported port duplex (portDuplex).
portDuplex
Returns reference to hash of iid to administrative duplex setting.
First checks for fixed gigabit ports which are always full duplex. Next checks the port administrative speed (portAdminSpeed) which if set to autonegotiate then the duplex will also autonegotiate, otherwise it uses the reported port duplex (portDuplex).
portAdminSpeed
Returns reference to hash of iid to administrative speed setting.
Sets port speed, must be supplied with speed and port C<ifIndex> Speed choices are 'auto', '10', '100', '1000' Crosses $stack->p_port() with $stack->p_duplex() to utilize port C<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);
Sets port duplex, must be supplied with duplex and port C<ifIndex> Speed choices are 'auto', 'half', 'full' Crosses $stack->p_port() with $stack->p_duplex() to utilize port C<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);
This table holds configuration information for each of the blades installed in the Catalyst device.
(moduleType)
moduleType
(moduleModel)
moduleModel
(moduleSerialNumber)
moduleSerialNumber
(moduleStatus)
moduleStatus
(moduleName)
moduleName
(moduleNumPorts)
moduleNumPorts
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)
modulePortStatus
(moduleHwVersion)
moduleHwVersion
(moduleFwVersion)
moduleFwVersion
(moduleSwVersion)
moduleSwVersion
(moduleIPAddress)
moduleIPAddress
(moduleSubType)
moduleSubType
(moduleSubType2)
moduleSubType2
CISCO-STACK-MIB::portTable
(portName)
portName
(portType)
portType
(portOperStatus)
portOperStatus
(portAdditionalStatus)
portAdditionalStatus
(portAdminSpeed)
(portDuplex)
(portIfIndex)
portIfIndex
Can be either on off or disagree
on
off
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
"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
Can be either on off or desired
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
"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
CISCO-STACK-MIB::portCpbTable
(portCpbSpeed)
portCpbSpeed
(portCpbDuplex)
portCpbDuplex
Munges binary byte describing each port into ascii, and returns an ascii list separated by spaces.
To install SNMP::Info, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SNMP::Info
CPAN shell
perl -MCPAN -e shell install SNMP::Info
For more information on module installation, please visit the detailed CPAN module installation guide.