SNMP::Info::Layer3::Extreme - Perl5 Interface to Extreme Network Devices
Eric Miller, Bill Fenner
# Let SNMP::Info determine the correct subclass for you. my $extreme = new SNMP::Info( AutoSpecify => 1, Debug => 1, DestHost => 'myswitch', Community => 'public', Version => 1 ) or die "Can't connect to DestHost.\n"; my $class = $extreme->class(); print "SNMP::Info determined this device to fall under subclass : $class\n";
Provides abstraction to the configuration information obtainable from an Extreme device through SNMP.
For speed or debugging purposes you can call the subclass directly, but not after determining a more specific class using the method above.
my $extreme = new SNMP::Info::Layer3::Extreme(...);
See classes listed above for their required MIBs.
These are methods that return scalar value from SNMP
Returns model type. Checks $extreme->id() against the EXTREME-BASE-MIB.
Returns extreme
Parses device operating system version from description()
Returns serial number
(extremeSystemID)
extremeSystemID
Returns system temperature
(extremeCurrentTemperature)
extremeCurrentTemperature
Returns status of power supply 1
(extremePowerSupplyStatus.1)
extremePowerSupplyStatus.1
Returns status of power supply 2
(extremePowerSupplyStatus.2)
extremePowerSupplyStatus.2
Returns fan status
(extremeFanOperational.1)
extremeFanOperational.1
Returns base mac
(dot1dBaseBridgeAddress)
dot1dBaseBridgeAddress
See documentation in "GLOBALS" in SNMP::Info::Layer3 for details.
See documentation in "GLOBALS" in SNMP::Info::MAU for details.
See documentation in "GLOBALS" in SNMP::Info::LLDP for details.
See documentation in "GLOBALS" in SNMP::Info::EDP for details.
These are methods that return tables of information in the form of a reference to a hash.
Returns a mapping between the Interface Table Index (iid) and the physical port name.
Parses mau_index and mau_link to return the duplex information for interfaces.
Parses mac_index,mau_autostat,mau_type_admin in order to find the admin duplex setting for all the interfaces.
mac_index
mau_autostat
mau_type_admin
Returns either (auto,full,half).
Returns reference to hash. Increments value of IID if port is to be ignored.
Ignores VLAN meta interfaces and loopback
(extremeFdbMacFdbMacAddress)
extremeFdbMacFdbMacAddress
(extremeFdbMacFdbPortIfIndex)
extremeFdbMacFdbPortIfIndex
(extremeFdbMacFdbStatus)
extremeFdbMacFdbStatus
Returns the mapping to the SNMP Interface Table. Extreme LLDP uses the bridge index rather than ifIndex.
Returns a mapping between ifIndex and the VLAN.
ifIndex
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"; }
Returns VLAN IDs
Returns VLAN names
(extremeVlanIfDescr)
extremeVlanIfDescr
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.
Power supplied by PoE ports, in milliwatts
(extremePethPortMeasuredPower)
extremePethPortMeasuredPower
The configured maximum amount of in-line power available to the slot.
(extremePethSlotPowerLimit)
extremePethSlotPowerLimit
See documentation in "TABLE METHODS" in SNMP::Info::Layer3 for details.
See documentation in "TABLE METHODS" in SNMP::Info::MAU for details.
See documentation in "TABLE METHODS" in SNMP::Info::LLDP for details.
See documentation in "TABLE METHODS" in SNMP::Info::EDP for details.
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 %{$extreme->interfaces()}; $extreme->set_i_vlan('2', $if_map{'FastEthernet0/1'}) or die "Couldn't change port VLAN. ",$extreme->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 %{$extreme->interfaces()}; $extreme->set_i_pvid('2', $if_map{'FastEthernet0/1'}) or die "Couldn't change port default VLAN. ",$extreme->error(1);
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);
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);
Removes 'present' and changes 'not' to 'Not' in the front of a string.
Replaces 'true' with "OK" and 'false' with "Not OK".
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.