NAME
SNMP::Info::Layer3::Huawei - SNMP Interface to Huawei switches and routers.
AUTHORS
Jeroen van Ingen and Eric Miller
SYNOPSIS
# Let SNMP::Info determine the correct subclass for you.
my $huawei = new SNMP::Info(
AutoSpecify => 1,
Debug => 1,
DestHost => 'myrouter',
Community => 'public',
Version => 2
)
or die "Can't connect to DestHost.\n";
my $class = $huawei->class();
print "SNMP::Info determined this device to fall under subclass : $class\n";
DESCRIPTION
Subclass for Huawei switches
Inherited Classes
Required MIBs
- HUAWEI-MIB
- HUAWEI-PORT-MIB
- HUAWEI-IF-EXT-MIB
- HUAWEI-L2IF-MIB
- HUAWEI-L2MAM-MIB
- HUAWEI-POE-MIB
- HUAWEI-ENTITY-EXTENT-MIB
- HUAWEI-MSTP-MIB
- HUAWEI-SYS-MAN-MIB
- Inherited Classes' MIBs
-
See SNMP::Info::Layer3 for its own MIB requirements.
See "Required MIBs" in SNMP::Info::IEEE802dot3ad for its own MIB requirements.
GLOBALS
These are methods that return scalar value from SNMP
- $huawei->vendor()
-
Returns 'huawei'.
- $huawei->os()
-
Returns 'VRP' if contained in
sysDescr, if not check for 'YunShan OS' and return if found, 'huawei' otherwise. - $huawei->os_ver()
-
Returns the software version extracted from
sysDescrwith a fallback toENTITY-MIB. - $huawei->mac()
-
Base MAC of the device.
(
dot1dBaseBridgeAddress) - $huawei->serial()
-
Returns the serial number derived from the
ENTITY-MIBchassis entry. When the chassis serial is empty, returns the serial of the lowest numbered module, the main board on models such as the AC6605.(
entPhysicalSerialNum) - $huawei->fan()
-
Return the status of all fans from the HUAWEI-ENTITY-EXTENT-MIB. Returns a string indicating the number of fans 'OK' or identification of any fan without a 'normal' operating status
- $huawei->ps1_status()
-
Return the status of the first power supply in each chassis or switch from the HUAWEI-ENTITY-EXTENT-MIB
- $huawei->ps2_status()
-
Return the status of the second power supply in each chassis or switch from the HUAWEI-ENTITY-EXTENT-MIB
Globals imported from SNMP::Info::Layer3
See documentation in SNMP::Info::Layer3 for details.
TABLE ENTRIES
These are methods that return tables of information in the form of a reference to a hash.
- $huawei->i_duplex()
-
Returns reference to map of IIDs to current link duplex.
- $huawei->i_duplex_admin()
-
Returns reference to hash of IIDs to admin duplex setting.
POE Slot Table
- $huawei->peth_power_watts()
-
The slot's power supply's capacity, in watts.
hwPoeSlotMaximumPower - $huawei->peth_power_consumption()
-
How much power, in watts, this power supply has been committed to deliver.
hwPoeSlotConsumingPower - $huawei->peth_power_threshold()
-
The threshold (in percent) of consumption required to raise an alarm.
hwPoeSlotPowerUtilizationThreshold
Overrides
- $huawei->i_ignore()
-
Returns reference to hash. Increments value of IID if port is to be ignored.
Ignores InLoopback and Console interfaces
- $huawei->bp_index()
-
Returns a mapping between
ifIndexand the Bridge Table. UseshwL2IfPortIfIndexfor the most complete mapping and falls back todot1dBasePortIfIndexif not available. agg_ports-
Returns a HASH reference mapping from slave to master port for each member of a port bundle on the device. Keys are ifIndex of the slave ports, Values are ifIndex of the corresponding master ports. Attempts to use
hwTrunkIfTablefirst and thendot3adAggPortListPortsif that is unavailable. i_mtu-
Interface MTU value. Overridden with corresponding frame size entry from
hwEthernetJumboframeMaxLengthif one exists. - $huawei->i_edgeport_admin()
-
Returns 1 or 0 for each port by whether it is configured as an edge port. Format is a hash reference with key =
ifIndex, value = [1|0]. Reads the instance 0 rows ofhwMstpiStpPortEdgeport;undotakes the default inhwMstpEdgedPortDefault. The row index is a bridge port on VRP 5, mapped toifIndexthroughbp_index(), and anifIndexon VRP 8 CloudEngine (sysObjectIDunder.1.3.6.1.4.1.2011.2.239), kept when the interface table has it. The VRP version comes from theVersion N.insysDescr. Without one, or on VRP 8 outside CloudEngine, the result is empty. With no instance 0 rows, falls back todot1dStpPortAdminEdgePortthrough SNMP::Info::Bridge.
Dynamic Forwarding Table (hwdbDynFdbTable)
- $huawei->hw_dyn_fdb_port()
-
The
ifIndexeach address was learned on, indexed by MAC address, VLAN and VSI name.(
hwDynFdbPort)
Q-BRIDGE Forwarding Table
These methods emulate the Q-BRIDGE-MIB dot1qTpFdbTable methods using the HUAWEI-L2MAM-MIB hwdbDynFdbTable, which Huawei switches serve in its place. Their keys are hwdbDynFdbTable indexes. An address that only dot1dTpFdbTable lists, such as an authenticated client's configured entry, is added under its dot1dTpFdbTable index with no VLAN. Without hwdbDynFdbTable rows, each returns the inherited method.
- $huawei->qb_fw_port()
-
Returns reference to hash. The bridge port each address was learned on: the
ifIndexinhwDynFdbPort, mapped throughbp_index(), or thedot1dTpFdbPortof an address added fromdot1dTpFdbTable. An address on a port with no bridge port is left out. - $huawei->qb_fw_mac()
-
Returns reference to hash. The MAC address of each entry, from its index.
- $huawei->qb_fw_vlan()
-
Returns reference to hash. The VLAN of each entry, from its index.
Spanning Tree Edge Port Sources
- $huawei->hw_mstp_edge_default()
-
(
hwMstpEdgedPortDefault) - $huawei->hw_mstp_p_edge()
-
(
hwMstpiStpPortEdgeport)
Power Port Table
The index of these methods have been normalized to slot.port and values munged to provide compatibility with the IEEE 802.3af POWER-ETHERNET-MIB and equivalent SNMP::Info::PowerEthernet methods.
- $huawei->peth_port_admin()
-
Administrative status: is this port permitted to deliver power?
- $huawei->peth_port_status()
-
Current status: is this port delivering power, searching, disabled, etc?
- $huawei->peth_port_class()
-
Device class: if status is delivering power, this represents the 802.3af class of the device being powered.
- $huawei->peth_port_power()
-
Power supplied the port, in milliwatts
- $huawei->peth_port_ifindex()
-
Returns an index of slot.port to an
ifIndex. Slot defaults to zero meaning chassis or box if there is noifIndexto slot mapping available inhwPhysicalPortInSlot. Mapping the index to slot.port is a normalization function to provide compatibility with the IEEE 802.3af POWER-ETHERNET-MIB. - $huawei->peth_port_neg_power()
-
The power, in milliwatts, that has been committed to this port. This value is derived from the 802.3af class of the device being powered.
Table Methods imported from SNMP::Info::Layer3
See documentation in SNMP::Info::Layer3 for details.
Table Methods imported from SNMP::Info::IEEE802dot3ad
See documentation in "METHODS" in SNMP::Info::IEEE802dot3ad and "TABLE METHODS" in SNMP::Info::IEEE802dot3ad for details.
Data Munging Callback Subroutines
- $huawei->munge_hw_peth_admin()
-
Normalizes
hwPoePortEnablevalues to 'true' or 'false'. - $huawei->munge_hw_peth_class()
-
Normalizes
hwPoePortPdClassvalues by prepending 'class'. - $huawei->munge_hw_peth_power()
-
Converts and rounds to a whole number milliwatts to watts.
- $huawei->munge_hw_peth_status()
-
Normalizes
hwPoePortPowerStatusvalues to those that would be returned by the the IEEE 802.3af POWER-ETHERNET-MIB.