A class for performing SNMP V2 queries on Cisco devices

copyright Copyright (c) 2012 - 2013, Open Source Solutions Limited, Dublin, Ireland
author Barry O'Donovan

 Methods

Returns the CIST Internal Root Path Cost

cistIntRootCost() : string
> "Indicates the CIST Internal Root Path Cost, i.e., the > path cost to the CIST Regional Root as specified by the > corresponding stpxSMSTInstanceCISTRegionalRoot for the > MST region. > > This object is only instantiated when the object value of > stpxSpanningTreeType is mst(4) and stpxSMSTInstanceIndex > is 0."

Returns

stringThe bridge identifier of the CIST regional root for the MST region

Returns the maximum number of MST instances

cistRegionalRoot() : string
> "Indicates the Bridge Identifier (refer to BridgeId > defined in BRIDGE-MIB) of CIST (Common and Internal > Spanning Tree) Regional Root for the MST region. > > This object is only instantiated when the object value of > stpxSpanningTreeType is mst(4) and stpxSMSTInstanceIndex > is 0."

Returns

stringThe bridge identifier of the CIST regional root for the MST region

Get the SNMP instance

getSNMP() : \OSS_SNMP\SNMP

Returns

\OSS_SNMP\SNMPInstance of the SNMP object

Returns an array of running MST instances.

instances(string $name = null) : array
This is a hack on the remainingHopCount() as the MIB of this is empty on my test box (.1.3.6.1.4.1.9.9.82.1.14.5.1.1) We name the instances as well based on the region name / use specified string.

Parameters

$name

string

If null, then instances are named using the MST region name. Else this is the root of the name.

Returns

arrayThe running MST instances

Returns the maximum MST instance ID

maxInstanceId() : string
> "The maximum MST (Multiple Spanning Tree) instance id, > that can be supported by the device for IEEE MST"

Returns

stringThe maximum MST instance ID

Returns the maximum number of MST instances

maxInstances() : string
> "The maximum number of MST instances > that can be supported by the device for IEEE MST"

Returns

stringThe maximum number of MST instances

Returns the operational SMST region revision.

regionRevision() : string

Returns

stringThe operational SMST region revision

Returns the remaining hop count for all MST instances

remainingHopCount() : array
> "The remaining hop count for this MST instance. If this object > value is not applicable on an MST instance, then the value > retrieved for this object for that MST instance will be -1. > > This object is only instantiated when the object value of > stpxSpanningTreeType is mst(4)."

Returns

arrayThe remaining hop count for all MST instances

Set the SNMP instance

setSNMP(\OSS_SNMP\SNMP $snmp) : \OSS_SNMP\MIB

Parameters

$snmp

\OSS_SNMP\SNMP

the SNMP instance

Returns

\OSS_SNMP\MIBAn instance of this class for fluent interfaces

Return array of MST instances containing an array of mapped VLANs

vlansMapped($instanceID = false) : Array
The form of the returned array is: [ $mstInstanceId => [ $vlanTag => true / false, $vlanTag => true / false, ... ], ... ] If a VLAN tag is not present in the array of VLANs, then it is not a member of that MST instance.
see

Parameters

$instanceID

Returns

Arrayas described above.

Return array of MST instances containing an array of mapped VLAN ranges

vlansMappedAsRanges($instanceID = false) : Array
The form of the returned array is: [ $mstInstanceId => [ 500-599, 3000-4094, ... ], ... ] Example usage: foreach( $ports as $id => $portConf ) { echo sprintf( "%-16s - %-8s:\t", $portConf['host'], $portConf['port'] ); echo $hosts[ $portConf['host'] ]->useIface()->operationStates( true )[ $portNameToIndex[ $portConf['host'] ][ $portConf['port'] ] ] . "\n"; } Which results in (for example): MST0 vlans mapped: 1-299,400-499,600-799,900-999,1800-4094 MST1 vlans mapped: 300-399 MST2 vlans mapped: 500-599,800-899,1000-1099,1300-1499 MST3 vlans mapped: 1500-1599 MST4 vlans mapped: 1100-1199 MST5 vlans mapped: 1200-1299 MST6 vlans mapped: 1600-1799
see

Parameters

$instanceID

Returns

Arrayas described above.

 Properties

 

Instance for the SNMP object

$_snmp 

Default

null

 Constants

 

OID_STP_X_SMST_INSTANCE_CIST_INT_ROOT_COST

OID_STP_X_SMST_INSTANCE_CIST_INT_ROOT_COST = '.1.3.6.1.4.1.9.9.82.1.14.5.1.6.0' 
 

OID_STP_X_SMST_INSTANCE_CIST_REGIONAL_ROOT

OID_STP_X_SMST_INSTANCE_CIST_REGIONAL_ROOT = '.1.3.6.1.4.1.9.9.82.1.14.5.1.5.0' 
 

OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_1K2K

OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_1K2K = ".1.3.6.1.4.1.9.9.82.1.14.5.1.2" 
 

OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_3K4K

OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_3K4K = ".1.3.6.1.4.1.9.9.82.1.14.5.1.3" 
 

OID_STP_X_SMST_MAX_INSTANCES

OID_STP_X_SMST_MAX_INSTANCES = '.1.3.6.1.4.1.9.9.82.1.14.1.0' 
 

OID_STP_X_SMST_MAX_INSTANCE_ID

OID_STP_X_SMST_MAX_INSTANCE_ID = '.1.3.6.1.4.1.9.9.82.1.14.2.0' 
 

OID_STP_X_SMST_REGION_REVISION

OID_STP_X_SMST_REGION_REVISION = '.1.3.6.1.4.1.9.9.82.1.14.3.0' 
 

OID_STP_X_SMST_REMAINING_HOP_COUNT

OID_STP_X_SMST_REMAINING_HOP_COUNT = '.1.3.6.1.4.1.9.9.82.1.14.5.1.4'