SNMP::...Huawei(3pm)
β¨ NAME β¨
Okay bestie, gather round π this page is SNMP::Info::Layer3::Huawei β your SNMP interface to Huawei switches and routers. It lives in the User Contributed Perl Documentation, and the man page name is SNMP::...Huawei(3pm), iykyk π
π AUTHORS π
Jeroen van Ingen and Eric Miller. Absolute icons, no cap π
π¦ SYNOPSIS π¦
The vibe is: you let SNMP::Info figure out which subclass you actually need, and it just knows π§
# 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 πΈ
It's the subclass for Huawei switches, periodt β¨
π Inherited Classes π
SNMP::Info::Layer3SNMP::Info::IEEE802dot3ad
π Required MIBs π
HUAWEI-MIBHUAWEI-PORT-MIBHUAWEI-IF-EXT-MIBHUAWEI-L2IF-MIBHUAWEI-POE-MIBHUAWEI-ENTITY-EXTENT-MIB
π Inherited Classes' MIBs π
- See
SNMP::Info::Layer3for its own MIB requirements. - See
SNMP::Info::IEEE802dot3adfor 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",'huawei'otherwise.$huawei->os_ver()β Returns the software version derived from the"ENTITY-MIB"or extracted from"sysDescr".$huawei->mac()β Base MAC of the device.
("dot1dBaseBridgeAddress")
$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, okurrr π
$huawei->bp_index()β Returns a mapping between"ifIndex"and the Bridge Table. Uses"hwL2IfPortIfIndex"for the most complete mapping and falls back to"dot1dBasePortIfIndex"if 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"hwTrunkIfTable"first and then"dot3adAggPortListPorts"if that is unavailable."i_mtu"β Interface MTU value. Overridden with corresponding frame size entry from"hwEthernetJumboframeMaxLength"if one exists.
π¦ 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 no"ifIndex"to slot mapping available in"hwPhysicalPortInSlot". 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 SNMP::Info::IEEE802dot3ad for details.
π Data Munging Callback Subroutines π
$huawei->munge_hw_peth_admin()β Normalizes"hwPoePortEnable"values to'true'or'false'.$huawei->munge_hw_peth_class()β Normalizes"hwPoePortPdClass"values by prepending'class'.$huawei->munge_hw_peth_power()β Converts and rounds to a whole number milliwatts to watts.$huawei->munge_hw_peth_status()β Normalizes"hwPoePortPowerStatus"values to those that would be returned by the the IEEE 802.3af POWER-ETHERNET-MIB.
and that's the whole page, bestie π«Ά this one's running on perl v5.40.1, dated 2026-02-28, from the SNMP::...Huawei(3pm) manual. go read your switch, slay π
β¨
π¦ where this page comes from
- ubuntu stonking: libsnmp-info-perl 3.975000-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms