OcNOS Add AS7712-32X port mapping (#16332)

Fix walking ifName multiple times
Add EdgeCore test data
This commit is contained in:
Tony Murray 2024-09-02 11:43:34 -05:00 committed by GitHub
parent 58ccccce29
commit b096ff86fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 65045 additions and 2 deletions

View File

@ -17,7 +17,7 @@ class Ocnos extends OS implements EntityPhysicalDiscovery
$inventory = new Collection;
$stacks = SnmpQuery::walk('IPI-CMM-CHASSIS-MIB::cmmStackUnitTable')->table(1);
SnmpQuery::walk('IPI-CMM-CHASSIS-MIB::cmmSysSwModuleTable')->table(1, $stacks);
SnmpQuery::walk('IPI-CMM-CHASSIS-MIB::cmmSysSwModuleTable')->table(1, $stacks); // software version
foreach ($stacks as $cmmStackUnitIndex => $stack) {
$inventory->push(new EntPhysical([
'entPhysicalIndex' => $cmmStackUnitIndex,
@ -173,6 +173,7 @@ class Ocnos extends OS implements EntityPhysicalDiscovery
'Ufi Space S9500-30XS-P' => $prefix . ($cmmTransType == 'qsfp' ? $cmmTransIndex - 29 : $cmmTransIndex - 1),
'Edgecore 7316-26XB-O-48V-F' => $prefix . ($cmmTransType == 'qsfp' ? $cmmTransIndex - 1 : $cmmTransIndex - 3),
'Edgecore 5912-54X-O-AC-F' => $prefix . $cmmTransIndex,
'Edgecore 7712-32X-O-AC-F' => $prefix . $cmmTransIndex . '/1',
default => null, // no port map, so we can't guess
};
@ -181,7 +182,7 @@ class Ocnos extends OS implements EntityPhysicalDiscovery
}
// load port name to port_id map
$ifNameToIndex = array_flip(SnmpQuery::walk('IF-MIB::ifName')->pluck());
$ifNameToIndex = array_flip(SnmpQuery::cache()->walk('IF-MIB::ifName')->pluck());
return $ifNameToIndex[$portName] ?? 0;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff