Huawei Gpon ports oid for traf graphs is wrong

Good day.

I have 3 models of this stations:

“1.3.6.1.4.1.2011.2.248”=>“Huawei MA5600T”
“1.3.6.1.4.1.2011.2.80.8”=>“Huawei MA5600T”
“1.3.6.1.4.1.2011.2.133”=>“Huawei MA5683T”

when I added the device to Librenms, I found that traffic data for gpon ports is not drawn. during the investigation, it was found that the polling of data for these graphs occurs from standard points - ifHCInOctets & ifHCOutOctets, while for these devices the data pick-up points for these graphs are different:

HUAWEI-XPON-MIB::hwGponOltEthernetStatisticReceivedBytes 1.3.6.1.4.1.2011.6.128.1.1.4.21.1.15
HUAWEI-XPON-MIB::hwGponOltEthernetStatisticSendBytes 1.3.6.1.4.1.2011.6.128.1.1.4.21.1.30

This is not really help. I just reported that librenms incorrectly takes traffic data from these devices.

Solution:

create includes/polling/ports/os/smartax.inc.php with this code:

<?php

$inoctets = snmpwalk_cache_oid($device, '.1.3.6.1.4.1.2011.6.128.1.1.4.21.1.15', array());
$outoctets = snmpwalk_cache_oid($device, '.1.3.6.1.4.1.2011.6.128.1.1.4.21.1.30', array());

foreach ($inoctets as $index => $value) {
    $index=preg_replace("/^(.*?)\.([0-9]+)$/","$2",$index);
    $port_stats[$index]['ifHCInOctets'] = $value['enterprises'];
}
foreach ($outoctets as $index => $value) {
    $index=preg_replace("/^(.*?)\.([0-9]+)$/","$2",$index);
    $port_stats[$index]['ifHCOutOctets'] = $value['enterprises'];
}

unset($inoctets);
unset($outoctets);

if the code is not completely correct or clumsy - it can be fixed :slight_smile: