NAME
SNMP::Info::CiscoStpExtensions - SNMP Interface to CISCO-STP-EXTENSIONS-MIB
AUTHOR
Carlos Vicente
SYNOPSIS
my $stpx = new SNMP::Info(
AutoSpecify => 1,
Debug => 1,
DestHost => 'myswitch',
Community => 'public',
Version => 2
)
or die "Can't connect to DestHost.\n";
my $class = $stpx->class();
print " Using device sub class : $class\n";
DESCRIPTION
Create or use a subclass of SNMP::Info that inherits this class. Do not use directly.
For debugging you can call new() directly as you would in SNMP::Info
my $stpx = new SNMP::Info::CiscoStpExtensions(...);
In the default context, i_stp_state() reports VLAN 1's tree under PVST+ and Rapid-PVST+, with rows for VLAN 1's member ports only. Under MST the BRIDGE-MIB globals are the CIST's and the port rows are again VLAN 1's member ports.
Inherited Classes
Required MIBs
GLOBALS
These are methods that return scalar values from SNMP
- $stpx->stp_ver()
-
Returns the particular STP version running on this device. Meant to override SNMP::Info::Brigde::stp_ver()
Values:
pvstPlus,mistp,mistpPvstPlus,mst,rapidPvstPlus(
stpxSpanningTreeType) - $stpx->hasPVST()
-
Returns 1 when
stpxSpanningTreeTypeispvstPlus. - $stpx->hasRapidPVST()
-
Returns 1 when
stpxSpanningTreeTypeisrapidPvstPlus. - $stpx->hasMSTP()
-
Returns 1 when
stpxSpanningTreeTypeismst. The MST region and its instances are served under every mode, so they are not the test. - $stpx->context_kinds($feature)
-
See
context_kinds()in SNMP::Info. Returns['vlan']forstp: each VLAN's tree is served in that VLAN's context. - $stpx->snmp_context($kind, $id)
-
See
snmp_context()in SNMP::Info. Avlancontext is reached as the community suffix@Nunder SNMPv2c and the contextvlan-Nunder SNMPv3. Nomstcontext is served.
TABLE METHODS
These are methods that return tables of information in the form of a reference to a hash.
- $stpx->mst_config_digest()
-
Returns the Multiple Spanning Tree (MST) configuration digest
(
stpxSMSTConfigDigest) - $stpx->mst_region_name()
-
Returns the Multiple Spanning Tree (MST) region name
(
stpxMSTRegionName) - $stpx->mst_region_rev()
-
Returns the Multiple Spanning Tree (MST) region name
(
stpxSMSTRegionRevision) - $stpx->mst_vlan2instance()
-
Returns the mapping of vlan to MST instance in the form of a hash reference with key = VLAN id, value = STP instance
- $stpx->i_rootguard_enabled()
-
Returns 1 or 0 depending on whether
RootGuardis enabled on a given port. Format is a hash reference with key =ifIndex, value = [1|0](
stpxRootGuardConfigEnabled) - $stpx->i_loopguard_enabled()
-
Returns 1 or 0 depending on whether
LoopGuardis enabled on a given port. Format is a hash reference with key =ifIndex, value = [1|0](
stpxLoopGuardConfigEnabled) - $stpx->i_bpduguard_enabled()
-
Returns 1 or 0 depending on whether
BpduGuardis enabled on a given port. Format is a hash reference with key =ifIndex, value = [1|0](
stpxFastStartPortBpduGuardMode) - $stpx->i_bpdufilter_enabled()
-
Returns 1 or 0 depending on whether
BpduFilteris enabled on a given port. Format is a hash reference with key =ifIndex, value = [1|0](
stpxFastStartBpduFilterEnable) - $stpx->i_faststart_enabled()
-
Returns 1 or 0 depending on whether FastStart (aka PortFast) is enabled on a given port. Format is a hash reference with key =
ifIndex, value = [1|0](
stpxFastStartPortEnableandstpxFastStartPortMode)Legacy; see
i_edgeport_admin(). - $stpx->i_edgeport_admin()
-
Returns 1 or 0 depending on whether the port is configured as an edge port (FastStart, aka PortFast). A port in
networkmode returns 0, and a port with no configured value is absent. Cisco can only report ports that appear in the bridge table (bp_index()) of the context being polled. On IOS under PVST+ the default context lists only VLAN 1 ports and trunks; ports in other VLANs need the per-VLAN context. Format is a hash reference with key =ifIndex, value = [1|0](
stpxFastStartPortEnableandstpxFastStartPortMode) - $stpx->i_edgeport_oper()
-
Returns 1 or 0 depending on whether the port is operating as an edge port (FastStart, aka PortFast). Under PVST+ and Rapid-PVST+ the value is read from the tree of the port's native VLAN (the access VLAN on an access port, from
i_vlan()); a trunk whose native VLAN has no row, or a port with noi_vlan()entry, is absent. Under MST the value is read from instance 0. A port innetworkmode returns 0. Under any other protocol the result is empty. Cisco can only report ports that appear in the bridge table (bp_index()) of the context being polled. On IOS under PVST+ the default context lists only VLAN 1 ports and trunks; ports in other VLANs need the per-VLAN context. Format is a hash reference with key =ifIndex, value = [1|0](
stpxFastStartOperMode)
Spanning Tree Trees
These override "Spanning Tree Trees" in SNMP::Info::Bridge, where the records are described. The tree list, the protocol, the port roles and the MST VLAN map are served in the default context. Each tree's port states and designated bridges and ports are served in BRIDGE-MIB in the tree's own context; to switch, see "SNMP Contexts" in SNMP::Info.
The tree records:
- Keys
-
vlan.Nfor each VLAN under PVST+ and Rapid-PVST+.cist.0andmsti.Nunder MST. vlan-
The VLAN id, on
vlan.Ntrees. protocol-
pvst,rapid-pvstormstp, fromstpxSpanningTreeType. measured-
1 on IOS and IOS XE, and on NX-OS except under PVST+. 0 otherwise.
ports_complete-
0 for
cist.0, on every platform: IOS serves the CIST's trunk ports in no context. 1 for every other tree. contexts-
vlan.1: the default context.Another
vlan.N: VLAN N's context.msti.N: first the instance's ownmstcontext, wheresnmp_context('mst', N)gives one (SNMP::Info::Layer3::Nexus). Then the context of each VLAN mapped to the instance, VLAN 1 as the default context. Wherev_index()lists VLANs, only those are used.cist.0: the instance's ownmstcontext where there is one, else the default context.
bridge-
Undef: IOS serves a placeholder
dot1dBaseBridgeAddress, not the bridge address. root-
Only on
vlan.1andcist.0, fromdot1dStpDesignatedRootin the default context. Undef on other trees: readstp_root()in the tree's context.
The port records:
state,enabled,designated_bridge,designated_port-
From BRIDGE-MIB in the context being read.
role,role_raw-
From
stpxRSTPPortRoleValuewhere the context serves it, normalized bymunge_stpx_port_role(). PVST+ serves no role, and some IOS images serve none in a VLAN context.
- $stpx->stp_protocols()
-
Returns reference to an array holding
pvst,rapid-pvstormstpfromstpxSpanningTreeType, or nothing (including under MISTP). - $stpx->stp_trees()
-
Returns reference to hash of tree records: one per VLAN that runs spanning tree under PVST+ and Rapid-PVST+, one per MST instance under MST.
(
stpxFastStartOperModeTable,stpxRSTPPortRoleTableand, where neither serves a row,stpxPVSTVlanEnablewithvtpVlanType;stpxSMSTInstanceTableunder MST) - $stpx->stp_trees_complete()
-
Returns 1 or 0, as "Spanning Tree Trees" in SNMP::Info::Bridge describes. 0 when no tree is listed, as when the device names no protocol this class reads, and when a walk of the tables that list the trees was incomplete.
- $stpx->stp_vlan_map()
-
Returns reference to hash mapping each VLAN 1 to 4094 to its tree key under MST, from (
stpxSMSTInstanceVlansMapped1k2k) and (stpxSMSTInstanceVlansMapped3k4k), as served; nothing under PVST+ and Rapid-PVST+, where each VLAN is its own tree. - $stpx->stp_tree_ports($tree_key)
-
Returns reference to hash of port records keyed by ifIndex, read in the session's current context. Rows are labeled from
$tree_key, never from the context.In the default context, pass a tree whose
contextsinclude the default context. For any other tree it returns nothing, witherror()naming the tree's contexts.In another context, it cannot check the key against the tree list. Pass a tree whose
contextslist this context: rows read in any other context describe another tree.
- $stpx->stpx_pvst_vlan_enable()
-
(
stpxPVSTVlanEnable) - $stpx->stpx_faststart_oper()
-
(
stpxFastStartOperMode) - $stpx->stpx_rstp_port_role()
-
(
stpxRSTPPortRoleValue)