SNMP::Info::CiscoVTP - SNMP Interface to Cisco's VLAN Management MIBs
Max Baker
# Let SNMP::Info determine the correct subclass for you. my $vtp = new SNMP::Info( AutoSpecify => 1, Debug => 1, DestHost => 'myswitch', Community => 'public', Version => 2 ) or die "Can't connect to DestHost.\n"; my $class = $vtp->class(); print "SNMP::Info determined this device to fall under subclass : $class\n";
SNMP::Info::CiscoVTP is a subclass of SNMP::Info that provides information about a Cisco device's VLAN and VTP Domain membership.
Use or create in a subclass of SNMP::Info. Do not use directly.
None.
MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
(vtpVersion)
vtpVersion
(vtpMaxVlanStorage)
vtpMaxVlanStorage
(vtpNotificationsEnabled)
vtpNotificationsEnabled
(vtpVlanCreatedNotifEnabled)
vtpVlanCreatedNotifEnabled
(vtpVlanDeletedNotifEnabled)
vtpVlanDeletedNotifEnabled
(vlanTrunkPortSetSerialNo)
vlanTrunkPortSetSerialNo
Your device will only implement a subset of these methods.
Returns a mapping between ifIndex and assigned VLAN ID for access ports and the default VLAN ID for trunk ports.
ifIndex
An alias for i_vlan.
i_vlan
Returns reference to hash of arrays: key = ifIndex, value = array of VLAN IDs. These are the VLANs which are members of enabled VLAN list for the port.
Example: my $interfaces = $vtp->interfaces(); my $vlans = $vtp->i_vlan_membership(); foreach my $iid (sort keys %$interfaces) { my $port = $interfaces->{$iid}; my $vlan = join(',', sort(@{$vlans->{$iid}})); print "Port: $port VLAN: $vlan\n"; }
Returns reference to hash of arrays: key = ifIndex, value = array of VLAN IDs. These are the VLANs which are members of the untagged egress list for the port.
CISCO-VTP-MIB::vtpVlanTable
See ftp://ftp.cisco.com/pub/mibs/supportlists/wsc5000/wsc5000-communityIndexing.html for a good treaty of how to connect to the VLANs
(vtpVlanIndex)
vtpVlanIndex
(vtpVlanState)
vtpVlanState
(vtpVlanType)
vtpVlanType
(vtpVlanName)
vtpVlanName
(vtpVlanMtu)
vtpVlanMtu
(vtpVlanDot10Said)
vtpVlanDot10Said
(vtpVlanRingNumber)
vtpVlanRingNumber
(vtpVlanBridgeNumber)
vtpVlanBridgeNumber
(vtpVlanStpType)
vtpVlanStpType
(vtpVlanParentVlan)
vtpVlanParentVlan
(vtpVlanTranslationalVlan1)
vtpVlanTranslationalVlan1
(vtpVlanTranslationalVlan2)
vtpVlanTranslationalVlan2
(vtpVlanBridgeType)
vtpVlanBridgeType
(vtpVlanAreHopCount)
vtpVlanAreHopCount
(vtpVlanSteHopCount)
vtpVlanSteHopCount
(vtpVlanIsCRFBackup)
vtpVlanIsCRFBackup
(vtpVlanTypeExt)
vtpVlanTypeExt
(vtpVlanIfIndex)
vtpVlanIfIndex
CISCO-VLAN-MEMBERSHIP-MIB::vmMembershipTable
Static, Dynamic, or multiVlan.
(vmVlanType)
vmVlanType
The VLAN that an access port is assigned to.
(vmVlan)
vmVlan
Inactive, active, shutdown.
(vmPortStatus)
vmPortStatus
Each bit represents a VLAN. This is 0 through 1023
(vmVlans)
vmVlans
Each bit represents a VLAN. This is 1024 through 2047
(vmVlans2k)
vmVlans2k
Each bit represents a VLAN. This is 2048 through 3071
(vmVlans3k)
vmVlans3k
Each bit represents a VLAN. This is 3072 through 4095
(vmVlans4k)
vmVlans4k
CISCO-VLAN-MEMBERSHIP-MIB::vmVoiceVlanTable
(vmVoiceVlanId)
vmVoiceVlanId
CISCO-VTP-MIB::managementDomainTable
(managementDomainName)
managementDomainName
(managementDomainLocalMode)
managementDomainLocalMode
(managementDomainConfigRevNumber)
managementDomainConfigRevNumber
(managementDomainLastUpdater)
managementDomainLastUpdater
(managementDomainLastChange)
managementDomainLastChange
(managementDomainRowStatus)
managementDomainRowStatus
(managementDomainTftpServer)
managementDomainTftpServer
(managementDomainTftpPathname)
managementDomainTftpPathname
(managementDomainPruningState)
managementDomainPruningState
(managementDomainVersionInUse)
managementDomainVersionInUse
CISCO-VTP-MIB::vlanTrunkPortTable
(vlanTrunkPortManagementDomain)
vlanTrunkPortManagementDomain
(vlanTrunkPortEncapsulationType)
vlanTrunkPortEncapsulationType
(vlanTrunkPortVlansEnabled)
vlanTrunkPortVlansEnabled
(vlanTrunkPortVlansEnabled2k)
vlanTrunkPortVlansEnabled2k
(vlanTrunkPortVlansEnabled3k)
vlanTrunkPortVlansEnabled3k
(vlanTrunkPortVlansEnabled4k)
vlanTrunkPortVlansEnabled4k
(vlanTrunkPortNativeVlan)
vlanTrunkPortNativeVlan
(vlanTrunkPortRowStatus)
vlanTrunkPortRowStatus
(vlanTrunkPortDynamicState)
vlanTrunkPortDynamicState
(vlanTrunkPortDynamicStatus)
vlanTrunkPortDynamicStatus
(vlanTrunkPortVtpEnabled)
vlanTrunkPortVtpEnabled
(vlanTrunkPortEncapsulationOperType)
vlanTrunkPortEncapsulationOperType
These are methods that provide SNMP set functionality for overridden methods or provide a simpler interface to complex set operations. See "SETTING DATA VIA SNMP" in SNMP::Info for general information on set operations.
Changes an access (untagged) port VLAN, must be supplied with the numeric VLAN ID and port ifIndex. This method should only be used on end station (non-trunk) ports.
Example: my %if_map = reverse %{$vtp->interfaces()}; $vtp->set_i_vlan('2', $if_map{'FastEthernet0/1'}) or die "Couldn't change port VLAN. ",$vtp->error(1);
Sets port default VLAN, must be supplied with the numeric VLAN ID and port ifIndex. This method should only be used on trunk ports.
Example: my %if_map = reverse %{$vtp->interfaces()}; $vtp->set_i_pvid('2', $if_map{'FastEthernet0/1'}) or die "Couldn't change port default VLAN. ",$vtp->error(1);
This method attempts to work out whether the port referenced by ifIndex is trunking, and if so will return the value of set_i_pvid. Otherwise, the value of set_i_vlan is returned.
set_i_pvid
set_i_vlan
Adds the VLAN to the enabled VLANs list of the port, must be supplied with the numeric VLAN ID and port ifIndex.
Example: my %if_map = reverse %{$vtp->interfaces()}; $vtp->set_add_i_vlan_tagged('2', $if_map{'FastEthernet0/1'}) or die "Couldn't add port to egress list. ",$vtp->error(1);
Removes the VLAN from the enabled VLANs list of the port, must be supplied with the numeric VLAN ID and port ifIndex.
Example: my %if_map = reverse %{$vtp->interfaces()}; $vtp->set_remove_i_vlan_tagged('2', $if_map{'FastEthernet0/1'}) or die "Couldn't add port to egress list. ",$vtp->error(1);
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.