Exemplo n.º 1
0
function mactrack_database_upgrade () {
	mactrack_add_column("mac_track_interfaces", "ifHighSpeed",           "ALTER TABLE `mac_track_interfaces` ADD COLUMN `ifHighSpeed` int(10) unsigned NOT NULL default '0' AFTER `ifSpeed`");
	mactrack_add_column("mac_track_interfaces", "ifDuplex",              "ALTER TABLE `mac_track_interfaces` ADD COLUMN `ifDuplex` int(10) unsigned NOT NULL default '0' AFTER `ifHighSpeed`");
	mactrack_add_column("mac_track_interfaces", "int_ifInDiscards",      "ALTER TABLE `mac_track_interfaces` ADD COLUMN `int_ifInDiscards` int(10) unsigned NOT NULL default '0' AFTER `ifOutErrors`");
	mactrack_add_column("mac_track_interfaces", "int_ifInErrors",        "ALTER TABLE `mac_track_interfaces` ADD COLUMN `int_ifInErrors` int(10) unsigned NOT NULL default '0' AFTER `int_ifInDiscards`");
	mactrack_add_column("mac_track_interfaces", "int_ifInUnknownProtos", "ALTER TABLE `mac_track_interfaces` ADD COLUMN `int_ifInUnknownProtos` int(10) unsigned NOT NULL default '0' AFTER `int_ifInErrors`");
	mactrack_add_column("mac_track_interfaces", "int_ifOutDiscards",     "ALTER TABLE `mac_track_interfaces` ADD COLUMN `int_ifOutDiscards` int(10) unsigned NOT NULL default '0' AFTER `int_ifInUnknownProtos`");
	mactrack_add_column("mac_track_interfaces", "int_ifOutErrors",       "ALTER TABLE `mac_track_interfaces` ADD COLUMN `int_ifOutErrors` int(10) unsigned NOT NULL default '0' AFTER `int_ifOutDiscards`");
	mactrack_add_column("mac_track_devices",    "host_id",               "ALTER TABLE `mac_track_devices` ADD COLUMN `host_id` int(10) unsigned NOT NULL default '0' AFTER `device_id`");
	mactrack_add_column("mac_track_macwatch",   "date_last_notif",       "ALTER TABLE `mac_track_macwatch` ADD COLUMN `date_last_notif` TIMESTAMP DEFAULT '0000-00-00 00:00:00' AFTER `date_last_seen`");
	mactrack_execute_sql("Add length to Device Types Match Fields", "ALTER TABLE `mac_track_device_types` MODIFY COLUMN `sysDescr_match` VARCHAR(100) NOT NULL default '', MODIFY COLUMN `sysObjectID_match` VARCHAR(100) NOT NULL default ''");
	mactrack_execute_sql("Correct a Scanning Function Bug", "DELETE FROM mac_track_scanning_functions WHERE scanning_function='Not Applicable - Hub/Switch'");
	mactrack_add_column("mac_track_devices", "host_id", "ALTER TABLE `mac_track_devices` ADD COLUMN `host_id` INTEGER UNSIGNED NOT NULL default '0' AFTER `device_id`");
	mactrack_add_index("mac_track_devices", "host_id", "ALTER TABLE `mac_track_devices` ADD INDEX `host_id`(`host_id`)");
	mactrack_add_index("mac_track_ports", "scan_date", "ALTER TABLE `mac_track_ports` ADD INDEX `scan_date` USING BTREE(`scan_date`)");

	if (!mactrack_db_column_exists("mac_track_interfaces", "sysUptime")) {
		db_execute("ALTER TABLE mac_track_interfaces
			ADD COLUMN `sysUptime` int(10) unsigned NOT NULL default '0' AFTER `device_id`,
			ADD COLUMN `ifInOctets` int(10) unsigned NOT NULL default '0' AFTER `vlan_trunk_status`,
			ADD COLUMN `ifOutOctets` int(10) unsigned NOT NULL default '0' AFTER `ifInOctets`,
			ADD COLUMN `ifHCInOctets` bigint(20) unsigned NOT NULL default '0' AFTER `ifOutOctets`,
			ADD COLUMN `ifHCOutOctets` bigint(20) unsigned NOT NULL default '0' AFTER `ifHCInOctets`,
			ADD COLUMN `ifInNUcastPkts` int(10) unsigned NOT NULL default '0' AFTER `ifHCOutOctets`,
			ADD COLUMN `ifOutNUcastPkts` int(10) unsigned NOT NULL default '0' AFTER `ifInNUcastPkts`,
			ADD COLUMN `ifInUcastPkts` int(10) unsigned NOT NULL default '0' AFTER `ifOutNUcastPkts`,
			ADD COLUMN `ifOutUcastPkts` int(10) unsigned NOT NULL default '0' AFTER `ifInUcastPkts`,
			ADD COLUMN `inBound` double NOT NULL default '0' AFTER `ifOutErrors`,
			ADD COLUMN `outBound` double NOT NULL default '0' AFTER `inBound`,
			ADD COLUMN `int_ifInOctets` int(10) unsigned NOT NULL default '0' AFTER `outBound`,
			ADD COLUMN `int_ifOutOctets` int(10) unsigned NOT NULL default '0' AFTER `int_ifInOctets`,
			ADD COLUMN `int_ifHCInOctets` bigint(20) unsigned NOT NULL default '0' AFTER `int_ifOutOctets`,
			ADD COLUMN `int_ifHCOutOctets` bigint(20) unsigned NOT NULL default '0' AFTER `int_ifHCInOctets`,
			ADD COLUMN `int_ifInNUcastPkts` int(10) unsigned NOT NULL default '0' AFTER `int_ifHCOutOctets`,
			ADD COLUMN `int_ifOutNUcastPkts` int(10) unsigned NOT NULL default '0' AFTER `int_ifInNUcastPkts`,
			ADD COLUMN `int_ifInUcastPkts` int(10) unsigned NOT NULL default '0' AFTER `int_ifOutNUcastPkts`,
			ADD COLUMN `int_ifOutUcastPkts` int(10) unsigned NOT NULL default '0' AFTER `int_ifInUcastPkts`");
	}

	if (!mactrack_db_key_exists("mac_track_ports", "site_id_device_id")) {
		db_execute("ALTER TABLE `mac_track_ports` ADD INDEX `site_id_device_id`(`site_id`, `device_id`);");
	}

	# new for 2.1.2
	# SNMP V3
	mactrack_add_column("mac_track_devices",    "snmp_options",         "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_options` int(10) unsigned NOT NULL default '0' AFTER `user_password`");
	mactrack_add_column("mac_track_devices",    "snmp_username",        "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_username` varchar(50) default NULL AFTER `snmp_status`");
	mactrack_add_column("mac_track_devices",    "snmp_password",        "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_password` varchar(50) default NULL AFTER `snmp_username`");
	mactrack_add_column("mac_track_devices",    "snmp_auth_protocol",   "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_auth_protocol` char(5) default '' AFTER `snmp_password`");
	mactrack_add_column("mac_track_devices",    "snmp_priv_passphrase", "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_priv_passphrase` varchar(200) default '' AFTER `snmp_auth_protocol`");
	mactrack_add_column("mac_track_devices",    "snmp_priv_protocol",   "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_priv_protocol` char(6) default '' AFTER `snmp_priv_passphrase`");
	mactrack_add_column("mac_track_devices",    "snmp_context",         "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_context` varchar(64) default '' AFTER `snmp_priv_protocol`");
	mactrack_add_column("mac_track_devices",    "max_oids",             "ALTER TABLE `mac_track_devices` ADD COLUMN `max_oids` int(12) unsigned default '10' AFTER `snmp_context`");

	if (!mactrack_db_table_exists("mac_track_snmp")) {
		mactrack_create_table("mac_track_snmp", "CREATE TABLE `mac_track_snmp` (
			`id` int(10) unsigned NOT NULL auto_increment,
			`name` varchar(100) NOT NULL default '',
			PRIMARY KEY  (`id`))
			ENGINE=MyISAM COMMENT='Group of SNMP Option Sets';");
	}

	if (!mactrack_db_table_exists("mac_track_snmp_items")) {
		mactrack_create_table("mac_track_snmp_items", "CREATE TABLE `mac_track_snmp_items` (
			`id` int(10) unsigned NOT NULL auto_increment,
			`snmp_id` int(10) unsigned NOT NULL default '0',
			`sequence` int(10) unsigned NOT NULL default '0',
			`snmp_version` varchar(100) NOT NULL default '',
			`snmp_readstring` varchar(100) NOT NULL,
			`snmp_port` int(10) NOT NULL default '161',
			`snmp_timeout` int(10) unsigned NOT NULL default '500',
			`snmp_retries` tinyint(11) unsigned NOT NULL default '3',
			`max_oids` int(12) unsigned default '10',
			`snmp_username` varchar(50) default NULL,
			`snmp_password` varchar(50) default NULL,
			`snmp_auth_protocol` char(5) default '',
			`snmp_priv_passphrase` varchar(200) default '',
			`snmp_priv_protocol` char(6) default '',
			`snmp_context` varchar(64) default '',
			PRIMARY KEY  (`id`,`snmp_id`))
			ENGINE=MyISAM COMMENT='Set of SNMP Options';");
	}

	if (!sizeof(db_fetch_row("SHOW TABLES LIKE 'mac_track_interface_graphs'"))) {
		db_execute("CREATE TABLE `mac_track_interface_graphs` (
			`device_id` int(10) unsigned NOT NULL default '0',
			`ifIndex` int(10) unsigned NOT NULL,
			`ifName` varchar(20) NOT NULL default '',
			`host_id` int(11) NOT NULL default '0',
			`local_graph_id` int(10) unsigned NOT NULL,
			`snmp_query_id` int(11) NOT NULL default '0',
			`graph_template_id` int(11) NOT NULL default '0',
			`field_name` varchar(20) NOT NULL default '',
			`field_value` varchar(25) NOT NULL default '',
			`present` tinyint(4) default '1',
			PRIMARY KEY  (`local_graph_id`,`device_id`,`ifIndex`, `host_id`),
			KEY `host_id` (`host_id`),
			KEY `device_id` (`device_id`)
			) ENGINE=MyISAM;"
		);
	}

	mactrack_add_column("mac_track_devices",
		"term_type",
		"ALTER TABLE `mac_track_devices` ADD COLUMN `term_type` tinyint(11) NOT NULL default '1' AFTER `scan_type`");
	mactrack_add_column("mac_track_devices",
		"private_key_path",
		"ALTER TABLE `mac_track_devices` ADD COLUMN `private_key_path` varchar(128) default '' AFTER `user_password`");
	mactrack_add_column("mac_track_interfaces",
		"ifMauAutoNegAdminStatus",
		"ALTER TABLE `mac_track_interfaces` ADD COLUMN `ifMauAutoNegAdminStatus` integer UNSIGNED NOT NULL default '0' AFTER `ifDuplex`");
	mactrack_add_column("mac_track_interfaces",
		"ifMauAutoNegRemoteSignaling",
		"ALTER TABLE `mac_track_interfaces` ADD COLUMN `ifMauAutoNegRemoteSignaling` integer UNSIGNED NOT NULL default '0' AFTER `ifMauAutoNegAdminStatus`");
}
Exemplo n.º 2
0
function mactrack_database_upgrade()
{
    mactrack_add_column('mac_track_interfaces', 'ifHighSpeed', "ALTER TABLE `mac_track_interfaces` ADD COLUMN `ifHighSpeed` int(10) unsigned NOT NULL default '0' AFTER `ifSpeed`");
    mactrack_add_column('mac_track_interfaces', 'ifDuplex', "ALTER TABLE `mac_track_interfaces` ADD COLUMN `ifDuplex` int(10) unsigned NOT NULL default '0' AFTER `ifHighSpeed`");
    mactrack_add_column('mac_track_interfaces', 'int_ifInDiscards', "ALTER TABLE `mac_track_interfaces` ADD COLUMN `int_ifInDiscards` int(10) unsigned NOT NULL default '0' AFTER `ifOutErrors`");
    mactrack_add_column('mac_track_interfaces', 'int_ifInErrors', "ALTER TABLE `mac_track_interfaces` ADD COLUMN `int_ifInErrors` int(10) unsigned NOT NULL default '0' AFTER `int_ifInDiscards`");
    mactrack_add_column('mac_track_interfaces', 'int_ifInUnknownProtos', "ALTER TABLE `mac_track_interfaces` ADD COLUMN `int_ifInUnknownProtos` int(10) unsigned NOT NULL default '0' AFTER `int_ifInErrors`");
    mactrack_add_column('mac_track_interfaces', 'int_ifOutDiscards', "ALTER TABLE `mac_track_interfaces` ADD COLUMN `int_ifOutDiscards` int(10) unsigned NOT NULL default '0' AFTER `int_ifInUnknownProtos`");
    mactrack_add_column('mac_track_interfaces', 'int_ifOutErrors', "ALTER TABLE `mac_track_interfaces` ADD COLUMN `int_ifOutErrors` int(10) unsigned NOT NULL default '0' AFTER `int_ifOutDiscards`");
    mactrack_add_column('mac_track_devices', 'host_id', "ALTER TABLE `mac_track_devices` ADD COLUMN `host_id` int(10) unsigned NOT NULL default '0' AFTER `device_id`");
    mactrack_add_column('mac_track_macwatch', 'date_last_notif', "ALTER TABLE `mac_track_macwatch` ADD COLUMN `date_last_notif` TIMESTAMP DEFAULT '0000-00-00 00:00:00' AFTER `date_last_seen`");
    mactrack_execute_sql('Add length to Device Types Match Fields', "ALTER TABLE `mac_track_device_types` MODIFY COLUMN `sysDescr_match` VARCHAR(100) NOT NULL default '', MODIFY COLUMN `sysObjectID_match` VARCHAR(100) NOT NULL default ''");
    mactrack_execute_sql('Correct a Scanning Function Bug', "DELETE FROM mac_track_scanning_functions WHERE scanning_function='Not Applicable - Hub/Switch'");
    mactrack_add_column('mac_track_devices', 'host_id', "ALTER TABLE `mac_track_devices` ADD COLUMN `host_id` INTEGER UNSIGNED NOT NULL default '0' AFTER `device_id`");
    mactrack_add_index('mac_track_devices', 'host_id', 'ALTER TABLE `mac_track_devices` ADD INDEX `host_id`(`host_id`)');
    mactrack_add_index('mac_track_ports', 'scan_date', 'ALTER TABLE `mac_track_ports` ADD INDEX `scan_date` USING BTREE(`scan_date`)');
    if (!mactrack_db_column_exists('mac_track_interfaces', 'sysUptime')) {
        db_execute("ALTER TABLE mac_track_interfaces\n\t\t\tADD COLUMN `sysUptime` int(10) unsigned NOT NULL default '0' AFTER `device_id`,\n\t\t\tADD COLUMN `ifInOctets` int(10) unsigned NOT NULL default '0' AFTER `vlan_trunk_status`,\n\t\t\tADD COLUMN `ifOutOctets` int(10) unsigned NOT NULL default '0' AFTER `ifInOctets`,\n\t\t\tADD COLUMN `ifHCInOctets` bigint(20) unsigned NOT NULL default '0' AFTER `ifOutOctets`,\n\t\t\tADD COLUMN `ifHCOutOctets` bigint(20) unsigned NOT NULL default '0' AFTER `ifHCInOctets`,\n\t\t\tADD COLUMN `ifInNUcastPkts` int(10) unsigned NOT NULL default '0' AFTER `ifHCOutOctets`,\n\t\t\tADD COLUMN `ifOutNUcastPkts` int(10) unsigned NOT NULL default '0' AFTER `ifInNUcastPkts`,\n\t\t\tADD COLUMN `ifInUcastPkts` int(10) unsigned NOT NULL default '0' AFTER `ifOutNUcastPkts`,\n\t\t\tADD COLUMN `ifOutUcastPkts` int(10) unsigned NOT NULL default '0' AFTER `ifInUcastPkts`,\n\t\t\tADD COLUMN `inBound` double NOT NULL default '0' AFTER `ifOutErrors`,\n\t\t\tADD COLUMN `outBound` double NOT NULL default '0' AFTER `inBound`,\n\t\t\tADD COLUMN `int_ifInOctets` int(10) unsigned NOT NULL default '0' AFTER `outBound`,\n\t\t\tADD COLUMN `int_ifOutOctets` int(10) unsigned NOT NULL default '0' AFTER `int_ifInOctets`,\n\t\t\tADD COLUMN `int_ifHCInOctets` bigint(20) unsigned NOT NULL default '0' AFTER `int_ifOutOctets`,\n\t\t\tADD COLUMN `int_ifHCOutOctets` bigint(20) unsigned NOT NULL default '0' AFTER `int_ifHCInOctets`,\n\t\t\tADD COLUMN `int_ifInNUcastPkts` int(10) unsigned NOT NULL default '0' AFTER `int_ifHCOutOctets`,\n\t\t\tADD COLUMN `int_ifOutNUcastPkts` int(10) unsigned NOT NULL default '0' AFTER `int_ifInNUcastPkts`,\n\t\t\tADD COLUMN `int_ifInUcastPkts` int(10) unsigned NOT NULL default '0' AFTER `int_ifOutNUcastPkts`,\n\t\t\tADD COLUMN `int_ifOutUcastPkts` int(10) unsigned NOT NULL default '0' AFTER `int_ifInUcastPkts`");
    }
    if (!mactrack_db_key_exists('mac_track_ports', 'site_id_device_id')) {
        db_execute('ALTER TABLE `mac_track_ports` ADD INDEX `site_id_device_id`(`site_id`, `device_id`);');
    }
    # new for 2.1.2
    # SNMP V3
    mactrack_add_column('mac_track_devices', 'term_type', "ALTER TABLE `mac_track_devices` ADD COLUMN `term_type` tinyint(11) NOT NULL default '1' AFTER `scan_type`");
    mactrack_add_column('mac_track_devices', 'user_name', "ALTER TABLE `mac_track_devices` ADD COLUMN `user_name` varchar(40) default NULL AFTER `term_type`");
    mactrack_add_column('mac_track_devices', 'user_password', "ALTER TABLE `mac_track_devices` ADD COLUMN `user_password` varchar(40) default NULL AFTER `user_name`");
    mactrack_add_column('mac_track_devices', 'private_key_path', "ALTER TABLE `mac_track_devices` ADD COLUMN `private_key_path` varchar(128) default '' AFTER `user_password`");
    mactrack_add_column('mac_track_devices', 'snmp_options', "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_options` int(10) unsigned NOT NULL default '0' AFTER `private_key_path`");
    mactrack_add_column('mac_track_devices', 'snmp_username', "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_username` varchar(50) default NULL AFTER `snmp_status`");
    mactrack_add_column('mac_track_devices', 'snmp_password', "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_password` varchar(50) default NULL AFTER `snmp_username`");
    mactrack_add_column('mac_track_devices', 'snmp_auth_protocol', "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_auth_protocol` char(5) default '' AFTER `snmp_password`");
    mactrack_add_column('mac_track_devices', 'snmp_priv_passphrase', "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_priv_passphrase` varchar(200) default '' AFTER `snmp_auth_protocol`");
    mactrack_add_column('mac_track_devices', 'snmp_priv_protocol', "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_priv_protocol` char(6) default '' AFTER `snmp_priv_passphrase`");
    mactrack_add_column('mac_track_devices', 'snmp_context', "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_context` varchar(64) default '' AFTER `snmp_priv_protocol`");
    mactrack_add_column('mac_track_devices', 'max_oids', "ALTER TABLE `mac_track_devices` ADD COLUMN `max_oids` int(12) unsigned default '10' AFTER `snmp_context`");
    mactrack_add_column('mac_track_devices', 'snmp_engine_id', "ALTER TABLE `mac_track_devices` ADD COLUMN `snmp_engine_id` varchar(30) default '' AFTER `snmp_context`");
    mactrack_add_column('mac_track_snmp_items', 'snmp_engine_id', "ALTER TABLE `mac_track_snmp_items` ADD COLUMN `snmp_engine_id` varchar(30) default '' AFTER `snmp_context`");
    if (!mactrack_db_table_exists('mac_track_snmp')) {
        mactrack_create_table('mac_track_snmp', "CREATE TABLE `mac_track_snmp` (\n\t\t\t`id` int(10) unsigned NOT NULL auto_increment,\n\t\t\t`name` varchar(100) NOT NULL default '',\n\t\t\tPRIMARY KEY  (`id`))\n\t\t\tENGINE=InnoDB COMMENT='Group of SNMP Option Sets';");
    }
    if (!mactrack_db_table_exists('mac_track_snmp_items')) {
        mactrack_create_table('mac_track_snmp_items', "CREATE TABLE `mac_track_snmp_items` (\n\t\t\t`id` int(10) unsigned NOT NULL auto_increment,\n\t\t\t`snmp_id` int(10) unsigned NOT NULL default '0',\n\t\t\t`sequence` int(10) unsigned NOT NULL default '0',\n\t\t\t`snmp_version` varchar(100) NOT NULL default '',\n\t\t\t`snmp_readstring` varchar(100) NOT NULL,\n\t\t\t`snmp_port` int(10) NOT NULL default '161',\n\t\t\t`snmp_timeout` int(10) unsigned NOT NULL default '500',\n\t\t\t`snmp_retries` tinyint(11) unsigned NOT NULL default '3',\n\t\t\t`max_oids` int(12) unsigned default '10',\n\t\t\t`snmp_username` varchar(50) default NULL,\n\t\t\t`snmp_password` varchar(50) default NULL,\n\t\t\t`snmp_auth_protocol` char(5) default '',\n\t\t\t`snmp_priv_passphrase` varchar(200) default '',\n\t\t\t`snmp_priv_protocol` char(6) default '',\n\t\t\t`snmp_context` varchar(64) default '',\n\t\t\t`snmp_engine_id` varchar(30) default '',\n\t\t\tPRIMARY KEY  (`id`,`snmp_id`))\n\t\t\tENGINE=InnoDB COMMENT='Set of SNMP Options';");
    }
    if (!sizeof(db_fetch_row("SHOW TABLES LIKE 'mac_track_interface_graphs'"))) {
        db_execute("CREATE TABLE `mac_track_interface_graphs` (\n\t\t\t`device_id` int(10) unsigned NOT NULL default '0',\n\t\t\t`ifIndex` int(10) unsigned NOT NULL,\n\t\t\t`ifName` varchar(20) NOT NULL default '',\n\t\t\t`host_id` int(11) NOT NULL default '0',\n\t\t\t`local_graph_id` int(10) unsigned NOT NULL,\n\t\t\t`snmp_query_id` int(11) NOT NULL default '0',\n\t\t\t`graph_template_id` int(11) NOT NULL default '0',\n\t\t\t`field_name` varchar(20) NOT NULL default '',\n\t\t\t`field_value` varchar(25) NOT NULL default '',\n\t\t\t`present` tinyint(4) default '1',\n\t\t\tPRIMARY KEY  (`local_graph_id`,`device_id`,`ifIndex`, `host_id`),\n\t\t\tKEY `host_id` (`host_id`),\n\t\t\tKEY `device_id` (`device_id`)\n\t\t\t) ENGINE=InnoDB;");
    }
    mactrack_add_column('mac_track_devices', 'term_type', "ALTER TABLE `mac_track_devices` ADD COLUMN `term_type` tinyint(11) NOT NULL default '1' AFTER `scan_type`");
    mactrack_add_column('mac_track_devices', 'private_key_path', "ALTER TABLE `mac_track_devices` ADD COLUMN `private_key_path` varchar(128) default '' AFTER `user_password`");
    mactrack_add_column('mac_track_interfaces', 'ifMauAutoNegAdminStatus', "ALTER TABLE `mac_track_interfaces` ADD COLUMN `ifMauAutoNegAdminStatus` integer UNSIGNED NOT NULL default '0' AFTER `ifDuplex`");
    mactrack_add_column('mac_track_interfaces', 'ifMauAutoNegRemoteSignaling', "ALTER TABLE `mac_track_interfaces` ADD COLUMN `ifMauAutoNegRemoteSignaling` integer UNSIGNED NOT NULL default '0' AFTER `ifMauAutoNegAdminStatus`");
    mactrack_add_column('mac_track_device_types', 'serial_number_oid', "ALTER TABLE `mac_track_device_types` ADD COLUMN `serial_number_oid` varchar(100) default '' AFTER `ip_scanning_function`");
    mactrack_add_column('mac_track_sites', 'customer_contact', "ALTER TABLE `mac_track_sites` ADD COLUMN `customer_contact` varchar(150) default '' AFTER `site_name`");
    mactrack_add_column('mac_track_sites', 'netops_contact', "ALTER TABLE `mac_track_sites` ADD COLUMN `netops_contact` varchar(150) default '' AFTER `customer_contact`");
    mactrack_add_column('mac_track_sites', 'facilities_contact', "ALTER TABLE `mac_track_sites` ADD COLUMN `facilities_contact` varchar(150) default '' AFTER `netops_contact`");
    mactrack_add_column('mac_track_sites', 'site_info', "ALTER TABLE `mac_track_sites` ADD COLUMN `site_info` text AFTER `facilities_contact`");
    mactrack_add_column('mac_track_devices', 'device_name', "ALTER TABLE `mac_track_devices` ADD COLUMN `device_name` varchar(100) default '' AFTER `host_id`");
    mactrack_add_column('mac_track_devices', 'notes', "ALTER TABLE `mac_track_devices` ADD COLUMN `notes` text AFTER `hostname`");
    mactrack_add_column('mac_track_scanning_functions', 'type', "ALTER TABLE `mac_track_scanning_functions` ADD COLUMN `type` int(10) unsigned NOT NULL default '0' AFTER `scanning_function`");
    mactrack_add_column('mac_track_temp_ports', 'device_name', "ALTER TABLE `mac_track_temp_ports` ADD COLUMN `device_name` varchar(100) NOT NULL default '' AFTER `hostname`");
    mactrack_add_column('mac_track_temp_ports', 'vendor_mac', "ALTER TABLE `mac_track_temp_ports` ADD COLUMN `vendor_mac` varchar(8) default NULL AFTER `mac_address`");
    mactrack_add_column('mac_track_temp_ports', 'authorized', "ALTER TABLE `mac_track_temp_ports` ADD COLUMN `authorized` tinyint(3) unsigned NOT NULL default '0' AFTER `updated`");
    mactrack_add_column('mac_track_ports', 'device_name', "ALTER TABLE `mac_track_ports` ADD COLUMN `device_name` varchar(100) NOT NULL default '' AFTER `hostname`");
    mactrack_add_column('mac_track_ports', 'vendor_mac', "ALTER TABLE `mac_track_ports` ADD COLUMN `vendor_mac` varchar(8) default NULL AFTER `mac_address`");
    mactrack_add_column('mac_track_ports', 'authorized', "ALTER TABLE `mac_track_ports` ADD COLUMN `authorized` tinyint(3) unsigned NOT NULL default '0' AFTER `scan_date`");
    mactrack_add_column('mac_track_ips', 'mac_track_ips', "ALTER TABLE `mac_track_ips` ADD COLUMN `device_name` varchar(100) NOT NULL default '' AFTER `hostname`");
    db_execute("ALTER TABLE mac_track_ips MODIFY COLUMN port_number varchar(20) NOT NULL default ''");
    db_execute("ALTER TABLE mac_track_ports MODIFY COLUMN port_number varchar(20) NOT NULL default ''");
    db_execute("ALTER TABLE mac_track_temp_ports MODIFY COLUMN port_number varchar(20) NOT NULL default ''");
    db_execute("ALTER TABLE mac_track_aggregated_ports MODIFY COLUMN port_number varchar(20) NOT NULL default ''");
}