From ba9b26313dd0e09808f0622260596f69f515abff Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Wed, 9 Jun 2010 18:56:05 +0000 Subject: [PATCH] fix updating already known temperatures on discovery, plus schema change which I forgot on one of the previous commits git-svn-id: http://www.observium.org/svn/observer/trunk@1119 61d68cd4-352d-0410-923a-c4978735b2b8 --- database-update.sql | 1 + includes/discovery/functions.inc.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/database-update.sql b/database-update.sql index 8424e9b63d..8cf00f4723 100644 --- a/database-update.sql +++ b/database-update.sql @@ -7,3 +7,4 @@ DROP TABLE `cmpMemPool`; ALTER TABLE `mempools` CHANGE `mempool_used` `mempool_used` BIGINT( 16 ) NOT NULL ,CHANGE `mempool_free` `mempool_free` BIGINT( 16 ) NOT NULL ,CHANGE `mempool_total` `mempool_total` BIGINT( 16 ) NOT NULL ,CHANGE `mempool_largestfree` `mempool_largestfree` BIGINT( 16 ) NULL DEFAULT NULL ,CHANGE `mempool_lowestfree` `mempool_lowestfree` BIGINT( 16 ) NULL DEFAULT NULL ; ALTER TABLE `ports` ADD `port_descr_type` VARCHAR( 32 ) NULL DEFAULT NULL AFTER `device_id` ,ADD `port_descr_descr` VARCHAR( 64 ) NULL DEFAULT NULL AFTER `port_descr_type` ,ADD `port_descr_circuit` VARCHAR( 64 ) NULL DEFAULT NULL AFTER `port_descr_descr` ,ADD `port_descr_speed` VARCHAR( 32 ) NULL DEFAULT NULL AFTER `port_descr_circuit` ,ADD `port_descr_notes` VARCHAR( 128 ) NULL DEFAULT NULL AFTER `port_descr_speed`; CREATE TABLE `frequency` ( `freq_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL default '0', `freq_oid` varchar(64) NOT NULL, `freq_index` varchar(8) NOT NULL, `freq_type` varchar(32) NOT NULL, `freq_descr` varchar(32) NOT NULL default '', `freq_precision` int(11) NOT NULL default '1', `freq_current` float default NULL, `freq_limit` float default NULL, `freq_limit_low` float default NULL, PRIMARY KEY (`freq_id`), KEY `freq_host` (`device_id`)) ENGINE=MyISAM AUTO_INCREMENT=189 DEFAULT CHARSET=latin1; +ALTER TABLE `temperature` CHANGE `temp_index` `temp_index` int(11) NOT NULL; diff --git a/includes/discovery/functions.inc.php b/includes/discovery/functions.inc.php index 90919b0827..deb860390e 100644 --- a/includes/discovery/functions.inc.php +++ b/includes/discovery/functions.inc.php @@ -155,7 +155,7 @@ function discover_temperature(&$valid_temp, $device, $oid, $index, $type, $descr { $entry = mysql_fetch_array(mysql_query("SELECT * FROM `temperature` WHERE device_id = '".$device['device_id']."' AND `temp_type` = '$type' AND `temp_index` = '$index'")); echo(mysql_error()); - if($oid == $entry['temp_oid'] && $descr == $entry['temp_descr'] && $precision == $ntry['temp_precision']) + if($oid == $entry['temp_oid'] && $descr == $entry['temp_descr'] && $precision == $entry['temp_precision']) { echo("."); }