Files

31 lines
813 B
PHP
Raw Permalink Normal View History

2008-03-12 17:12:17 +00:00
<?php
use LibreNMS\Config;
if (Config::get('enable_inventory')) {
// Legacy entPhysical - junos/timos/cisco
include 'includes/discovery/entity-physical/entity-physical.inc.php';
2008-03-12 17:12:17 +00: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
// 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
}
}
unset(
$sql,
$test,
$valid
);
} else {
2015-07-13 20:10:26 +02:00
echo 'Disabled!';
}//end if