Adding more updates found by f0o

This commit is contained in:
laf
2015-03-01 12:23:31 +00:00
parent e1b460320a
commit 7f823b6d49
3 changed files with 12 additions and 2 deletions

View File

@@ -484,7 +484,6 @@ function discover_processor(&$valid, $device, $oid, $index, $type, $descr, $prec
if (dbFetchCell("SELECT COUNT(processor_id) FROM `processors` WHERE `processor_index` = ? AND `device_id` = ? AND `processor_type` = ?",array($index,$device['device_id'], $type)) == '0')
{
$insert_data = array(
'entPhysicalIndex' => $entPhysicalIndex,
'device_id' => $device['device_id'],
'processor_descr' => $descr,
'processor_index' => $index,
@@ -496,6 +495,9 @@ function discover_processor(&$valid, $device, $oid, $index, $type, $descr, $prec
if (!empty($hrDeviceIndex)) {
$insert_data['hrDeviceIndex'] = $hrDeviceIndex;
}
if( !empty($entPhysicalIndex) ) {
$insert_data['entPhysicalIndex'] = $entPhysicalIndex;
}
$inserted = dbInsert($insert_data, 'processors');
echo("+");

View File

@@ -31,7 +31,7 @@ if (is_array($hrDevices))
}
else
{
$inserted_rows = dbInsert(array('hrDeviceIndex' => mres($hrDevice['hrDeviceIndex']), 'device_id' => mres($device['device_id']), 'hrDeviceType' => mres($hrDevice['hrDeviceType']),'hrDeviceDescr' => mres($hrDevice['hrDeviceDescr']), 'hrDeviceStatus' => mres($hrDevice['hrDeviceStatus']), 'hrDeviceErrors' => mres($hrDevice['hrDeviceErrors'])), 'hrDevice');
$inserted_rows = dbInsert(array('hrDeviceIndex' => mres($hrDevice['hrDeviceIndex']), 'device_id' => mres($device['device_id']), 'hrDeviceType' => mres($hrDevice['hrDeviceType']),'hrDeviceDescr' => mres($hrDevice['hrDeviceDescr']), 'hrDeviceStatus' => mres($hrDevice['hrDeviceStatus']), 'hrDeviceErrors' => (int) mres($hrDevice['hrDeviceErrors'])), 'hrDevice');
echo("+");
if ($debug) { print_r($hrDevice); echo("$inserted_rows row inserted"); }
}

8
sql-schema/040.sql Normal file
View File

@@ -0,0 +1,8 @@
ALTER TABLE `devices` CHANGE `agent_uptime` `agent_uptime` INT( 11 ) NOT NULL DEFAULT '0';
ALTER TABLE `devices` CHANGE `type` `type` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '';
ALTER TABLE `ports` CHANGE `ifVrf` `ifVrf` INT( 11 ) NOT NULL DEFAULT '0';
ALTER TABLE `storage` CHANGE `storage_free` `storage_free` BIGINT( 20 ) NOT NULL DEFAULT '0';
ALTER TABLE `storage` CHANGE `storage_used` `storage_used` BIGINT( 20 ) NOT NULL DEFAULT '0';
ALTER TABLE `storage` CHANGE `storage_perc` `storage_perc` INT NOT NULL DEFAULT '0';
ALTER TABLE `processors` CHANGE `entPhysicalIndex` `entPhysicalIndex` INT( 11 ) NOT NULL DEFAULT '0';
ALTER TABLE `hrDevice` CHANGE `hrDeviceErrors` `hrDeviceErrors` INT( 11 ) NOT NULL DEFAULT '0';