From 896e1ae63aa0b1a85526dcf93b4f39d317a19429 Mon Sep 17 00:00:00 2001 From: slerena Date: Mon, 20 Aug 2007 14:29:01 +0000 Subject: [PATCH] 2007-08-20 Sancho Lerena * migrate.php renamed to upgrade.php * Deleted old upgrade scripts from 1.1 * Updated install.php. * Updated Index.php version to Beta2 :-) git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@604 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 14 +- pandora_console/include/config.inc.php | 4 +- pandora_console/index.php | 4 +- pandora_console/install.php | 3 +- pandora_console/pandora_migrate_1.2.txt | 45 ----- pandora_console/pandoradb_1.1_to_1.2.sql | 186 ------------------- pandora_console/{migrate.php => upgrade.php} | 0 7 files changed, 19 insertions(+), 237 deletions(-) delete mode 100644 pandora_console/pandora_migrate_1.2.txt delete mode 100644 pandora_console/pandoradb_1.1_to_1.2.sql rename pandora_console/{migrate.php => upgrade.php} (100%) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 2c044d8749..eb86ce90bc 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2007-08-20 Sancho Lerena + + * migrate.php renamed to upgrade.php + + * Deleted old upgrade scripts from 1.1 + + * Updated install.php. + + * Updated Index.php version to Beta2 :-) + + 2007-08-17 Sancho Lerena * Updated Pandora FMS logo :-) (Thanks Silvia!) @@ -12,7 +23,8 @@ * pandoradb_12_to_13.sql: Fixed some items. - * reporting/fgraph.php: Fixed problem (NOTICE string) rendering boolean graphs. + * reporting/fgraph.php: Fixed problem (NOTICE string) rendering + boolean graphs. * migrate.php: Upgraded and finished migration tool from 1.2 to 1.3 :-) diff --git a/pandora_console/include/config.inc.php b/pandora_console/include/config.inc.php index 55a173240b..2c01a0f66b 100644 --- a/pandora_console/include/config.inc.php +++ b/pandora_console/include/config.inc.php @@ -25,9 +25,9 @@ //Pandora Version if (!isset($build_version)) - $build_version="PC070622"; + $build_version="PC070820"; if (!isset($pandora_version)) - $pandora_version="v1.3 Beta 1"; + $pandora_version="v1.3 Beta 2"; // Database configuration (default ones) //$dbname="pandora13"; // MySQL DataBase diff --git a/pandora_console/index.php b/pandora_console/index.php index dc55687aca..ab67173c4b 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -24,8 +24,8 @@ // Pandora FMS 1.x uses Pear Image::Graph code //Pandora Version, if not defined here it would take from config.php -$build_version="PC070808"; -$pandora_version="v1.3-dev"; +$build_version="PC070820"; +$pandora_version="v1.3 Beta2"; global $build_version; global $pandora_version; diff --git a/pandora_console/install.php b/pandora_console/install.php index 18e5f9d21c..b2bf74c61c 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -163,7 +163,8 @@ function install_step1() { echo "
Warning: You already have a config.php file. Configuration and database would be overwritten if you continued.
"; } echo "
Warning: This installer will overwrite and destroy your existing Pandora FMS configuration and Database. Before contine, please be sure that you have no valuable Pandora FMS data in your Database.
"; - echo "
If you want to upgrade Pandora FMS 1.2 to 1.3 version, use the automated migration wizard
"; + echo "
If you want to upgrade Pandora FMS 1.2 to 1.3 version, use the automated update wizard
"; echo "
diff --git a/pandora_console/pandora_migrate_1.2.txt b/pandora_console/pandora_migrate_1.2.txt deleted file mode 100644 index 1102a17a48..0000000000 --- a/pandora_console/pandora_migrate_1.2.txt +++ /dev/null @@ -1,45 +0,0 @@ -Migrate Pandora 1.1 to Pandora 1.2 -================================== - -You need a script called pandoradb_1.1_to_1.2.sql provided in Pandora Console Package for 1.2 version. Migrate 1.1 to 1.2 versions includes: - -a) Full replacement of Pandora Console PHP Code (backup your original one to replace values in /include/config.php for your login, password, hostname to connect database). - -b) Full replacement of Pandora Server PERL Code (backyou your original one to replace values in pandora_server.conf. The new pandora_server.conf is located at /conf directory. It's possible that you need to change incoming dir, or parameters into daemon scripts. Please recheck Pandora Server 1.2 documentation before try to run it. - -c) Read documentation about new features of Pandora 1.2. - -Migration process doesnt delete any data, you don't loss any agente, config, or enviroment data, but please, read _carefully_ all documentation about this process before trying it. - -Migration steps ---------------- - -0. You need to stop Pandora Server before any changes in database. Think that you dont loose any data in the process of migration because agent data will be stored in incoming directory. Move this data to the new incoming directory before launch the new server, and you process that data without miss anything. - -1. DUMP all tagente_datos records to a safe file, for example - - mysqldump --no-create-info -u root -p pandora tagente_datos > /tmp/pandora.conv.tmp - -2. Run migration SQL script, for example: - - cat pandoradb_1.1_to_1.2.sql | mysql -u root -p -D pandora - -PLEASE NOTE THAT this script WILL DROP your data table, so please DONT SKIP step #1. - -3. Reimport data writen in first step, for example: - - cat /tmp/pandora.conv.tmp | mysql -u root -p -D pandora - -4. Delete temporal files, for example: - - rm -Rf /tmp/pandora.conv.tmp - -Code upgrade ------------- - -Simply backup your Pandora Console and Pandora Server install and proceed as if Pandora 1.2 was a new installation. Use your configuration values your the new configuration files in Pandora and Server components. Database migration is the "heavy" task, and need to be made before using new code. - -Final step ----------- - -Start your new Pandora components. Start your new Pandora components. Enter the WEB console and check that a new "server" has been created. Please, edit each agent you have and assign this new server for each agent. This process could be automated using SQL, and you only need to do once. \ No newline at end of file diff --git a/pandora_console/pandoradb_1.1_to_1.2.sql b/pandora_console/pandoradb_1.1_to_1.2.sql deleted file mode 100644 index 8f8db01b9a..0000000000 --- a/pandora_console/pandoradb_1.1_to_1.2.sql +++ /dev/null @@ -1,186 +0,0 @@ --- Pandora 1.1 to 1.2 SQL Migration script --- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --- CAUTION, BEFORE RUNNING THIS FILE, READ DOCUMENTATION --- ABOUT HOW TO MIGRATE FROM PANDORA 1.1 to 1.2 VERSION --- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - --- Quick guide for migration: --- 1th --- DUMP all tagente_datos records to a safe file --- for example --- mysqldump --no-create-info -u root -p pandora tagente_datos > /tmp/pandora.conv.tmp --- 2th --- Run this SQL script, for example --- cat pandoradb_1.1_to_1.2.sql | mysql -u root -p -D pandora --- 3th --- Reimport data from first step --- cat /tmp/pandora.conv.tmp | mysql -u root -p -D pandora --- 4th --- Delete /tmp/pandora.conv.tmp file (rm -f /tmp/pandora.conv.tmp) - -CREATE TABLE `tagent_access` ( - `id_ac` bigint(20) unsigned NOT NULL auto_increment, - `id_agent` int(11) NOT NULL default '0', - `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`id_ac`), - KEY `agent_index` (`id_agent`) -) TYPE=InnoDB; - -ALTER TABLE talerta_agente_modulo MODIFY COLUMN al_campo3 tinytext default ''; -ALTER TABLE tagente ADD column agent_type int(2) unsigned NOT NULL default '0'; -ALTER TABLE tagente ADD column id_server int(4) unsigned NOT NULL default '0'; -ALTER TABLE tagente_datos_string MODIFY COLUMN datos mediumtext NOT NULL; -ALTER TABLE tagente_estado ADD column `id_agente` int(11) NOT NULL default '0' AFTER estado; -ALTER TABLE tagente_estado ADD column `last_try` datetime default NULL AFTER id_agente; -ALTER TABLE tagente_modulo ADD column `module_interval` int(4) unsigned default '0' AFTER min; -ALTER TABLE tagente_modulo ADD column `tcp_port` int(4) unsigned default '0' AFTER module_interval; -ALTER TABLE tagente_modulo ADD column `tcp_send` varchar(150) default '' AFTER tcp_port; -ALTER TABLE tagente_modulo ADD column `tcp_rcv` varchar(100) default '' AFTER tcp_send; -ALTER TABLE tagente_modulo ADD column `snmp_community` varchar(100) default '' AFTER tcp_rcv; -ALTER TABLE tagente_modulo ADD column `snmp_oid` varchar(255) default '0' AFTER snmp_community; -ALTER TABLE tagente_modulo ADD column `ip_target` varchar(100) default '' AFTER snmp_oid; -ALTER TABLE tagente_modulo ADD column `id_module_group` int(4) unsigned default '0' AFTER ip_target; -ALTER TABLE tagente_modulo ADD column `flag` tinyint(3) unsigned default '0' AFTER id_module_group; - -CREATE TABLE `talert_snmp` ( - `id_as` int(10) unsigned NOT NULL auto_increment, - `id_alert` int(10) unsigned NOT NULL default '0', - `al_field1` varchar(100) NOT NULL default '', - `al_field2` varchar(255) NOT NULL default '', - `al_field3` varchar(255) NOT NULL default '', - `description` varchar(255) default '', - `alert_type` int(2) unsigned NOT NULL default '0', - `agent` varchar(100) default '', - `custom_oid` varchar(200) default '', - `oid` varchar(255) NOT NULL default '', - `time_threshold` int(11) NOT NULL default '0', - `times_fired` int(2) unsigned NOT NULL default '0', - `last_fired` datetime NOT NULL default '0000-00-00 00:00:00', - `max_alerts` int(11) NOT NULL default '1', - `min_alerts` int(11) NOT NULL default '1', - `internal_counter` int(2) unsigned NOT NULL default '0', - PRIMARY KEY (`id_as`) -) TYPE=InnoDB; - -ALTER TABLE talerta_agente_modulo ADD column `module_type` int(11) NOT NULL default '0' AFTER times_fired; -ALTER TABLE talerta_agente_modulo ADD column `min_alerts` int(4) NOT NULL default '0' AFTER module_type; -ALTER TABLE talerta_agente_modulo ADD column `internal_counter` int(4) default '0' AFTER min_alerts; -ALTER TABLE tgrupo ADD column `icon` varchar(50) default NULL AFTER nombre; - -CREATE TABLE `tlanguage` ( - `id_language` char(5) NOT NULL default '', - `name` varchar(100) NOT NULL default '', - PRIMARY KEY (`id_language`) -) TYPE=InnoDB; - -CREATE TABLE `tmensajes` ( - `id_mensaje` bigint(20) unsigned NOT NULL auto_increment, - `id_usuario_origen` varchar(100) NOT NULL default '', - `id_usuario_destino` varchar(100) NOT NULL default '', - `mensaje` mediumtext NOT NULL, - `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', - `subject` varchar(255) NOT NULL default '', - `estado` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`id_mensaje`) -) TYPE=InnoDB; - -CREATE TABLE `tmodule_group` ( - `id_mg` bigint(20) unsigned NOT NULL auto_increment, - `name` varchar(150) NOT NULL default '', - PRIMARY KEY (`id_mg`) -) TYPE=InnoDB; - -CREATE TABLE `tserver` ( - `id_server` int(10) unsigned NOT NULL auto_increment, - `name` varchar(100) NOT NULL default '', - `ip_address` varchar(100) NOT NULL default '', - `status` int(11) NOT NULL default '0', - `laststart` datetime NOT NULL default '0000-00-00 00:00:00', - `keepalive` datetime NOT NULL default '0000-00-00 00:00:00', - `snmp_server` int(6) NOT NULL default '1', - `network_server` int(11) NOT NULL default '0', - `data_server` int(11) NOT NULL default '0', - `master` smallint(6) NOT NULL default '1', - `checksum` smallint(6) NOT NULL default '1', - `description` varchar(255) NOT NULL default '', - PRIMARY KEY (`id_server`) -) TYPE=InnoDB; - -ALTER TABLE ttipo_modulo ADD column `icon` varchar(100) default NULL AFTER descripcion; - -CREATE TABLE `ttrap` ( - `id_trap` bigint(20) unsigned NOT NULL auto_increment, - `source` varchar(50) NOT NULL default '', - `oid` varchar(255) NOT NULL default '', - `oid_custom` varchar(255) default '', - `type` int(11) NOT NULL default '0', - `type_custom` varchar(100) default '', - `value` varchar(255) default '', - `value_custom` varchar(255) default '', - `alerted` smallint(6) NOT NULL default '0', - `status` smallint(6) NOT NULL default '0', - `id_usuario` varchar(150) default '', - `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', - PRIMARY KEY (`id_trap`) -) TYPE=InnoDB COMMENT='SNMP Trap table'; - -UPDATE tconfig set value = "1.2" where token = "db_scheme_version"; -UPDATE tconfig set value = "en" where token = "language_code"; -INSERT INTO tconfig (token,value) VALUES ('db_scheme_buile','PD060926'); -INSERT INTO tconfig (token,value) VALUES ('truetype','0'); -INSERT INTO tconfig (token,value) VALUES ('graph_order','1'); - -INSERT INTO `tlanguage` VALUES ('bb','Bable'); -INSERT INTO `tlanguage` VALUES ('en','English'); -INSERT INTO `tlanguage` VALUES ('es_es','Español'); -INSERT INTO `tlanguage` VALUES ('es_la','Español-Latinoamérica'); -INSERT INTO `tlanguage` VALUES ('eu','Euskera'); -INSERT INTO `tlanguage` VALUES ('pt_br','Portuguese-Brazil'); -INSERT INTO `tlanguage` VALUES ('fr','Français'); -INSERT INTO `tlanguage` VALUES ('ca','Català'); - -INSERT INTO `tmodule_group` VALUES (1,'General'); -INSERT INTO `tmodule_group` VALUES (2,'Networking'); -INSERT INTO `tmodule_group` VALUES (3,'Application'); -INSERT INTO `tmodule_group` VALUES (4,'System'); -INSERT INTO `tmodule_group` VALUES (5,'Miscellaneous'); - -UPDATE ttipo_modulo set icon = "mod_data.png" where nombre = "generic_data"; -UPDATE ttipo_modulo set icon = "mod_proc.png" where nombre = "generic_proc"; -UPDATE ttipo_modulo set icon = "mod_string.png" where nombre = "generic_data_string"; -UPDATE ttipo_modulo set icon = "mod_data_inc.png" where nombre = "generic_data_inc"; -INSERT INTO `ttipo_modulo` VALUES (6,'remote_icmp_proc',3,'Remote ICMP network agent, boolean data','mod_icmp_proc.png'); -INSERT INTO `ttipo_modulo` VALUES (7,'remote_icmp',2,'Remote ICMP network agent (latency)','mod_icmp_data.png'); -INSERT INTO `ttipo_modulo` VALUES (8,'remote_tcp',2,'Remote TCP network agent, numeric data','mod_tcp_data.png'); -INSERT INTO `ttipo_modulo` VALUES (9,'remote_tcp_proc',3,'Remote TCP network agent, boolean data','mod_tcp_proc.png'); -INSERT INTO `ttipo_modulo` VALUES (10,'remote_tcp_string',2,'Remote TCP network agent, alphanumeric data','mod_tcp_string.png'); -INSERT INTO `ttipo_modulo` VALUES (11,'remote_tcp_inc',2,'Remote TCP network agent, incremental data','mod_tcp_inc.png'); -INSERT INTO `ttipo_modulo` VALUES (12,'remote_udp_proc',3,'Remote UDP network agent, boolean data','mod_udp_proc.png'); -INSERT INTO `ttipo_modulo` VALUES (15,'remote_snmp',2,'Remote SNMP network agent, numeric data','mod_snmp_data.png'); -INSERT INTO `ttipo_modulo` VALUES (16,'remote_snmp_inc',2,'Remote SNMP network agent, incremental data','mod_snmp_inc.png'); -INSERT INTO `ttipo_modulo` VALUES (17,'remote_snmp_string',2,'Remote SNMP network agent, alphanumeric data','mod_snmp_string.png'); -INSERT INTO `ttipo_modulo` VALUES (18,'remote_snmp_proc',1,'Remote SNMP network agent, boolean data','mod_snmp_proc.png'); - -UPDATE tgrupo set icon = "others"; -UPDATE tgrupo set icon = "servers" where nombre = "Servers"; -UPDATE tgrupo set icon = "ids" where nombre = "IDS"; -UPDATE tgrupo set icon = "firewall" where nombre = "Firewall"; -UPDATE tgrupo set icon = "db" where nombre = "Databases"; -UPDATE tgrupo set icon = "comms" where nombre = "Comms"; -UPDATE tgrupo set icon = "others" where nombre like "Other%"; -UPDATE tgrupo set icon = "workstation" where nombre = "Workstations"; -UPDATE tgrupo set icon = "apps" where nombre = "Applications"; -INSERT INTO `tconfig_os` VALUES ('Network','Pandora Network Agent','network.png'); - -DROP TABLE tagente_datos; -CREATE TABLE `tagente_datos` ( - `id_agente_datos` bigint(10) unsigned NOT NULL auto_increment, - `id_agente_modulo` bigint(4) NOT NULL default '0', - `datos` double(18,2) default NULL, - `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', - `id_agente` bigint(4) unsigned NOT NULL default '0', - PRIMARY KEY (`id_agente_datos`), - KEY `data_index_1` (`id_agente_modulo`), - KEY `data_index_2` (`id_agente`), - KEY `data_index_3` (`timestamp`) -) TYPE=InnoDB; diff --git a/pandora_console/migrate.php b/pandora_console/upgrade.php similarity index 100% rename from pandora_console/migrate.php rename to pandora_console/upgrade.php