Fix ifName and ifAlias being blanked by discovery (#9589)

* Fix ifName and ifAlias being blanked by discovery
on devices that have blank ifName or ifAlias

* Update test data

* work around net-snmp bug
This commit is contained in:
Tony Murray
2018-12-24 10:29:02 -06:00
committed by GitHub
parent f2ba89bc1c
commit de7ce7c757
79 changed files with 1692 additions and 1691 deletions

View File

@@ -44,8 +44,9 @@ foreach ($ports_mapped['maps']['ifIndex'] as $ifIndex => $port_id) {
foreach ($port_stats as $ifIndex => $port) {
// Store ifIndex in port entry and prefetch ifName as we'll need it multiple times
$port['ifIndex'] = $ifIndex;
$ifName = $port['ifName'];
$ifAlias = $port['ifAlias'];
// handle ifName and ifAlias the same way we do in the poller
$ifName = empty($port['ifName']) ? $port['ifDescr'] : $port['ifName'];
$ifAlias = empty($port['ifAlias']) ? $port['ifDescr'] : $port['ifAlias'];
$ifDescr = $port['ifDescr'];
$ifType = $port['ifType'];