Files
librenms-librenms/includes/discovery/entity-physical.inc.php

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
907 B
PHP
Raw Normal View History

<?php
use LibreNMS\Config;
if (Config::get('enable_inventory')) {
// Legacy entPhysical - junos/timos/cisco
include 'includes/discovery/entity-physical/entity-physical.inc.php';
if (file_exists(Config::get('install_dir') . "/includes/discovery/entity-physical/{$device['os']}.inc.php")) {
include Config::get('install_dir') . "/includes/discovery/entity-physical/{$device['os']}.inc.php";
}
// Delete any entries that have not been accounted for.
$sql = 'SELECT * FROM `entPhysical` WHERE `device_id` = ?';
foreach (dbFetchRows($sql, [$device['device_id']]) as $test) {
$id = $test['entPhysicalIndex'];
if (! $valid[$id]) {
echo '-';
dbDelete('entPhysical', 'entPhysical_id = ?', [$test['entPhysical_id']]);
2015-04-17 14:59:47 -04:00
}
}
unset(
$sql,
$test,
$valid
);
} else {
2015-04-17 14:59:47 -04:00
echo 'Disabled!';
2015-07-13 20:10:26 +02:00
}//end if