add device serial number into database, for devices not having entity mib

git-svn-id: http://www.observium.org/svn/observer/trunk@1133 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-06-10 19:46:55 +00:00
parent 7233830e17
commit a82d81eb37
2 changed files with 7 additions and 0 deletions

View File

@@ -9,3 +9,4 @@ ALTER TABLE `ports` ADD `port_descr_type` VARCHAR( 32 ) NULL DEFAULT NULL AFTE
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;
CREATE TABLE `current` ( `current_id` int(11) NOT NULL auto_increment, `device_id` int(11) NOT NULL default '0', `current_oid` varchar(64) NOT NULL, `current_index` varchar(8) NOT NULL, `current_type` varchar(32) NOT NULL, `current_descr` varchar(32) NOT NULL default '', `current_precision` int(11) NOT NULL default '1', `current_current` float default NULL, `current_limit` float default NULL, `current_limit_warn` float default NULL, `current_limit_low` float default NULL, PRIMARY KEY (`current_id`), KEY `current_host` (`device_id`)) ENGINE=MyISAM AUTO_INCREMENT=189 DEFAULT CHARSET=latin1;
ALTER TABLE `devices` ADD `serial` text default NULL;

View File

@@ -175,6 +175,12 @@ while ($device = mysql_fetch_array($device_query)) {
unset( $update ) ;
unset( $seperator) ;
if ( $serial && $serial != $device['serial'] ) {
$poll_update .= $poll_separator . "`serial` = '".mres($serial)."'";
$poll_separator = ", ";
eventlog("Serial -> $serial", $device['device_id']);
}
if ( $sysContact && $sysContact != $device['sysContact'] ) {
$poll_update .= $poll_separator . "`sysContact` = '".mres($sysContact)."'";
$poll_separator = ", ";