diff --git a/includes/definitions/discovery/vrp.yaml b/includes/definitions/discovery/vrp.yaml index e490d27ca5..e2ccf75fdd 100644 --- a/includes/definitions/discovery/vrp.yaml +++ b/includes/definitions/discovery/vrp.yaml @@ -21,6 +21,7 @@ modules: data: - oid: - entPhysicalName + - hwEntityAdminStatus - hwStackPortTable temperature: data: @@ -63,6 +64,10 @@ modules: oid: hwEntityOpticalRxPower op: '<=' value: 0 + - + oid: hwEntityAdminStatus + op: '=' + value: 12 - oid: hwOpticalModuleInfoTable value: hwEntityOpticalTxPower @@ -78,6 +83,10 @@ modules: oid: hwEntityOpticalTxPower op: '<=' value: 0 + - + oid: hwEntityAdminStatus + op: '=' + value: 12 - oid: hwOpticalModuleInfoTable value: hwEntityOpticalLaneRxPower @@ -88,11 +97,17 @@ modules: index: 'lane-rx-{{ $index }}' divisor: 100 group: '{{ $entPhysicalName }}' + high_limit: hwEntityOpticalRxHighThreshold + low_limit: hwEntityOpticalRxLowThreshold skip_values: - oid: hwEntityOpticalRxPower op: '>' value: 0 + - + oid: hwEntityAdminStatus + op: '=' + value: 12 - oid: hwOpticalModuleInfoTable value: hwEntityOpticalLaneTxPower @@ -102,11 +117,17 @@ modules: entPhysicalIndex_measured: ports index: 'lane-tx-{{ $index }}' group: '{{ $entPhysicalName }}' + high_limit: hwEntityOpticalTxHighThreshold + low_limit: hwEntityOpticalTxLowThreshold skip_values: - oid: hwEntityOpticalTxPower op: '>' value: 0 + - + oid: hwEntityAdminStatus + op: '=' + value: 12 divisor: 100 voltage: data: diff --git a/includes/discovery/entity-physical/entity-physical.inc.php b/includes/discovery/entity-physical/entity-physical.inc.php index 53d7243d46..2c68108d5c 100644 --- a/includes/discovery/entity-physical/entity-physical.inc.php +++ b/includes/discovery/entity-physical/entity-physical.inc.php @@ -117,6 +117,7 @@ if ($device['os'] == 'saf-cfm') { } foreach ($entity_array as $entPhysicalIndex => $entry) { + unset($ifIndex); if ($device['os'] == 'junos') { // Juniper's MIB doesn't have the same objects as the Entity MIB, so some values // are made up here. @@ -190,6 +191,12 @@ foreach ($entity_array as $entPhysicalIndex => $entry) { $entPhysicalIsFRU = $entry['entPhysicalIsFRU']; $entPhysicalAlias = $entry['entPhysicalAlias']; $entPhysicalAssetID = $entry['entPhysicalAssetID']; + + //VRP devices seems to use LogicalEntity '1' instead of '0' like the default code checks. + //Standard code is still run after anyway. + if (isset($entry['1']['entAliasMappingIdentifier'])) { + $ifIndex = preg_replace('/ifIndex\.(\d+).*/', '$1', $entry['1']['entAliasMappingIdentifier']); + } } else { $entPhysicalDescr = array_key_exists('entPhysicalDescr', $entry) ? $entry['entPhysicalDescr'] : ''; $entPhysicalContainedIn = array_key_exists('entPhysicalContainedIn', $entry) ? $entry['entPhysicalContainedIn'] : ''; @@ -210,14 +217,13 @@ foreach ($entity_array as $entPhysicalIndex => $entry) { if (isset($entity_array[$entPhysicalIndex]['0']['entAliasMappingIdentifier'])) { $ifIndex = $entity_array[$entPhysicalIndex]['0']['entAliasMappingIdentifier']; - } - - if (!strpos($ifIndex, 'fIndex') || $ifIndex == '') { - unset($ifIndex); - } else { - $ifIndex_array = explode('.', $ifIndex); - $ifIndex = $ifIndex_array[1]; - unset($ifIndex_array); + if (!strpos($ifIndex, 'fIndex') || $ifIndex == '') { + unset($ifIndex); + } else { + $ifIndex_array = explode('.', $ifIndex); + $ifIndex = $ifIndex_array[1]; + unset($ifIndex_array); + } } // List of real names for cisco entities diff --git a/includes/discovery/functions.inc.php b/includes/discovery/functions.inc.php index f78a112854..b5b64eb508 100644 --- a/includes/discovery/functions.inc.php +++ b/includes/discovery/functions.inc.php @@ -783,6 +783,7 @@ function discover_entity_physical(&$valid, $device, $entPhysicalIndex, $entPhysi 'entPhysicalIsFRU' => $entPhysicalIsFRU, 'entPhysicalAlias' => $entPhysicalAlias, 'entPhysicalAssetID' => $entPhysicalAssetID, + 'ifIndex' => $ifIndex, ); dbUpdate($update_data, 'entPhysical', '`device_id`=? AND `entPhysicalIndex`=?', array($device['device_id'], $entPhysicalIndex)); }//end if