mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-03 08:01:38 +02:00
ignore physical entity inventory if the hardware doesn't say what they are - HI DELL
git-svn-id: http://www.observium.org/svn/observer/trunk@657 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -40,10 +40,13 @@
|
||||
if(!strpos($ifIndex, "fIndex") || $ifIndex == "") { unset($ifIndex); }
|
||||
list(,$ifIndex) = explode(".", $ifIndex);
|
||||
|
||||
if ($entPhysicalVendorTypes[$entPhysicalVendorType] && !$entPhysicalModelName) {
|
||||
if ($entPhysicalVendorTypes[$entPhysicalVendorType] && !$entPhysicalModelName)
|
||||
{
|
||||
$entPhysicalModelName = $entPhysicalVendorTypes[$entPhysicalVendorType];
|
||||
}
|
||||
|
||||
if ($entPhysicalDescr || $entPhysicalName)
|
||||
{
|
||||
$entPhysical_id = @mysql_result(mysql_query("SELECT entPhysical_id FROM `entPhysical` WHERE device_id = '".$device['device_id']."' AND entPhysicalIndex = '$entPhysicalIndex'"),0);
|
||||
|
||||
if($entPhysical_id) {
|
||||
@@ -64,15 +67,14 @@
|
||||
echo("+");
|
||||
}
|
||||
|
||||
if($entPhysicalClass == "sensor") {
|
||||
|
||||
if($entPhysicalClass == "sensor")
|
||||
{
|
||||
$entSensorType = $entry['entSensorType'];
|
||||
$entSensorScale = $entry['entSensorScale'];
|
||||
$entSensorPrecision = $entry['entSensorPrecision'];
|
||||
$entSensorValueUpdateRate = $entry['entSensorValueUpdateRate'];
|
||||
$entSensorMeasuredEntity = $entry['entSensorMeasuredEntity'];
|
||||
|
||||
|
||||
if($config['allow_entity_sensor'][$entSensorType]) {
|
||||
$sql = "UPDATE `entPhysical` SET entSensorType = '$entSensorType', entSensorScale = '$entSensorScale', entSensorPrecision = '$entSensorPrecision', ";
|
||||
$sql .= " entSensorMeasuredEntity = '$entSensorMeasuredEntity'";
|
||||
@@ -82,11 +84,11 @@
|
||||
$sql = "UPDATE `entPhysical` SET entSensorType = '', entSensorScale = '', entSensorPrecision = '', entSensorMeasuredEntity = ''";
|
||||
$sql .= " WHERE device_id = '".$device['device_id']."' AND entPhysicalIndex = '$entPhysicalIndex'";
|
||||
}
|
||||
# echo("$sql\n");
|
||||
mysql_query($sql);
|
||||
}
|
||||
$valid[$entPhysicalIndex] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
} else { echo("Disabled!"); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user