示例#1
0
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
echo " GEIST-MIB-V3 ";
$productTitle = snmp_get($device, 'productTitle.0', '-OQv', 'GEIST-MIB-V3', mib_dirs('geist'));
if ($productTitle) {
    // Insert chassis as index 1, everything hangs off of this.
    $system_index = 1;
    $inventory[$system_index] = array('entPhysicalDescr' => $productTitle, 'entPhysicalClass' => 'chassis', 'entPhysicalName' => 'Chassis', 'entPhysicalIsFRU' => 'true', 'entPhysicalContainedIn' => 0, 'entPhysicalParentRelPos' => -1, 'entPhysicalMfgName' => 'Geist');
    discover_inventory($valid['inventory'], $device, $system_index, $inventory[$system_index], 'geist-mib-v3');
    $relPos = 1;
    // Note: sensors without example SNMP output have not been tested.
    $geist_sensors = array(array('descr' => 'Climate Monitor', 'prefix' => 'climate', 'oid' => 2, 'class' => 'sensor'), array('descr' => 'Power Monitor', 'prefix' => 'powMon', 'oid' => 3, 'class' => 'powerSupply', 'avail' => 1), array('descr' => 'Temperature Sensor', 'prefix' => 'tempSensor', 'oid' => 4, 'class' => 'sensor'), array('descr' => 'AF/HTD Sensor', 'prefix' => 'airFlowSensor', 'oid' => 5, 'class' => 'airflowSensor'), array('descr' => 'DELTA 3 Channel Controller', 'prefix' => 'ctrl3ChDELTA', 'oid' => 6, 'class' => 'sensor'), array('descr' => 'Door Sensor', 'prefix' => 'doorSensor', 'oid' => 7, 'class' => 'sensor'), array('descr' => 'Water Sensor', 'prefix' => 'waterSensor', 'oid' => 8, 'class' => 'sensor'), array('descr' => 'Current Sensor', 'prefix' => 'currentSensor', 'oid' => 9, 'class' => 'sensor'), array('descr' => 'Millivolt Sensor', 'prefix' => 'millivoltSensor', 'oid' => 10, 'class' => 'sensor'), array('descr' => '3 Channel Power Sensor', 'prefix' => 'power3ChSensor', 'oid' => 11, 'class' => 'sensor'), array('descr' => 'Outlet', 'prefix' => 'outlet', 'oid' => 12, 'class' => 'outlet'), array('descr' => 'Fan Controller Monitor', 'prefix' => 'vsfc', 'oid' => 13, 'class' => 'sensor'), array('descr' => '3 Channel Power Monitor', 'prefix' => 'ctrl3Ch', 'oid' => 14, 'class' => 'sensor'), array('descr' => 'Amperage Controller', 'prefix' => 'analogSensor', 'oid' => 15, 'class' => 'powerSupply'), array('descr' => 'Controlled outlet', 'prefix' => 'ctrlOutlet', 'oid' => 16, 'class' => 'outlet', 'avail' => 1), array('descr' => 'Dew Point Sensor', 'prefix' => 'dewpointSensor', 'oid' => 17, 'class' => 'sensor'), array('descr' => 'Digital Sensor', 'prefix' => 'digitalSensor', 'oid' => 18, 'class' => 'sensor'), array('descr' => 'DSTS Controller Sensor', 'prefix' => 'dstsSensor', 'oid' => 19, 'class' => 'sensor'), array('descr' => 'City Power Sensor', 'prefix' => 'cpmSensor', 'oid' => 20, 'class' => 'sensor'), array('descr' => 'Smoke Alarm Sensor', 'prefix' => 'smokeAlarm', 'oid' => 21, 'class' => 'sensor'), array('descr' => '-48VDC Sensor', 'prefix' => 'neg48VdcSensor', 'oid' => 22, 'class' => 'sensor'), array('descr' => '+30VDC Sensor', 'prefix' => 'pos30VdcSensor', 'oid' => 23, 'class' => 'sensor'), array('descr' => 'Analog Sensor', 'prefix' => 'analogSensor', 'oid' => 24, 'class' => 'sensor'), array('descr' => '3 Channel IEC Power Monitor', 'prefix' => 'ctrl3ChIEC', 'oid' => 25, 'class' => 'powerSupply'), array('descr' => 'Climate Relay Monitor', 'prefix' => 'climateRelay', 'oid' => 26, 'class' => 'sensor'), array('descr' => 'Controlled Relay', 'prefix' => 'ctrlRelay', 'oid' => 27, 'class' => 'relay', 'avail' => 1), array('descr' => 'Airspeed Switch Sensor', 'prefix' => 'airSpeedSwitchSensor', 'oid' => 28, 'class' => 'sensor'), array('descr' => 'DM16/48 Current Sensor', 'prefix' => 'powerDM', 'oid' => 29, 'class' => 'sensor'), array('descr' => 'I/O Expander', 'prefix' => 'ioExpander', 'oid' => 30, 'class' => 'sensor'), array('descr' => 'T3HD Sensor', 'prefix' => 't3hdSensor', 'oid' => 31, 'class' => 'sensor'), array('descr' => 'THD Sensor', 'prefix' => 'thdSensor', 'oid' => 32, 'class' => 'sensor'), array('descr' => '+60VDC Sensor', 'prefix' => 'pos60VdcSensor', 'oid' => 33, 'class' => 'sensor'), array('descr' => '3Phase Outlet Control', 'prefix' => 'ctrl2CirTot', 'oid' => 34, 'class' => 'outlet'), array('descr' => 'SC10 Sensor', 'prefix' => 'sc10Sensor', 'oid' => 35, 'class' => 'sensor'));
    foreach ($geist_sensors as $sensor) {
        $cache['geist'][$sensor['prefix'] . 'Table'] = snmpwalk_cache_multi_oid($device, $sensor['prefix'] . 'Table', array(), "GEIST-MIB-V3", mib_dirs('geist'));
        foreach ($cache['geist'][$sensor['prefix'] . 'Table'] as $index => $entry) {
            // Index can only be int in the database, so we create our own from, this sensor is at 21239.2.$oid.
            $system_index = $sensor['oid'] * 256 + $index;
            if ($sensor['avail'] || $entry[$sensor['prefix'] . 'Avail']) {
                $inventory[$system_index] = array('entPhysicalDescr' => $sensor['descr'], 'entPhysicalClass' => $sensor['class'], 'entPhysicalName' => $entry[$sensor['prefix'] . 'Name'], 'entPhysicalSerialNum' => $entry[$sensor['prefix'] . 'Serial'], 'entPhysicalIsFRU' => 'true', 'entPhysicalContainedIn' => 1, 'entPhysicalParentRelPos' => $relPos, 'entPhysicalMfgName' => 'Geist');
                discover_inventory($valid['inventory'], $device, $system_index, $inventory[$system_index], 'geist-mib-v3');
                $relPos++;
            }
        }
    }
}
unset($geist_sensors);
// EOF
示例#2
0
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
$mtxrSerialNumber = snmp_get($device, 'mtxrSerialNumber.0', '-Oqvn', 'MIKROTIK-MIB');
$system_index = 1;
if ($mtxrSerialNumber) {
    $inventory[$system_index] = array('entPhysicalDescr' => 'MikroTik RouterBoard', 'entPhysicalClass' => 'chassis', 'entPhysicalName' => '', 'entPhysicalSerialNum' => $mtxrSerialNumber, 'entPhysicalAssetID' => '', 'entPhysicalIsFRU' => 'false', 'entPhysicalContainedIn' => 0, 'entPhysicalParentRelPos' => 0, 'entPhysicalMfgName' => 'MikroTik');
    discover_inventory($valid['inventory'], $device, $system_index, $inventory[$system_index], "MIKROTIK-MIB");
    if (OBS_DEBUG > 1 && count($inventory)) {
        print_vars($inventory);
    }
}
// EOF
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
if (!isset($cache_discovery['timetra-chassis-mib'])) {
    $cache_discovery['timetra-chassis-mib'] = snmpwalk_cache_twopart_oid($device, 'tmnxHwTable', NULL, 'TIMETRA-CHASSIS-MIB');
}
foreach ($cache_discovery['timetra-chassis-mib'] as $chassis => $entries) {
    foreach ($entries as $index => $entry) {
        $inventory[$index] = array('entPhysicalDescr' => $entry['tmnxHwName'], 'entPhysicalClass' => $entry['tmnxHwClass'], 'entPhysicalName' => $entry['tmnxHwName'], 'entPhysicalAlias' => $entry['tmnxHwAlias'], 'entPhysicalAssetID' => $entry['tmnxHwAssetID'], 'entPhysicalIsFRU' => $entry['tmnxHwIsFRU'], 'entPhysicalSerialNum' => $entry['tmnxHwSerialNumber'], 'entPhysicalContainedIn' => $entry['tmnxHwContainedIn'], 'entPhysicalParentRelPos' => $entry['tmnxHwParentRelPos'], 'entPhysicalMfgName' => $entry['tmnxHwMfgString']);
        if ($entry['tmnxHwContainedIn'] === '0' && $entry['tmnxHwParentRelPos'] == '-1') {
            $inventory[$index]['entPhysicalName'] .= ' ' . $chassis;
        }
        discover_inventory($valid['inventory'], $device, $index, $inventory[$index], 'timetra-chassis-mib');
    }
}
// EOF
<?php

echo " E7-Calix-MIB ";
// This device not have self Indexes.
// Use workaround ($base_vendor_index * 100000) + ($e7CardBank * 1000) + $e7CardIndex
$base_vendor_index = 6321;
$inventory_mib = 'e7-calix';
// System
$e7SystemId = snmp_get($device, 'e7SystemId.0', '-OQUs', 'E7-Calix-MIB', mib_dirs('calix'));
if ($e7SystemId) {
    $e7SystemChassisSerialNumber = snmp_get($device, '.1.3.6.1.4.1.6321.1.2.2.2.1.7.10.0', '-Oqvn');
    $system_index = $base_vendor_index * 100000;
    $inventory[$system_index] = array('entPhysicalDescr' => 'Calix Networks, E7 Ethernet Service Access Platform', 'entPhysicalClass' => 'chassis', 'entPhysicalName' => 'E7 ESAP', 'entPhysicalSerialNum' => $e7SystemChassisSerialNumber, 'entPhysicalAssetID' => $e7SystemId, 'entPhysicalIsFRU' => 'true', 'entPhysicalContainedIn' => 0, 'entPhysicalParentRelPos' => 0, 'entPhysicalMfgName' => 'Calix');
    discover_inventory($valid['inventory'], $device, $system_index, $inventory[$system_index], $inventory_mib);
    // Cards
    $E7CardEntry = snmpwalk_cache_twopart_oid($device, 'E7CardEntry', array(), 'E7-Calix-MIB', mib_dirs('calix'));
    foreach ($E7CardEntry as $e7CardBank => $entries) {
        $bank_index = $system_index + $e7CardBank * 1000;
        $inventory[$bank_index] = array('entPhysicalDescr' => 'E7 ESAP Bank', 'entPhysicalClass' => 'container', 'entPhysicalName' => 'Bank ' . $e7CardBank, 'entPhysicalIsFRU' => 'false', 'entPhysicalContainedIn' => $system_index, 'entPhysicalParentRelPos' => $e7CardBank, 'entPhysicalMfgName' => 'Calix');
        discover_inventory($valid['inventory'], $device, $bank_index, $inventory[$bank_index], $inventory_mib);
        foreach ($entries as $e7CardIndex => $entry) {
            $card_index = $bank_index + $e7CardIndex;
            $inventory[$card_index] = array('entPhysicalDescr' => 'E7 ESAP Card', 'entPhysicalClass' => 'other', 'entPhysicalName' => 'Card ' . ucfirst($entry['e7CardActualType']), 'entPhysicalVendorType' => $entry['e7CardActualType'], 'entPhysicalSerialNum' => $entry['e7CardSerialNumber'], 'entPhysicalSoftwareRev' => $entry['e7CardSoftwareVersion'], 'entPhysicalIsFRU' => 'false', 'entPhysicalContainedIn' => $bank_index, 'entPhysicalParentRelPos' => $e7CardIndex, 'entPhysicalMfgName' => 'Calix');
            discover_inventory($valid['inventory'], $device, $card_index, $inventory[$card_index], $inventory_mib);
        }
    }
    if ($debug && count($inventory)) {
        print_vars($inventory);
    }
}
// EOF
<?php

echo " FOUNDRY-SN-AGENT-MIB ";
$snChasProductType = snmp_get($device, 'snChasProductType.0', '-OQv', 'FOUNDRY-SN-AGENT-MIB', mib_dirs('foundry'));
if ($snChasProductType) {
    $snChasSerNum = snmp_get($device, 'snChasSerNum.0', '-OQv', 'FOUNDRY-SN-AGENT-MIB', mib_dirs('foundry'));
    // Insert chassis as index 1, everything hangs off of this.
    $system_index = 1;
    $inventory[$system_index] = array('entPhysicalDescr' => $snChasProductType, 'entPhysicalClass' => 'chassis', 'entPhysicalName' => 'Chassis', 'entPhysicalSerialNum' => $snChasSerNum, 'entPhysicalIsFRU' => 'true', 'entPhysicalContainedIn' => 0, 'entPhysicalParentRelPos' => -1, 'entPhysicalMfgName' => 'Brocade');
    discover_inventory($valid['inventory'], $device, $system_index, $inventory[$system_index], 'foundry-sn-agent-mib');
    // Now fetch data for the rest of the hardware in the chassis
    $data = snmpwalk_cache_oid($device, 'snAgentBrdTable', array(), 'FOUNDRY-SN-AGENT-MIB', mib_dirs('foundry'));
    $relPos = 0;
    foreach ($data as $part) {
        $system_index = $part['snAgentBrdIndex'] * 256;
        if ($system_index != 0) {
            $containedIn = 1;
            // Attach to chassis inserted above
            // snAgentBrdModuleStatus.6 = moduleRunning
            // snAgentBrdModuleStatus.7 = moduleEmpty
            if ($part['snAgentBrdModuleStatus'] != 'moduleEmpty') {
                $relPos++;
                $inventory[$system_index] = array('entPhysicalDescr' => $part['snAgentBrdMainBrdDescription'], 'entPhysicalClass' => 'module', 'entPhysicalName' => $part['snAgentBrdMainBrdDescription'], 'entPhysicalSerialNum' => $part['snAgentBrdSerialNumber'], 'entPhysicalIsFRU' => 'true', 'entPhysicalContainedIn' => $containedIn, 'entPhysicalParentRelPos' => $relPos, 'entPhysicalMfgName' => 'Brocade');
                discover_inventory($valid['inventory'], $device, $system_index, $inventory[$system_index], 'foundry-sn-agent-mib');
            }
        }
    }
}
// EOF
示例#6
0
    }
}
$entity_array = snmpwalk_cache_oid($device, "entPhysicalEntry", array(), $mibs, $mib_dirs);
if ($GLOBALS['snmp_status']) {
    $entity_array = snmpwalk_cache_twopart_oid($device, "entAliasMappingIdentifier", $entity_array, 'ENTITY-MIB:IF-MIB');
    $GLOBALS['cache']['entity-mib'] = $entity_array;
    // Cache this array for sensors discovery (see in cisco-entity-sensor-mib or entity-sensor-mib)
    foreach ($entity_array as $entPhysicalIndex => $entry) {
        if ($device['os'] == "hpuww") {
            if ($entPhysicalIndex == 1) {
                $entry['entPhysicalContainedIn'] = 0;
            }
        }
        if (isset($entity_array[$entPhysicalIndex]['0']['entAliasMappingIdentifier'])) {
            $ifIndex = $entity_array[$entPhysicalIndex]['0']['entAliasMappingIdentifier'];
            if (!strpos($ifIndex, "fIndex") || $ifIndex == '') {
                unset($ifIndex);
            } else {
                list(, $ifIndex) = explode(".", $ifIndex);
                $entry['ifIndex'] = $ifIndex;
            }
        }
        if (isset($config['rewrites']['entPhysicalVendorTypes'][$entry['entPhysicalVendorType']]) && !$entry['entPhysicalModelName']) {
            $entry['entPhysicalModelName'] = $config['rewrites']['entPhysicalVendorTypes'][$entry['entPhysicalVendorType']];
        }
        if ($entry['entPhysicalDescr'] || $entry['entPhysicalName']) {
            discover_inventory($valid['inventory'], $device, $entPhysicalIndex, $entry);
        }
    }
}
// EOF
                if ($type == 'temp') {
                    $pos++;
                    $temp_container = $index;
                    $inventory[$index] = array('entPhysicalName' => 'Blade Slot ' . $slot . ' Temp Container', 'entPhysicalDescr' => $device['hostname'] . ' - Chassis Slot ' . $slot . ' Temp Container', 'entPhysicalClass' => 'container', 'entPhysicalIsFRU' => 'false', 'entPhysicalContainedIn' => $slot_container, 'entPhysicalParentRelPos' => $pos, 'entPhysicalMfgName' => 'F5');
                    discover_inventory($valid['inventory'], $device, $index, $inventory[$index], 'f5-bigip-system-mib');
                    foreach ($entry as $temp_index => $temp_sensor) {
                        $index++;
                        $inventory[$index] = array('entPhysicalName' => $temp_sensor['sysBladeTempLocation'], 'entPhysicalDescr' => $device['hostname'] . ' - ' . $temp_sensor['sysBladeTempLocation'], 'entPhysicalClass' => 'sensor', 'entPhysicalIsFRU' => 'false', 'entPhysicalContainedIn' => $temp_container, 'entPhysicalParentRelPos' => $temp_index, 'entPhysicalMfgName' => 'F5');
                        discover_inventory($valid['inventory'], $device, $index, $inventory[$index], 'f5-bigip-system-mib');
                    }
                } else {
                    if ($type == 'voltage') {
                        $pos++;
                        $voltage_container = $index;
                        $inventory[$index] = array('entPhysicalName' => 'Blade Slot ' . $slot . ' Voltage Container', 'entPhysicalDescr' => $device['hostname'] . ' - Chassis Slot ' . $slot . ' Voltage Container', 'entPhysicalClass' => 'container', 'entPhysicalIsFRU' => 'false', 'entPhysicalContainedIn' => $slot_container, 'entPhysicalParentRelPos' => $pos, 'entPhysicalMfgName' => 'F5');
                        discover_inventory($valid['inventory'], $device, $index, $inventory[$index], 'f5-bigip-system-mib');
                        $volt_pos = 0;
                        foreach ($entry as $volt_index => $volt_sensor) {
                            $index++;
                            $volt_pos++;
                            $inventory[$index] = array('entPhysicalName' => $volt_index, 'entPhysicalDescr' => $device['hostname'] . ' - ' . $volt_index, 'entPhysicalClass' => 'sensor', 'entPhysicalIsFRU' => 'false', 'entPhysicalContainedIn' => $voltage_container, 'entPhysicalParentRelPos' => $volt_pos, 'entPhysicalMfgName' => 'F5');
                            discover_inventory($valid['inventory'], $device, $index, $inventory[$index], 'f5-bigip-system-mib');
                        }
                    }
                }
            }
        }
    }
}
unset($cache_ports, $slots, $name, $index, $container, $pos, $slot_container, $cpu_container, $temp_container, $voltage_container);
// EOF
示例#8
0
    $inventory[$system_index] = array('entPhysicalDescr' => $jnxBoxDescr, 'entPhysicalClass' => 'chassis', 'entPhysicalName' => 'Chassis', 'entPhysicalSerialNum' => $jnxBoxSerialNo, 'entPhysicalIsFRU' => 'true', 'entPhysicalContainedIn' => 0, 'entPhysicalParentRelPos' => -1, 'entPhysicalMfgName' => 'Juniper');
    discover_inventory($valid['inventory'], $device, $system_index, $inventory[$system_index], 'juniper-mib');
    // Now fetch data for the rest of the hardware in the chassis
    $data = snmpwalk_cache_oid($device, 'jnxContentsTable', array(), 'JUNIPER-MIB');
    $data = snmpwalk_cache_oid($device, 'jnxFruTable', $data, 'JUNIPER-MIB');
    $global_relPos = 0;
    foreach ($data as $part) {
        // Index can only be int in the database, so we create our own from 7.1.1.0:
        $system_index = $part['jnxContentsContainerIndex'] * 16777216 + $part['jnxContentsL1Index'] * 65536 + $part['jnxContentsL2Index'] * 256 + $part['jnxContentsL3Index'];
        if ($system_index != 0) {
            if ($part['jnxContentsL2Index'] == 0 && $part['jnxContentsL3Index'] == 0) {
                $containedIn = 1;
                // Attach to chassis inserted above
                $global_relPos++;
                $relPos = $global_relPos;
            } else {
                $containerIndex = $part['jnxContentsContainerIndex'];
                if ($containerIndex == 8) {
                    $containerIndex--;
                }
                // Convert PIC (8) to FPC (7) parent
                $containedIn = $containerIndex * 16777216 + $part['jnxContentsL1Index'] * 65536;
                $relPos = $part['jnxContentsL2Index'];
            }
            // [jnxFruTemp] => 45 - Could link to sensor somehow? (like we do for ENTITY-SENSOR-MIB)
            $inventory[$system_index] = array('entPhysicalDescr' => ucfirst($part['jnxContentsDescr']), 'entPhysicalHardwareRev' => $part['jnxContentsRevision'], 'entPhysicalClass' => isset($part['jnxFruType']) ? $part['jnxFruType'] : 'chassis', 'entPhysicalName' => ucfirst($part['jnxFruName'] ? $part['jnxFruName'] : $part['jnxContentsDescr']), 'entPhysicalSerialNum' => $part['jnxContentsSerialNo'] == "BUILTIN" ? '' : str_replace('S/N ', '', $part['jnxContentsSerialNo']), 'entPhysicalIsFRU' => isset($part['jnxFruType']) ? 'true' : 'false', 'entPhysicalContainedIn' => $containedIn, 'entPhysicalParentRelPos' => $relPos, 'entPhysicalMfgName' => 'Juniper');
            discover_inventory($valid['inventory'], $device, $system_index, $inventory[$system_index], 'juniper-mib');
        }
    }
}
// EOF
示例#9
0
// Only run this mib for chassis systems
// DELL-RAC-MIB::drsProductType.0 = INTEGER: cmc(8)
$type = snmp_get($device, "drsProductType.0", "-Oqv", "DELL-RAC-MIB");
if (strstr($type, "cmc") || strstr($type, "CMC")) {
    if (!isset($cache_discovery['dell-rac-mib'])) {
        $cache_discovery['dell-rac-mib'] = snmpwalk_cache_oid($device, 'drsChassisServerGroup', NULL, 'DELL-RAC-MIB');
    }
    $index = 1;
    $inventory[$index] = array('entPhysicalName' => $device['hardware'] . ' Chassis', 'entPhysicalDescr' => $device['hostname'], 'entPhysicalClass' => 'chassis', 'entPhysicalIsFRU' => 'true', 'entPhysicalModelName' => $device['hardware'], 'entPhysicalSerialNum' => $device['serial'], 'entPhysicalHardwareRev' => snmp_get($device, "drsProductVersion.0", "-Oqv", "DELL-RAC-MIB"), 'entPhysicalFirmwareRev' => $device['version'], 'entPhysicalAssetID' => $device['asset_tag'], 'entPhysicalContainedIn' => 0, 'entPhysicalParentRelPos' => -1, 'entPhysicalMfgName' => 'Dell');
    discover_inventory($valid['inventory'], $device, $index, $inventory[$index], 'dell-rac-mib');
    foreach ($cache_discovery['dell-rac-mib'] as $tmp => $entry) {
        if ($entry['drsServerSlotNumber'] === "N/A") {
            continue;
        }
        $index += 2;
        // Full height blades take up two slots and are marked as Extension
        if (!strstr($entry[drsServerSlotName], "Extension")) {
            $serial = $entry['drsServerServiceTag'];
            $inventory[$index] = array('entPhysicalName' => 'Slot ' . $entry['drsServerSlotNumber'], 'entPhysicalClass' => 'container', 'entPhysicalIsFRU' => 'true', 'entPhysicalContainedIn' => 1, 'entPhysicalParentRelPos' => $entry['drsServerSlotNumber'], 'entPhysicalMfgName' => 'Dell');
            $inventory[$index + 1] = array('entPhysicalName' => $entry['drsServerSlotName'], 'entPhysicalDescr' => $entry['drsServerSlotName'], 'entPhysicalClass' => 'module', 'entPhysicalIsFRU' => 'true', 'entPhysicalModelName' => $entry['drsServerModel'], 'entPhysicalSerialNum' => $serial, 'entPhysicalContainedIn' => $index, 'entPhysicalParentRelPos' => 1, 'entPhysicalMfgName' => 'Dell');
            discover_inventory($valid['inventory'], $device, $index, $inventory[$index], 'dell-rac-mib');
            discover_inventory($valid['inventory'], $device, $index + 1, $inventory[$index + 1], 'dell-rac-mib');
            unset($serial);
        } else {
            $i = $index - 2;
            $inventory[$i]['entPhysicalName'] = $inventory[$i]['entPhysicalName'] . '+' . $entry['drsServerSlotNumber'];
            discover_inventory($valid['inventory'], $device, $i, $inventory[$i], 'dell-rac-mib');
        }
    }
}
// EOF
<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage discovery
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
if (!isset($cache_discovery['oneaccess-sys-mib'])) {
    $cache_discovery['oneaccess-sys-mib'] = snmpwalk_cache_oid($device, 'oacExpIMSysHwComponentsTable', array(), 'ONEACCESS-SYS-MIB');
}
foreach ($cache_discovery['oneaccess-sys-mib'] as $index => $entry) {
    //print_r($entry);
    $index = (int) $entry['oacExpIMSysHwcIndex'] + 1;
    $inventory[$index] = array('entPhysicalDescr' => $entry['oacExpIMSysHwcDescription'], 'entPhysicalName' => $entry['oacExpIMSysHwcProductName'], 'entPhysicalClass' => $entry['oacExpIMSysHwcClass'], 'entPhysicalModelName' => $entry['oacExpIMSysHwcType'], 'entPhysicalSerialNum' => $entry['oacExpIMSysHwcSerialNumber'], 'entPhysicalIsFRU' => 'false', 'entPhysicalMfgName' => 'OneAccess', 'entPhysicalContainedIn' => $entry['oacExpIMSysHwcIndex'] == 0 ? 0 : 1, 'entPhysicalParentRelPos' => $entry['oacExpIMSysHwcIndex'] == 0 ? -1 : (int) $entry['oacExpIMSysHwcIndex']);
    discover_inventory($valid['inventory'], $device, $index, $inventory[$index], 'oneaccess-sys-mib');
}
// EOF