2008-03-12 17:12:17 +00:00
|
|
|
<?php
|
|
|
|
|
2017-09-11 15:26:41 -05:00
|
|
|
use LibreNMS\Config;
|
|
|
|
|
|
|
|
if (Config::get('enable_inventory')) {
|
2016-10-06 10:40:37 +10:00
|
|
|
// Legacy entPhysical - junos/timos/cisco
|
|
|
|
include 'includes/discovery/entity-physical/entity-physical.inc.php';
|
2008-03-12 17:12:17 +00:00
|
|
|
|
2016-10-06 10:40:37 +10:00
|
|
|
// Cisco CIMC
|
|
|
|
if ($device['os'] == 'cimc') {
|
|
|
|
include 'includes/discovery/entity-physical/cimc.inc.php';
|
2009-05-06 16:50:51 +00:00
|
|
|
}
|
2008-03-12 17:12:17 +00:00
|
|
|
|
2016-10-06 10:40:37 +10:00
|
|
|
// Delete any entries that have not bee accounted for.
|
|
|
|
$sql = 'SELECT * FROM `entPhysical` WHERE `device_id` = ?';
|
|
|
|
foreach (dbFetchRows($sql, array($device['device_id'])) as $test) {
|
|
|
|
$id = $test['entPhysicalIndex'];
|
|
|
|
if (!$valid[$id]) {
|
|
|
|
echo '-';
|
|
|
|
dbDelete('entPhysical', 'entPhysical_id = ?', array ($test['entPhysical_id']));
|
2015-07-13 20:10:26 +02:00
|
|
|
}
|
2016-10-06 10:40:37 +10:00
|
|
|
}
|
2017-02-08 04:54:30 +00:00
|
|
|
unset(
|
|
|
|
$sql,
|
|
|
|
$test,
|
|
|
|
$valid
|
|
|
|
);
|
2016-08-28 12:32:58 -05:00
|
|
|
} else {
|
2015-07-13 20:10:26 +02:00
|
|
|
echo 'Disabled!';
|
|
|
|
}//end if
|