Once I made a Zabbix template for drawing traffic graphs from GPON ports on Huawei SmartAX MA5683T.
From Linux, I looked at the interface indexes with the command:
snmpwalk -v2c -c public 192.168.0.101 ifDesc
I received the answer something in the form (where 4194336768 is the index of the GPON zero port of the board):
IF-MIB::ifDescr.4194336768 = STRING: Huawei-MA5600-V800R008-GPON_UNI
Accordingly, traffic should be read by this index, therefore, I executed the command:
snmpwalk -v2c -c public 192.168.0.101 ifInOctets.4194336768
But in the end I received the answer:
.220.127.116.11.18.104.22.168.1.13.4194336768: Unknown Object Identifier (Index out of range: 4194336768 (ifIndex))
The problem was solved by adding the -Ir key to the command:
snmpwalk -v2c -Ir -c public 192.168.0.101 ifInOctets.4194336768
In response, received what you need:
IF-MIB::ifInOctets.4194336768 = Counter32: 2686914701
The error can be solved by adding to the configuration file /etc/snmp/snmp.conf:
Or, since Zabbix has nowhere to specify additional options for SNMP requests, you can write a script:
snmpwalk -v2c -Ir -c public 192.168.0.101 ifInOctets.4194336768 | sed -e 's/.*Counter32: //g'
At the end of the command as an SED editor, I cut off the extra text so that the result was only a number.
In Zabbix, then we will change the data element, where:
Type: External Check
Type of information: Numeric (floating point)
Storing value: Delta (speed per second)
See also my article:
SNMP OID and MIB for interfaces