librenms/includes/discovery/entity-physical.inc.php
Neil Lathwood 21898a3c29 Disco / Poller tidy up + Added display of module mem usage (#5778)
* tidyup + added mem usage for poller modules

* tidied up discovery modules

* fix sensors
2017-02-07 22:54:30 -06:00

29 lines
787 B
PHP

<?php
if ($config['enable_inventory']) {
// Legacy entPhysical - junos/timos/cisco
include 'includes/discovery/entity-physical/entity-physical.inc.php';
// Cisco CIMC
if ($device['os'] == 'cimc') {
include 'includes/discovery/entity-physical/cimc.inc.php';
}
// 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']));
}
}
unset(
$sql,
$test,
$valid
);
} else {
echo 'Disabled!';
}//end if