$entry) { unset($entAliasMappingIdentifier); foreach ([ 0, 1, 2 ] as $i) { if (isset($entity_array[$entPhysicalIndex][$i]['entAliasMappingIdentifier'])) { $entAliasMappingIdentifier = $entity_array[$entPhysicalIndex][$i]['entAliasMappingIdentifier']; break; } } if (isset($entAliasMappingIdentifier) && str_contains_array($entAliasMappingIdentifier, 'fIndex')) { list(, $ifIndex) = explode('.', $entAliasMappingIdentifier); $entry['ifIndex'] = $ifIndex; } // Some vendor specific inventory expander's if ($vendor_mib === 'ELTEX-MES-PHYSICAL-DESCRIPTION-MIB' && isset($vendor_oids[$entry['ifIndex']])) { //$entry = array_merge($entry, $vendor_oids[$entry['ifIndex']]); print_debug_vars($vendor_oids[$entry['ifIndex']]); /* [entPhysicalDescr] => string(20) "gigabitethernet1/0/2" [entPhysicalVendorType] => string(17) "cevPortDCUATMPort" [entPhysicalContainedIn] => string(8) "68424704" [entPhysicalClass] => string(4) "port" [entPhysicalParentRelPos] => string(1) "4" [entPhysicalName] => string(7) "gi1/0/2" [entPhysicalHardwareRev] => string(0) "" [entPhysicalFirmwareRev] => string(0) "" [entPhysicalSoftwareRev] => string(0) "" [entPhysicalSerialNum] => string(0) "" [entPhysicalMfgName] => string(0) "" [entPhysicalModelName] => string(0) "" [entPhysicalAlias] => string(0) "" [entPhysicalAssetID] => string(0) "" [entPhysicalIsFRU] => string(5) "false" */ /* [eltPhdTransceiverInfoConnectorType] => string(2) "sc" [eltPhdTransceiverInfoType] => string(11) "sfp-sfpplus" [eltPhdTransceiverInfoComplianceCode] => string(11) "1000BASE-LX" [eltPhdTransceiverInfoWaveLength] => string(4) "1550" [eltPhdTransceiverInfoVendorName] => string(16) "OptiCin " [eltPhdTransceiverInfoSerialNumber] => string(16) "PF4D870547 " [eltPhdTransceiverInfoFiberDiameterType] => string(6) "fiber9" [eltPhdTransceiverInfoTransferDistance] => string(4) "3000" [eltPhdTransceiverInfoDiagnostic] => string(5) "false" [eltPhdTransceiverInfoPartNumber] => string(16) "SFP-WDM5.03 " [eltPhdTransceiverInfoVendorRev] => string(4) " " */ // entPhysicalVendorType -> eltPhdTransceiverInfoType // entPhysicalHardwareRev -> eltPhdTransceiverInfoPartNumber // entPhysicalFirmwareRev -> eltPhdTransceiverInfoVendorRev // entPhysicalSoftwareRev -> ?? // entPhysicalSerialNum -> eltPhdTransceiverInfoSerialNumber // entPhysicalMfgName -> eltPhdTransceiverInfoVendorName // entPhysicalModelName -> eltPhdTransceiverInfoComplianceCode // entPhysicalAlias -> ?? // entPhysicalAssetID -> ?? $entry['entPhysicalVendorType'] = trim($vendor_oids[$entry['ifIndex']]['eltPhdTransceiverInfoType']); $entry['entPhysicalHardwareRev'] = trim($vendor_oids[$entry['ifIndex']]['eltPhdTransceiverInfoPartNumber']); $entry['entPhysicalFirmwareRev'] = trim($vendor_oids[$entry['ifIndex']]['eltPhdTransceiverInfoVendorRev']); $entry['entPhysicalSerialNum'] = trim($vendor_oids[$entry['ifIndex']]['eltPhdTransceiverInfoSerialNumber']); $entry['entPhysicalMfgName'] = trim($vendor_oids[$entry['ifIndex']]['eltPhdTransceiverInfoVendorName']); $entry['entPhysicalModelName'] = trim($vendor_oids[$entry['ifIndex']]['eltPhdTransceiverInfoComplianceCode']); } elseif (str_starts($vendor_mib, 'DGS') && $entry['entPhysicalModelName'] === 'Fiber Port' && isset($vendor_oids[$entry['entPhysicalParentRelPos']]) && is_numeric($vendor_oids[$entry['entPhysicalParentRelPos']]['swL2PortSfpInfoDateCode'])) { //$entry = array_merge($entry, $vendor_oids[$entry['ifIndex']]); print_debug_vars($vendor_oids[$entry['entPhysicalParentRelPos']]); /* [13] => array( [entPhysicalDescr] => string(29) "1000_TXGBIC_COMBO Copper Port" [entPhysicalVendorType] => string(11) "zeroDotZero" [entPhysicalContainedIn] => string(1) "2" [entPhysicalClass] => string(4) "port" [entPhysicalParentRelPos] => string(2) "21" [entPhysicalName] => string(7) "Port 21" [entPhysicalHardwareRev] => string(0) "" [entPhysicalFirmwareRev] => string(0) "" [entPhysicalSoftwareRev] => string(0) "" [entPhysicalSerialNum] => string(0) "" [entPhysicalMfgName] => string(0) "" [entPhysicalModelName] => string(11) "Copper Port" [entPhysicalAlias] => string(0) "" [entPhysicalAssetID] => string(0) "" [entPhysicalIsFRU] => string(5) "false" ) ... [37] => array( [entPhysicalDescr] => string(28) "1000_TXGBIC_COMBO Fiber Port" [entPhysicalVendorType] => string(11) "zeroDotZero" [entPhysicalContainedIn] => string(1) "2" [entPhysicalClass] => string(4) "port" [entPhysicalParentRelPos] => string(2) "21" [entPhysicalName] => string(7) "Port 21" [entPhysicalHardwareRev] => string(0) "" [entPhysicalFirmwareRev] => string(0) "" [entPhysicalSoftwareRev] => string(0) "" [entPhysicalSerialNum] => string(0) "" [entPhysicalMfgName] => string(0) "" [entPhysicalModelName] => string(10) "Fiber Port" [entPhysicalAlias] => string(0) "" [entPhysicalAssetID] => string(0) "" [entPhysicalIsFRU] => string(5) "false" ) */ /* [21] => array( [swL2PortSfpInfoPortIndex] => string(2) "21" [swL2PortSfpInfoConnectType] => string(6) "SFP LC" [swL2PortSfpInfoVendorName] => string(3) "OEM" [swL2PortSfpInfoVendorPN] => string(10) "SFP-BX-U31" [swL2PortSfpInfoVendorSN] => string(8) "F10GU046" [swL2PortSfpInfoVendorOUI] => string(6) "0:0:0." [swL2PortSfpInfoVendorRev] => string(3) "1.0" [swL2PortSfpInfoDateCode] => string(6) "090701" [swL2PortSfpInfoFiberType] => string(16) "Single Mode (SM)" [swL2PortSfpInfoBaudRate] => string(4) "1300" [swL2PortSfpInfoWavelength] => string(4) "1310" ) */ $entry['entPhysicalVendorType'] = trim($vendor_oids[$entry['entPhysicalParentRelPos']]['swL2PortSfpInfoConnectType']); $entry['entPhysicalHardwareRev'] = trim($vendor_oids[$entry['entPhysicalParentRelPos']]['swL2PortSfpInfoVendorPN']); $entry['entPhysicalFirmwareRev'] = trim($vendor_oids[$entry['entPhysicalParentRelPos']]['swL2PortSfpInfoVendorRev']); $entry['entPhysicalSerialNum'] = trim($vendor_oids[$entry['entPhysicalParentRelPos']]['swL2PortSfpInfoVendorSN']); $entry['entPhysicalMfgName'] = trim($vendor_oids[$entry['entPhysicalParentRelPos']]['swL2PortSfpInfoVendorName']); $entry['entPhysicalModelName'] = trim($vendor_oids[$entry['entPhysicalParentRelPos']]['swL2PortSfpInfoFiberType']); } elseif ($vendor_mib === 'HUAWEI-ENTITY-EXTENT-MIB' && isset($vendor_oids[$entPhysicalIndex]) && $vendor_oids[$entPhysicalIndex]['hwEntityOpticalType'] !== 'unknown') { //$entry = array_merge($entry, $vendor_oids[$entry['ifIndex']]); print_debug_vars($vendor_oids[$entPhysicalIndex]); // entPhysicalVendorType -> hwEntityOpticalType // entPhysicalHardwareRev -> ?? // entPhysicalFirmwareRev -> ?? // entPhysicalSoftwareRev -> ?? // entPhysicalSerialNum -> hwEntityOpticalVendorSn // entPhysicalMfgName -> hwEntityOpticalVenderName // entPhysicalModelName -> hwEntityOpticalVenderPn // entPhysicalAlias -> hwEntityOpticalTransType // entPhysicalAssetID -> ?? $entry['entPhysicalVendorType'] = trim($vendor_oids[$entPhysicalIndex]['hwEntityOpticalType']); //$entry['entPhysicalHardwareRev'] = trim($vendor_oids[$entPhysicalIndex]['']); //$entry['entPhysicalFirmwareRev'] = trim($vendor_oids[$entPhysicalIndex]['']); $entry['entPhysicalSerialNum'] = trim($vendor_oids[$entPhysicalIndex]['hwEntityOpticalVendorSn']); $entry['entPhysicalMfgName'] = trim($vendor_oids[$entPhysicalIndex]['hwEntityOpticalVenderName']); $entry['entPhysicalModelName'] = trim($vendor_oids[$entPhysicalIndex]['hwEntityOpticalVenderPn']); $entry['entPhysicalAlias'] = trim($vendor_oids[$entPhysicalIndex]['hwEntityOpticalTransType']); } if ($entry['entPhysicalDescr'] || $entry['entPhysicalName']) { discover_inventory($device, $entPhysicalIndex, $entry, $mib); } } // EOF