NAME

SNMP::Info::Layer3::Extreme - Perl5 Interface to Extreme Network Devices

AUTHOR

Eric Miller, Bill Fenner

SYNOPSIS

# Let SNMP::Info determine the correct subclass for you.
my $extreme = new SNMP::Info(
                         AutoSpecify => 1,
                         Debug       => 1,
                         DestHost    => 'myswitch',
                         Community   => 'public',
                         Version     => 2
                       )
   or die "Can't connect to DestHost.\n";

my $class      = $extreme->class();

print "SNMP::Info determined this device to fall under subclass : $class\n";

DESCRIPTION

Provides abstraction to the configuration information obtainable from an Extreme device through SNMP.

Inherited Classes

SNMP::Info::Layer3
SNMP::Info::MAU
SNMP::Info::EDP

Required MIBs

EXTREME-BASE-MIB
EXTREME-SYSTEM-MIB
EXTREME-FDB-MIB
EXTREME-VLAN-MIB
EXTREME-POE-MIB
EXTREME-STP-EXTENSIONS-MIB
EXTREME-PORT-MIB
EXTREME-MLAG-MIB
Inherited Classes' MIBs

See classes listed above for their required MIBs.

GLOBALS

These are methods that return scalar value from SNMP

$extreme->model()

Returns model type. Checks $extreme->id() against the EXTREME-BASE-MIB.

$extreme->vendor()

Returns extreme

$extreme->os()

Returns xos or extremeware depending on description()

$extreme->os_ver()

Parses device operating system version from description()

$extreme->serial()

Returns serial number

(extremeSystemID)

$extreme->temp()

Returns system temperature

(extremeCurrentTemperature)

$extreme->ps1_status()

Returns status of power supply 1

(extremePowerSupplyStatus.1)

$extreme->ps2_status()

Returns status of power supply 2

(extremePowerSupplyStatus.2)

$extreme->fan()

Returns fan status

(extremeFanOperational.1)

$extreme->mac()

Returns base mac

(dot1dBaseBridgeAddress)

$extreme->hasMSTP()

Returns 1 when the device runs MSTP: dot1dStpVersion is 3.

$extreme->hasRSTP()

Returns 1 when the device runs 802.1W: dot1dStpVersion is 2.

$extreme->hasPVST()

Returns 1 when any domain's ports run in PVST+ mode (extremeStpPortPortMode pvstp).

$extreme->hasSTP()

Returns 1 when dot1dStpVersion is 0 and a domain has no port in PVST+ mode. A device with one such domain and one PVST+ domain answers 1 to both hasSTP() and hasPVST().

Globals imported from SNMP::Info::Layer3

See documentation in "GLOBALS" in SNMP::Info::Layer3 for details.

Globals imported from SNMP::Info::MAU

See documentation in "GLOBALS" in SNMP::Info::MAU for details.

Globals imported from SNMP::Info::EDP

See documentation in "GLOBALS" in SNMP::Info::EDP for details.

TABLE METHODS

These are methods that return tables of information in the form of a reference to a hash.

Overrides

$extreme->interfaces()

Returns a mapping between the Interface Table Index (iid) and the physical port name.

$extreme->i_duplex()

Parses mau_index and mau_link to return the duplex information for interfaces.

$extreme->i_duplex_admin()

Parses mac_index,mau_autostat,mau_type_admin in order to find the admin duplex setting for all the interfaces.

Returns either (auto,full,half).

$extreme->i_ignore()

Returns reference to hash. Increments value of IID if port is to be ignored.

Ignores VLAN meta interfaces and loopback

$extreme->fw_mac()

(extremeFdbMacFdbMacAddress)

$extreme->fw_port()

(extremeFdbMacFdbPortIfIndex)

$extreme->fw_status()

(extremeFdbMacFdbStatus)

$extreme->lldp_if()

Returns the mapping to the SNMP Interface Table. Extreme LLDP uses the bridge index rather than ifIndex.

$extreme->i_stp_state()

Returns reference to hash. Key: ifIndex, Value: the port state in the device's default spanning tree, from dot1dStpPortState mapped through bp_index. Returns an empty hash when the device serves no BRIDGE-MIB STP port table; the vendor extremeStpPortTable is not used, since it is keyed by STP domain.

(dot1dStpPortState)

$extreme->i_vlan()

Returns a mapping between ifIndex and the VLAN.

$extreme->i_vlan_membership()

Returns reference to hash of arrays: key = ifIndex, value = array of VLAN IDs. These are the VLANs which are members of the egress list for the port.

Example:
my $interfaces = $extreme->interfaces();
my $vlans      = $extreme->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";
}
$extreme->i_vlan_membership_untagged()

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.

$extreme->v_index()

Returns VLAN IDs from extremeVlanIfTable, or from Q-BRIDGE-MIB when that table is empty.

$extreme->v_name()

Returns VLAN names from extremeVlanIfDescr, or dot1qVlanStaticName when extremeVlanIfTable is empty.

(extremeVlanIfDescr)

$extreme->bp_index()

Returns reference to hash of bridge port table entries map back to interface identifier (iid)

Returns (ifIndex) for both key and value since we're using EXTREME-FDB-MIB rather than BRIDGE-MIB.

$extreme->vrf_instances_complete( [ \@names ] )

On ExtremeXOS, returns undef where SNMP::Info::VRF would return 1. EXOS serves mplsL3VpnConfiguredVrfs as 0 even with virtual routers configured, since they answer only as SNMPv3 contexts. So the list is never known to be whole. A caller name still returns 0.

$extreme->context_kinds($feature)

Returns ['vrf'] for vrf on ExtremeXOS, where each virtual router answers in its own SNMPv3 context. Returns nothing otherwise, and nothing on ExtremeWare. See context_kinds() in SNMP::Info.

$extreme->snmp_context($kind, $id)

Returns nothing for kinds other than vrf. See snmp_context() in SNMP::Info.

On ExtremeXOS, for a virtual router name returns { kind => 'vrf', id => $name, v2c => undef, v3 => $name }. The default virtual router is the default context, so default and an empty name get nothing.

On ExtremeXOS v2c is undef. The ExtremeXOS user guide documents an SNMPv2c read community of the form vr_name@community_name for a user virtual router. That form is unverified, so it is not offered as v2c. If you can confirm it on a device, please open an issue with a walk. SNMPv3 with the virtual router name as the context is verified; use it.

$extreme->peth_port_power()

Power supplied by PoE ports, in milliwatts

(extremePethPortMeasuredPower)

$extreme->peth_power_watts()

The configured maximum amount of in-line power available to the slot.

(extremePethSlotPowerLimit)

VRF Instances

See "VRF Instances" in SNMP::Info::VRF for the readers. ExtremeXOS uses context mode.

ExtremeXOS

  • On ExtremeXOS 33.6 the virtual routers answer only as SNMPv3 contexts, and the device serves no list of them: mplsL3VpnConfiguredVrfs is 0 and MPLS-L3VPN-STD-MIB has no row. Pass the names with vrf_instances(\@names). Each reads in the context of its name.

  • The address table is the same in every context. So the ports of a context are the interfaces of its inetCidrRouteTable routes, and its addresses, neighbors and subnets are those on them.

  • EXOS puts a VLAN's IPv4 routes on its router interface, whose ifName is <vlan> rtif(<address>), and the VLAN's addresses on the interface named <vlan>. A router interface therefore also makes its VLAN's interface a port of the context.

  • The default context works the same way, for the default virtual router.

  • A subnet two virtual routers share is read from each one's connected route.

  • A name the device lacks has no route, so it reads no port, address or neighbor.

Spanning Tree Instance Globals

$extreme->stp_i_mac()

Returns the MAC extracted from (extremeStpDomainBridgeId).

$extreme->stp_i_id()

Returns the unique identifier of the STP domain.

(extremeStpDomainStpdInstance)

$extreme->stp_i_time()

Returns time since last topology change detected. (100ths/second)

(extremeStpDomainTimeSinceTopologyChange)

$extreme->stp_i_time()

Returns time since last topology change detected. (100ths/second)

(extremeStpDomainTimeSinceTopologyChange)

$extreme->stp_i_time()

Returns the total number of topology changes detected.

(extremeStpDomainTopChanges)

$extreme->stp_i_root()

Returns root of STP.

(extremeStpDomainDesignatedRoot)

$extreme->stp_i_root_port()

Returns the port number of the port that offers the lowest cost path to the root bridge.

(extremeStpDomainRootPortIfIndex)

$extreme->stp_i_priority()

Returns the port number of the port that offers the lowest cost path to the root bridge.

(extremeStpDomainBridgePriority)

Spanning Tree Protocol Port Table

$extreme->stp_p_id()

(extremeStpPortPortIfIndex)

$extreme->stp_p_stg_id()

(extremeStpDomainStpdInstance)

$extreme->stp_p_priority()

(extremeStpPortPortPriority)

$extreme->stp_p_state()

(extremeStpPortPortState)

$extreme->stp_p_enable()

(extremeStpPortStpEnabled)

$extreme->stp_p_cost()

(extremeStpPortPathCost)

$extreme->stp_p_root()

(extremeStpPortDesignatedRoot)

$extreme->stp_p_bridge()

(extremeStpPortDesignatedBridge)

$extreme->stp_p_port()

(extremeStpPortDesignatedPort)

Spanning Tree Trees

EXOS runs one spanning tree per STP domain, served in the default context. These override "Spanning Tree Trees" in SNMP::Info::Bridge, where the records are described.

The tree records:

Keys

domain.N for each domain, N its extremeStpDomainStpdInstance.

name

The domain name, extremeStpDomainStpdName.

vlan

The domain's carrier VLAN, extremeStpDomainStpdTag, when it is not 0.

protocol

dot1dStpVersion is device-wide, so a domain's protocol is:

  • pvst when a port of the domain runs in PVST+ mode (extremeStpPortPortMode pvstp);

  • else stp when dot1dStpVersion is 0;

  • else the protocol dot1dStpVersion names, when the device has one domain;

  • else undef.

measured

1 on EXOS, 0 otherwise.

ports_complete

1.

contexts

The default context.

bridge, root

extremeStpDomainBridgeId and extremeStpDomainDesignatedRoot.

The port records come from extremeStpPortTable: state (extremeStpPortPortState), enabled (extremeStpPortStpEnabled), designated_bridge and designated_port. role and role_raw are undef: the MIB serves none.

$extreme->stp_protocols()

Returns reference to an array of the protocols hasSTP(), hasRSTP(), hasMSTP() and hasPVST() report, or nothing.

$extreme->stp_trees()

Returns reference to hash of domain records keyed domain.<instance>.

$extreme->stp_tree_ports($tree_key)

Returns reference to hash of the domain's port records keyed by ifIndex, from (extremeStpPortTable).

$extreme->stp_trees_complete()

Returns 1 or 0, as "Spanning Tree Trees" in SNMP::Info::Bridge describes. 0 when the device serves no domain, or the extremeStpDomainStpdName walk was incomplete.

$extreme->stp_vlan_map()

Returns reference to hash mapping VLAN id to domain key, from the index of (extremeStpVlanPortTable) and (extremeVlanIfVlanId).

$extreme->ex_stp_i_name()

(extremeStpDomainStpdName)

$extreme->ex_stp_i_tag()

(extremeStpDomainStpdTag)

$extreme->ex_stp_p_mode()

(extremeStpPortPortMode)

$extreme->ex_stp_vlan_mask()

(extremeStpVlanPortPortMask)

$extreme->agg_ports()

Returns a reference to a hash mapping each member port ifIndex to the ifIndex of its load sharing master, from extremePortLoadshare2Table. The table lists the master as a member of itself; that row is left out. Returns an empty hash when the device serves no load sharing rows.

$extreme->lag_groups()

As described in "METHODS" in SNMP::Info::IEEE802dot3ad, keyed by the load sharing master port, with:

  • The master port is a member of its own aggregate.

  • An aggregate whose master or member is an MLAG port (extremeMlagPortTable) gets mc: kind mlag, group the MLAG port id (extremeMlagPortId), domain the peer name (extremeMlagPortPeer), and state the local link status (extremeMlagPortLocalLinkStatus).

  • An MLAG port whose load sharing group has only its master is an aggregate of its own, keyed by that master, with the port as its member.

  • An MLAG port with no load sharing row is an aggregate of its own, keyed by the port, with the port as its member.

$extreme->mlag_domains()

As described in "METHODS" in SNMP::Info::IEEE802dot3ad, keyed by MLAG peer name (extremeMlagPeerTable), with kind mlag and these fields:

  • system_mac: the operational LACP MAC, extremeMlagPeerOperLacpMac.

  • peer: the peer address, extremeMlagPeerIP, served as an address or as text.

  • status: the checkpoint status, extremeMlagPeerCheckPointStatus.

$extreme->ex_loadshare()

(extremePortLoadshare2Status)

$extreme->ex_mlag_peer_ip()

(extremeMlagPeerIP)

$extreme->ex_mlag_peer_status()

(extremeMlagPeerCheckPointStatus)

$extreme->ex_mlag_peer_lacp_mac()

(extremeMlagPeerOperLacpMac)

$extreme->ex_mlag_port_id()

(extremeMlagPortId)

$extreme->ex_mlag_port_peer()

(extremeMlagPortPeer)

$extreme->ex_mlag_port_state()

(extremeMlagPortLocalLinkStatus)

Table Methods imported from SNMP::Info::Layer3

See documentation in "TABLE METHODS" in SNMP::Info::Layer3 for details.

Table Methods imported from SNMP::Info::MAU

See documentation in "TABLE METHODS" in SNMP::Info::MAU for details.

Table Methods imported from SNMP::Info::EDP

See documentation in "TABLE METHODS" in SNMP::Info::EDP for details.

SET METHODS

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.

ExtremeWare is configured through ifStackTable and extremeVlanEncapsIfTable. ExtremeXOS has neither table, so when extremeVlanEncapsIfTable is empty these methods use dot1qPvid and dot1qVlanStaticEgressPorts from Q-BRIDGE-MIB instead.

$extreme->set_i_vlan ( vlan, ifIndex )

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. Through Q-BRIDGE-MIB, a VLAN already tagged on the port is removed from its egress list first.

Example:
my %if_map = reverse %{$extreme->interfaces()};
$extreme->set_i_vlan('2', $if_map{'FastEthernet0/1'})
  or die "Couldn't change port VLAN. ",$extreme->error(1);
$extreme->set_i_pvid ( pvid, ifIndex )

Sets port default VLAN, must be supplied with the numeric VLAN ID and port ifIndex. This method should only be used on trunk ports. Through Q-BRIDGE-MIB, a VLAN tagged on the port is refused; use set_i_vlan.

Example:
my %if_map = reverse %{$extreme->interfaces()};
$extreme->set_i_pvid('2', $if_map{'FastEthernet0/1'})
  or die "Couldn't change port default VLAN. ",$extreme->error(1);
$extreme->set_add_i_vlan_tagged ( vlan, ifIndex )

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 %{$extreme->interfaces()};
$extreme->set_add_i_vlan_tagged('2', $if_map{'FastEthernet0/1'})
  or die "Couldn't add port to egress list. ",$extreme->error(1);
$extreme->set_remove_i_vlan_tagged ( vlan, ifIndex )

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 %{$extreme->interfaces()};
$extreme->set_remove_i_vlan_tagged('2', $if_map{'FastEthernet0/1'})
  or die "Couldn't add port to egress list. ",$extreme->error(1);

Data Munging Callback Subroutines

$extreme->munge_power_stat()

Removes 'present' and changes 'not' to 'Not' in the front of a string.

$extreme->munge_true_ok()

Replaces 'true' with "OK" and 'false' with "Not OK".