---
name: "SNMP::Info::Layer3::Huawei"
section: "3pm"
platform: "linux"
package: "libsnmp-info-perl"
version: "3.972002-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SNMP::Info::Layer3::Huawei"
---

# SNMP::Info::Layer3::Huawei(3pm)

SNMP Interface to Huawei switches and routers.

## 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

- SNMP::Info::Layer3

  - SNMP::Info::IEEE802dot3ad

  ### Required MIBs

- *HUAWEI-MIB*

  - *HUAWEI-PORT-MIB*

  - *HUAWEI-IF-EXT-MIB*

  - *HUAWEI-L2IF-MIB*

  - *HUAWEI-POE-MIB*

  - *HUAWEI-ENTITY-EXTENT-MIB*

  - Inherited Classes' MIBs

  See SNMP::Info::Layer3 for its own MIB requirements.

  See 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"`, '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

- $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*.
