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:
Tom Laermans
2010-01-10 16:03:48 +00:00
parent 9bc33b69f5
commit d6cff48859
+7 -5
View File
@@ -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!"); }