From fa87199cc9217c99284e6649baf5fe50cfec6444 Mon Sep 17 00:00:00 2001 From: slerena Date: Mon, 1 Sep 2008 04:22:26 +0000 Subject: [PATCH] 2008-09-01 Sancho lerena * include/, fgraph.php: Moved licence of libraries to LGPL. * install.php: Added dependency check for several new includes from pear (xml_rpc and DB), also graphviz twopi binary and check in step1 for a writable config.php and ./include dir. Some other minor fixes (esthetic). * pandoradb.sql: Table tagent_data_image was still there. This comes with next version (I hope), not this one. * pandoradb_data.sql: db_scheme_build update and removed modules components without proper id_module. * networkmap.php: Another foreach() notice fixed. * upgrade.php: Moved to contrib branch in SVN. Old pandora SQL conversion files, deleted (was present in its branches). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1049 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 21 + pandora_console/include/functions.php | 3 +- pandora_console/include/functions_db.php | 4 +- .../include/functions_extensions.php | 3 +- pandora_console/include/functions_html.php | 3 +- .../include/functions_reporting.php | 3 +- .../include/functions_reporting_pdf.php | 3 +- .../include/functions_visual_map.php | 3 +- pandora_console/install.php | 58 ++- .../operation/agentes/networkmap.php | 1 + pandora_console/pandoradb.sql | 12 - pandora_console/pandoradb_12_to_13.sql | 202 -------- pandora_console/pandoradb_data.sql | 14 +- pandora_console/pandoradbdata_12_to_13.sql | 119 ----- pandora_console/reporting/fgraph.php | 3 +- pandora_console/upgrade.php | 477 ------------------ 16 files changed, 87 insertions(+), 842 deletions(-) delete mode 100644 pandora_console/pandoradb_12_to_13.sql delete mode 100644 pandora_console/pandoradbdata_12_to_13.sql delete mode 100644 pandora_console/upgrade.php diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index eb6e3c82d5..78af084568 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,24 @@ +2008-09-01 Sancho lerena + + * include/, fgraph.php: Moved licence of libraries to LGPL. + + * install.php: Added dependency check for several new includes + from pear (xml_rpc and DB), also graphviz twopi binary and check + in step1 for a writable config.php and ./include dir. Some other + minor fixes (esthetic). + + * pandoradb.sql: Table tagent_data_image was still there. This + comes with next version (I hope), not this one. + + * pandoradb_data.sql: db_scheme_build update and removed modules + components without proper id_module. + + * networkmap.php: Another foreach() notice fixed. + + * upgrade.php: Moved to contrib branch in SVN. + + Old pandora SQL conversion files, deleted (was present in its branches). + 2008-08-28 Evi Vanoost * operation/events/events.php: Updated the queries and fixed some minor diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 7ee9dccbfa..85ad339473 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -6,8 +6,9 @@ // Please see http://pandora.sourceforge.net for full contribution list // This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License +// modify it under the terms of the GNU Lesser General Public License (LGPL) // as published by the Free Software Foundation for version 2. +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index cb0555e8c6..31fbef8416 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -6,8 +6,9 @@ // Please see http://pandora.sourceforge.net for full contribution list // This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License +// modify it under the terms of the GNU Lesser General Public License (LGPL) // as published by the Free Software Foundation for version 2. +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -23,6 +24,7 @@ * * @return 0 on success */ + function check_login () { global $config; if (! isset ($config["homedir"])) { diff --git a/pandora_console/include/functions_extensions.php b/pandora_console/include/functions_extensions.php index b04e4fd834..2adc7c7cdd 100644 --- a/pandora_console/include/functions_extensions.php +++ b/pandora_console/include/functions_extensions.php @@ -6,8 +6,9 @@ // Please see http://pandora.sourceforge.net for full contribution list // This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License +// modify it under the terms of the GNU Lesser General Public License (LGPL) // as published by the Free Software Foundation for version 2. +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 5919f466ea..f60a69f8ef 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -6,8 +6,9 @@ // Please see http://pandora.sourceforge.net for full contribution list // This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License +// modify it under the terms of the GNU Lesser General Public License (LGPL) // as published by the Free Software Foundation for version 2. +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 494592aecb..feeea65684 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -6,8 +6,9 @@ // Please see http://pandora.sourceforge.net for full contribution list // This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License +// modify it under the terms of the GNU Lesser General Public License (LGPL) // as published by the Free Software Foundation for version 2. +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/pandora_console/include/functions_reporting_pdf.php b/pandora_console/include/functions_reporting_pdf.php index 1f4e74ccaf..31b800dfeb 100644 --- a/pandora_console/include/functions_reporting_pdf.php +++ b/pandora_console/include/functions_reporting_pdf.php @@ -6,8 +6,9 @@ // Please see http://pandora.sourceforge.net for full contribution list // This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License +// modify it under the terms of the GNU Lesser General Public License (LGPL) // as published by the Free Software Foundation for version 2. +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 22d214a962..4547a28fb6 100644 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -6,8 +6,9 @@ // Please see http://pandora.sourceforge.net for full contribution list // This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License +// modify it under the terms of the GNU Lesser General Public License (LGPL) // as published by the Free Software Foundation for version 2. +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/pandora_console/install.php b/pandora_console/install.php index 4400a24192..afd9b04dfa 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -94,6 +94,29 @@ function check_generic ( $ok, $label ){ echo ""; } +function check_writable ( $fullpath, $label ){ + echo ""; + echo " $label "; + echo ""; + if (file_exists($fullpath)) + if (is_writable($fullpath)){ + echo " "; + echo ""; + return 0; + } else { + echo " "; + echo ""; + return 1; + } + else { + echo " "; + echo ""; + return 1; + } + +} + + function check_variable ( $var, $value, $label, $mode ){ echo ""; echo " $label "; @@ -150,7 +173,7 @@ function install_step1() { echo "

Pandora FMS installation wizard. Step #1 of 4

-
+

Welcome to Pandora FMS 2.0 installation Wizard

This wizard helps you to quick install Pandora FMS console in your system.

@@ -163,6 +186,12 @@ function install_step1() { echo "
Warning: You already have a config.php file. Configuration and database would be overwritten if you continued.
"; } + echo ""; + $writable = check_writable ( "include", "Checking if ./config is writable"); + if (file_exists("include/config.php")) + $writable += check_writable ( "include/config.php", "Checking if include/config.php is writable"); + echo "
"; + echo "
Warning: This installer will overwrite and destroy your existing Pandora FMS configuration and Database. Before continue, please be sure that you have no valuable Pandora FMS data in your Database.
@@ -179,13 +208,17 @@ function install_step1() {
-
- - +
"; + if ($writable == 0) + echo " + "; + else + echo "
ERROR:You need to setup permissions to be able to write in ./include directory
"; + echo "
- Pandora FMS is a Free Software project registered at + Pandora FMS is an OpenSource Software project registered at SourceForge
"; @@ -196,7 +229,7 @@ function install_step2() { echo "

Pandora FMS console installation wizard. Step #2 of 4

-
+
"; echo "

Checking software dependencies

"; echo ""; @@ -208,7 +241,10 @@ function install_step2() { $res += check_extension("session","PHP session extension"); $res += check_extension("gettext","PHP gettext extension"); $res += check_include("PEAR.php","PEAR PHP Library"); - //$res += check_exists ("/usr/bin/pdflatex","PDF Latex in /usr/bin/pdflatex"); + $res += check_include("DB.php","PEAR:DB PHP Library"); + $res += check_include("XML/RPC.php","PEAR XML/RPC.php PHP Library"); + $res += check_exists ("/usr/bin/twopi","Graphviz Binary"); + echo "
@@ -231,7 +267,7 @@ function install_step2() {
- Pandora FMS is a Free Software project registered at + Pandora FMS is an OpenSource Software project registered at SourceForge
"; @@ -300,7 +336,7 @@ function install_step3() {
- Pandora FMS is a Free Software project registered at + Pandora FMS is an OpenSource Software project registered at SourceForge
"; @@ -422,7 +458,7 @@ $config["homeurl"]="'.$url.'"; // Base URL
- Pandora FMS is a Free Software project registered at + Pandora FMS is an OpenSource Software project registered at SourceForge
"; @@ -451,7 +487,7 @@ function install_step5() {
- Pandora FMS is a Free Software project registered at + Pandora FMS is an OpenSource Software project registered at SourceForge
"; diff --git a/pandora_console/operation/agentes/networkmap.php b/pandora_console/operation/agentes/networkmap.php index 6299ecbe42..48311a590e 100644 --- a/pandora_console/operation/agentes/networkmap.php +++ b/pandora_console/operation/agentes/networkmap.php @@ -46,6 +46,7 @@ function generate_dot ($simple = 0, $font_size) { // Get agent data $agents = get_db_all_rows_sql ('SELECT id_grupo, nombre, id_os, id_parent, id_agente FROM tagente WHERE disabled = 0 ORDER BY id_grupo'); + if ($agents) foreach ($agents as $agent) { if (give_acl ($config["id_user"], $agent["id_grupo"], "AR") == 0) continue; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index bb9720dcce..5f8f363e3d 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -76,18 +76,6 @@ CREATE TABLE IF NOT EXISTS `tagente_datos` ( KEY `data_index1` (`id_agente_modulo`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ; -CREATE TABLE IF NOT EXISTS `tagent_data_image` ( - `id` bigint(20) unsigned NOT NULL auto_increment, - `id_agent_module`int(10) unsigned NOT NULL default '0', - `id_agent` int(10) unsigned NOT NULL default '0', - `blob` mediumblob NOT NULL, - `filename` varchar(255) default '', - `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', - `utimestamp` int(20) unsigned default '0', - PRIMARY KEY (`id`), - KEY `img_idx1` (`id_agent`,`id_agent_module`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - CREATE TABLE IF NOT EXISTS `tagente_datos_inc` ( `id_adi` int(10) unsigned NOT NULL auto_increment, `id_agente_modulo` int(10) unsigned NOT NULL default '0', diff --git a/pandora_console/pandoradb_12_to_13.sql b/pandora_console/pandoradb_12_to_13.sql deleted file mode 100644 index 1eefa6a929..0000000000 --- a/pandora_console/pandoradb_12_to_13.sql +++ /dev/null @@ -1,202 +0,0 @@ -ALTER TABLE tagent_access ADD column `utimestamp` bigint(20) NOT NULL default '0'; -ALTER TABLE tagente_datos MODIFY COLUMN `id_agente` mediumint(8) unsigned NOT NULL default '0'; -ALTER TABLE tagente_datos ADD column `utimestamp` int(10) unsigned default '0'; - -ALTER TABLE tagente_datos DROP key data_index_2; -ALTER TABLE tagente_datos DROP key data_index_3; -ALTER TABLE tagente_datos DROP key data_index_1; -ALTER TABLE tagente_datos ADD KEY `data_index2` (`id_agente`,`id_agente_modulo`); -ALTER TABLE tagente_datos_inc ADD column `utimestamp` int(10) unsigned default '0'; -ALTER TABLE tagente_datos_string ADD column `utimestamp` int(10) unsigned default '0'; -ALTER TABLE tagente_datos_string DROP KEY `data_string_index_3`; -ALTER TABLE tagente_estado ADD column `utimestamp` bigint(20) NOT NULL default '0'; -ALTER TABLE tagente_estado ADD column `current_interval` int(10) unsigned NOT NULL default '0'; -ALTER TABLE tagente_estado ADD column `running_by` int(10) unsigned NULL default 0; -ALTER TABLE tagente_estado ADD column `last_execution_try` bigint(20) NOT NULL default '0'; -ALTER TABLE tagente_modulo MODIFY COLUMN `flag` tinyint(3) unsigned default '1'; -ALTER TABLE tagente_modulo ADD COLUMN `id_modulo` int(11) unsigned NULL default 0; -ALTER TABLE tagente_modulo ADD KEY `tam_agente` (`id_agente`); - -ALTER TABLE talerta_agente_modulo ADD COLUMN `alert_text` varchar(255) default ''; -ALTER TABLE talerta_agente_modulo ADD COLUMN `disable` int(4) default '0'; -ALTER TABLE talerta_agente_modulo ADD COLUMN `time_from` TIME default '00:00:00'; -ALTER TABLE talerta_agente_modulo ADD COLUMN `time_to` TIME default '00:00:00'; - -ALTER TABLE talerta_agente_modulo MODIFY COLUMN `dis_max` double(18,2) default NULL; -ALTER TABLE talerta_agente_modulo MODIFY COLUMN `dis_min` double(18,2) default NULL; -ALTER TABLE tagente_modulo ADD COLUMN `alert_text` varchar(255) default ''; -ALTER TABLE tagente_modulo ADD COLUMN `disable` int(4) default '0'; -ALTER TABLE tagente_modulo ADD COLUMN `time_from` int(8) default '0'; -ALTER TABLE tagente_modulo ADD COLUMN `time_to` int(8) default '0'; -ALTER TABLE `tagente_modulo` DROP PRIMARY KEY ,ADD PRIMARY KEY ( `id_agente_modulo` , `id_agente` ); -ALTER TABLE tevento ADD COLUMN `utimestamp` bigint(20) unsigned NOT NULL default '0'; -ALTER TABLE tgrupo ADD COLUMN `parent` tinyint(4) NOT NULL default '-1'; -ALTER TABLE tgrupo ADD COLUMN `disabled` tinyint(4) NOT NULL default '0'; -ALTER TABLE tincidencia ADD COLUMN `notify_email` TINYINT UNSIGNED NOT NULL DEFAULT 0; -ALTER TABLE tlanguage MODIFY COLUMN `name` varchar(100) NOT NULL default ''; -ALTER TABLE tserver ADD COLUMN `recon_server` tinyint(3) unsigned NOT NULL default '0'; -ALTER TABLE tserver ADD COLUMN `version` varchar(20) NOT NULL default ''; -ALTER TABLE tsesion ADD COLUMN `utimestamp` bigint(20) unsigned NOT NULL default '0'; - -CREATE TABLE `taddress` ( - `id_a` bigint(20) unsigned NOT NULL auto_increment, - `ip` varchar(15) NOT NULL default '', - `ip_pack` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`id_a`) -) ENGINE=InnoDB; - -CREATE TABLE `taddress_agent` ( - `id_ag` bigint(20) unsigned NOT NULL auto_increment, - `id_a` bigint(20) unsigned NOT NULL default '0', - `id_agent` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`id_ag`) -) ENGINE=InnoDB; - -CREATE TABLE `tmodule` ( - `id_module` int(11) unsigned NOT NULL auto_increment, - `name` varchar(100) NOT NULL default '', - PRIMARY KEY (`id_module`) -) ENGINE=InnoDB; - -CREATE TABLE `tnetwork_component` ( - `id_nc` mediumint(12) unsigned NOT NULL auto_increment, - `name` varchar(50) NOT NULL, - `description` varchar(250) default NULL, - `id_group` mediumint(9) NOT NULL default '1', - `type` smallint(6) NOT NULL default '6', - `max` bigint(20) NOT NULL default '0', - `min` bigint(20) NOT NULL default '0', - `module_interval` mediumint(8) unsigned NOT NULL default '0', - `tcp_port` int(10) unsigned NOT NULL default '0', - `tcp_send` varchar(250) NOT NULL, - `tcp_rcv` varchar(250) NOT NULL default 'NULL', - `snmp_community` varchar(250) NOT NULL default 'NULL', - `snmp_oid` blob NOT NULL, - `id_module_group` tinyint(4) NOT NULL default '0', - PRIMARY KEY (`id_nc`) -) ENGINE=InnoDB; - - -CREATE TABLE `tnetwork_component_group` ( - `id_sg` mediumint(8) unsigned NOT NULL auto_increment, - `name` varchar(200) NOT NULL default '', - `parent` mediumint(9) NOT NULL default '0', - PRIMARY KEY (`id_sg`) -) ENGINE=InnoDB; - - -CREATE TABLE `tnetwork_profile` ( - `id_np` mediumint(8) unsigned NOT NULL auto_increment, - `name` varchar(100) NOT NULL default '', - `description` varchar(250) default '', - PRIMARY KEY (`id_np`) -) ENGINE=InnoDB; - - -CREATE TABLE `tnetwork_profile_component` ( - `id_npc` mediumint(8) unsigned NOT NULL auto_increment, - `id_nc` mediumint(8) unsigned NOT NULL default '0', - `id_np` mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (`id_npc`) -) ENGINE=InnoDB; - -CREATE TABLE `trecon_task` ( - `id_rt` int(10) unsigned NOT NULL auto_increment, - `name` varchar(100) NOT NULL default '', - `description` varchar(250) NOT NULL default '', - `type` tinyint(3) unsigned NOT NULL default '0', - `subnet` varchar(64) NOT NULL default '', - `id_network_server` int(10) unsigned NOT NULL default '0', - `id_network_profile` int(10) unsigned NOT NULL default '0', - `create_incident` tinyint(3) unsigned NOT NULL default '0', - `id_group` int(10) unsigned NOT NULL default '1', - `utimestamp` bigint(20) unsigned NOT NULL default '0', - `status` tinyint(4) NOT NULL default '0', - `interval_sweep` int(10) unsigned NOT NULL default '0', - `id_network_server_assigned` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`id_rt`) -) ENGINE=InnoDB; - - -CREATE TABLE `tnews` ( - `id_news` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, - `author` varchar(255) NOT NULL DEFAULT '', - `subject` varchar(255) NOT NULL DEFAULT '', - `text` TEXT NOT NULL, - `timestamp` DATETIME NOT NULL DEFAULT 0, - PRIMARY KEY(`id_news`) -) ENGINE = InnoDB; - -CREATE TABLE `tgraph` ( - `id_graph` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, - `id_user` varchar(100) NOT NULL default '', - `name` varchar(150) NOT NULL default '', - `description` TEXT NOT NULL, - `period` int(11) NOT NULL default '0', - `width` smallint(5) UNSIGNED NOT NULL DEFAULT 0, - `height` smallint(5) UNSIGNED NOT NULL DEFAULT 0, - `private` tinyint(1) UNSIGNED NOT NULL default 0, - `events` tinyint(1) UNSIGNED NOT NULL default 0, - PRIMARY KEY(`id_graph`) -) ENGINE = InnoDB; - -CREATE TABLE `tgraph_source` ( - `id_gs` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, - `id_graph` int(11) NOT NULL default 0, - `id_agent_module` int(11) NOT NULL default 0, - `weight` smallint(5) UNSIGNED NOT NULL DEFAULT 0, - PRIMARY KEY(`id_gs`) -) ENGINE = InnoDB; - - -CREATE TABLE `treport` ( - `id_report` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, - `id_user` varchar(100) NOT NULL default '', - `name` varchar(150) NOT NULL default '', - `description` TEXT NOT NULL, - `private` tinyint(1) UNSIGNED NOT NULL default 0, - PRIMARY KEY(`id_report`) -) ENGINE = InnoDB; - -CREATE TABLE `treport_content` ( - `id_rc` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, - `id_report` INTEGER UNSIGNED NOT NULL default 0, - `id_gs` INTEGER UNSIGNED NOT NULL default 0, - `id_agent_module` int(11) NOT NULL default 0, - `type` tinyint(1) UNSIGNED NOT NULL default 0, - `period` int(11) NOT NULL default 0, - `sla_max` int(11) NOT NULL default 0, - `sla_min` int(11) NOT NULL default 0, - `sla_limit` int(11) NOT NULL default 0, - PRIMARY KEY(`id_rc`) -) ENGINE = InnoDB; - -CREATE TABLE `tlayout` ( - `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, - `name` varchar(50) NOT NULL, - `id_group` INTEGER UNSIGNED NOT NULL, - `background` varchar(200) NOT NULL, - `fullscreen` tinyint(1) UNSIGNED NOT NULL default 0, - `height` INTEGER UNSIGNED NOT NULL default 0, - `width` INTEGER UNSIGNED NOT NULL default 0, - PRIMARY KEY(`id`) -) ENGINE = InnoDB; - -CREATE TABLE `tlayout_data` ( - `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, - `id_layout` INTEGER UNSIGNED NOT NULL default 0, - `pos_x` INTEGER UNSIGNED NOT NULL default 0, - `pos_y` INTEGER UNSIGNED NOT NULL default 0, - `height` INTEGER UNSIGNED NOT NULL default 0, - `width` INTEGER UNSIGNED NOT NULL default 0, - `label` varchar(200) DEFAULT "", - `image` varchar(200) DEFAULT "", - `type` tinyint(1) UNSIGNED NOT NULL default 0, - `period` INTEGER UNSIGNED NOT NULL default 3600, - `id_agente_modulo` mediumint(8) unsigned NOT NULL default '0', - `id_layout_linked` INTEGER unsigned NOT NULL default '0', - `parent_item` INTEGER UNSIGNED NOT NULL default 0, - `label_color` varchar(20) DEFAULT "", - `no_link_color` tinyint(1) UNSIGNED NOT NULL default 0, - PRIMARY KEY(`id`) -) ENGINE = InnoDB; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 7962a451d2..3f88b76be7 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -51,7 +51,7 @@ INSERT INTO `tconfig` VALUES (6,'graph_res','5'), (7,'step_compact','1'), (8,'db_scheme_version','2.0'), -(9,'db_scheme_build','PD80822'), +(9,'db_scheme_build','PD80901'), (13,'show_unknown','0'), (14,'show_lastalerts','1'), (15,'style','pandora'), @@ -255,19 +255,7 @@ INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `t INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`) VALUES (51,'OS Raw Interrupts','Get system raw interrupts from SO',13,16,0,0,180,0,'','','public','UCD-SNMP-MIB::ssRawInterrupts.0',4,2); INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`) VALUES (52,'OS IO Signals sent','IO Signals sent by Kernel',13,16,0,0,180,0,'','','public','UCD-SNMP-MIB::ssIOSent.0',4,2); INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`) VALUES (53,'System Uptime','Sistem uptime in timeticks',1,15,0,0,180,0,'','','public','HOST-RESOURCES-MIB::hrSystemUptime.0',4,2); -INSERT INTO `tnetwork_component` VALUES (54,'System IO Recv','Linux System IO Recv ',5,15,0,0,180,0,'','','public','.1.3.6.1.4.1.2021.11.6.0',4,2,'','','',0); -INSERT INTO `tnetwork_component` VALUES (55,'System SwapIn ','Linux System Swap In',5,15,0,0,180,0,'','','public','.1.3.6.1.4.1.2021.11.3.0',1,2,'','','',0); -INSERT INTO `tnetwork_component` VALUES (56,'System Buffer Memory','Linux System Buffer Memory (used as available\nmemory)',5,15,0,0,180,0,'','','public','.1.3.6.1.4.1.2021.4.14.0',4,2,'','','',0); -INSERT INTO `tnetwork_component` VALUES (57,'System Cached Memory','Linux System Cached Memory (used as free\nmemory)',5,15,0,0,180,0,'','','public','.1.3.6.1.4.1.2021.4.15.0',4,2,'','','',0); -INSERT INTO `tnetwork_component` VALUES (58,'System Processes','Total system process on any host',12,15,0,0,180,0,'','','public','.1.3.6.1.2.1.25.1.6.0',4,2,'','','',0); -INSERT INTO `tnetwork_component` VALUES (59,'CPU User','Linux User CPU Usage (%)',5,15,0,0,180,0,'','','public','.1.3.6.1.4.1.2021.11.9.0',4,2,'','','',0); -INSERT INTO `tnetwork_component` VALUES (60,'CPU System','Linux System CPU usage',5,15,0,0,180,0,'','','public','.1.3.6.1.4.1.2021.11.10.0',4,2,'','','',0); -INSERT INTO `tnetwork_component` VALUES (177,'System Context Change','Linux System Context changes ',5,15,0,0,180,0,'','','public','.1.3.6.1.4.1.2021.11.8.0',4,2,'','','',0); -INSERT INTO `tnetwork_component` VALUES (178,'System Interrupts','Linux system interrupts ',5,15,0,0,180,0,'','','public','.1.3.6.1.4.1.2021.11.7.0',4,2,'','','',0); INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`) VALUES (176,'Catalyst Free Mem','Taken from ftp://ftp.cisco.com/pub/mibs/oid/OLD-CISCO-MEMORY-MIB.oid',2,15,0,0,180,0,'','','public','1.3.6.1.4.1.9.2.1.8',4,2); -INSERT INTO `tnetwork_component` VALUES (61,'GigabitEthernet1/0/1 Status','',2,18,0,0,180,0,'','','public','.1.3.6.1.2.1.2.2.1.8.10101',2,2,'','','',0); -INSERT INTO `tnetwork_component` VALUES (62,'GigabitEthernet1/0/2 Status','',2,18,0,0,180,0,'','','public','.1.3.6.1.2.1.2.2.1.8.10102',2,2,'','','',0); -INSERT INTO `tnetwork_component` VALUES (63,'GigabitEthernet1/0/3 Status','',2,18,0,0,180,0,'','','public','.1.3.6.1.2.1.2.2.1.8.10103',2,2,'','','',0); -- WMI components INSERT INTO `tnetwork_component` (`id_nc`, `name`, `description`, `id_group`, `type`, `max`, `min`, `module_interval`, `tcp_port`, `tcp_send`, `tcp_rcv`, `snmp_community`, `snmp_oid`, `id_module_group`, `id_modulo`, `plugin_user`, `max_timeout`) VALUES (200, 'CPU load', 'CPU0 load average', 14, 1, 100, 0, 300, 1, '', '', '', 'SELECT LoadPercentage from Win32_Processor WHERE DeviceID = "CPU0"', 1, 6, 'Administrator', 10); diff --git a/pandora_console/pandoradbdata_12_to_13.sql b/pandora_console/pandoradbdata_12_to_13.sql deleted file mode 100644 index 39d3a062e4..0000000000 --- a/pandora_console/pandoradbdata_12_to_13.sql +++ /dev/null @@ -1,119 +0,0 @@ - -UPDATE tconfig SET value = '1.3' WHERE token = 'db_scheme_version'; -UPDATE tconfig SET value = '1.3' WHERE token = 'db_scheme_build'; -INSERT INTO tconfig (token, value) VALUES ('show_unknown','0'); -INSERT INTO tconfig (token, value) VALUES ('show_lastalerts','1'); -INSERT INTO tconfig (token, value) VALUES ('style','pandora'); - - -UPDATE tconfig_os SET icon_name = 'so_aix.png' WHERE icon_name = 'so_aix.gif'; -UPDATE tconfig_os SET icon_name = 'so_linux.png' WHERE icon_name = 'so_linux.gif'; -UPDATE tconfig_os SET icon_name = 'so_solaris.png' WHERE icon_name = 'so_solaris.gif'; -UPDATE tconfig_os SET icon_name = 'so_hpux.png' WHERE icon_name = 'so_hpux.gif'; -UPDATE tconfig_os SET icon_name = 'so_beos.png' WHERE icon_name = 'so_beos.gif'; -UPDATE tconfig_os SET icon_name = 'so_cisco.png' WHERE icon_name = 'so_cisco.gif'; -UPDATE tconfig_os SET icon_name = 'so_mac.png' WHERE icon_name = 'so_mac.gif'; -UPDATE tconfig_os SET icon_name = 'so_win.png' WHERE icon_name = 'so_win.gif'; -UPDATE tconfig_os SET icon_name = 'so_other.png' WHERE icon_name = 'so_other.gif'; -UPDATE tconfig_os SET icon_name = 'network.png' WHERE icon_name = 'network.gif'; - -UPDATE tgrupo SET icon = 'world', parent = 0, disabled = 0 WHERE id_grupo = 1; -UPDATE tgrupo SET icon = 'server_database', parent = 0, disabled = 0 WHERE id_grupo = 2; -UPDATE tgrupo SET icon = 'eye', parent = 0, disabled = 0 WHERE id_grupo = 3; -UPDATE tgrupo SET icon = 'firewall', parent = 0, disabled = 0 WHERE id_grupo = 4; -UPDATE tgrupo SET icon = 'database_gear', parent = 0, disabled = 0 WHERE id_grupo = 8; -UPDATE tgrupo SET icon = 'transmit', parent = 0, disabled = 0 WHERE id_grupo = 9; -UPDATE tgrupo SET icon = 'house', parent = 0, disabled = 0 WHERE id_grupo = 10; -UPDATE tgrupo SET icon = 'computer', parent = 0, disabled = 0 WHERE id_grupo = 11; -UPDATE tgrupo SET icon = 'applications', parent = 0, disabled = 0 WHERE id_grupo = 12; - -INSERT INTO `tnetwork_component` VALUES (3,'Sysname','Get name of system using SNMP standard MIB',1,17,0,0,900,0,'','','public','.1.3.6.1.2.1.1.1.0',1); -INSERT INTO `tnetwork_component` VALUES (19,'Power #1','PowerSupply #1 status',6,18,0,0,300,0,'','','public',' .1.3.6.1.4.1.2334.2.1.5.8.0',4); -INSERT INTO `tnetwork_component` VALUES (20,'Power #2','PowerSupply #2 status',6,18,0,0,300,0,'','','public',' .1.3.6.1.4.1.2334.2.1.5.10.0',4); -INSERT INTO `tnetwork_component` VALUES (22,'HSRP Status','Get status of HSRP',2,18,0,0,300,0,'','','public','1.3.6.1.4.1.9.9.106.1.2.1.1.15.12.106',2); -INSERT INTO `tnetwork_component` VALUES (24,'NIC #1 status','Status of NIC#1',10,18,0,0,180,0,'','','public','.1.3.6.1.2.1.2.2.1.8.1',2); -INSERT INTO `tnetwork_component` VALUES (25,'NIC #2 status','Status of NIC #2',10,18,0,0,180,0,'','','public','.1.3.6.1.2.1.2.2.1.8.2',2); -INSERT INTO `tnetwork_component` VALUES (26,'NIC #3 status','Status of NIC #3',10,18,0,0,180,0,'','','public','.1.3.6.1.2.1.2.2.1.8.3',2); -INSERT INTO `tnetwork_component` VALUES (27,'NIC #1 outOctects','Output throughtput on Interface #1',10,16,0,0,180,0,'','','public','.1.3.6.1.2.1.2.2.1.16.1',2); -INSERT INTO `tnetwork_component` VALUES (28,'NIC #2 outOctects','Output troughtput on interface #2',10,16,0,0,180,0,'','','public','.1.3.6.1.2.1.2.2.1.16.2',1); -INSERT INTO `tnetwork_component` VALUES (29,'NIC #3 outOctects','Output troughtput on Interface #3',10,16,0,0,180,0,'','','public','.1.3.6.1.2.1.2.2.1.16.3',2); -INSERT INTO `tnetwork_component` VALUES (30,'NIC #1 inOctects','Input troughtput on Interface #1',10,16,0,0,180,0,'','','public','.1.3.6.1.2.1.2.2.1.10.1',2); -INSERT INTO `tnetwork_component` VALUES (31,'NIC #2 inOctects','Input throughtput for interface #2',10,16,0,0,180,0,'','NULL','public','.1.3.6.1.2.1.2.2.1.10.2',2); -INSERT INTO `tnetwork_component` VALUES (32,'NIC #3 inOctects','Input throught on interface #3',10,16,0,0,180,0,'','','public','.1.3.6.1.2.1.2.2.1.10.3',2); -INSERT INTO `tnetwork_component` VALUES (34,'Host Alive','Check if host is alive using ICMP ping check.',10,6,0,0,120,0,'','','','',2); -INSERT INTO `tnetwork_component` VALUES (36,'Host Latency','Get host network latency in miliseconds, using ICMP.',10,7,0,0,180,0,'','','','',2); -INSERT INTO `tnetwork_component` VALUES (37,'Check HTTP Server','Test APACHE2 HTTP service remotely (Protocol response, not only openport)',10,9,0,0,300,80,'GET / HTTP/1.0^M^M','HTTP/1.1 200 OK','','',3); -INSERT INTO `tnetwork_component` VALUES (38,'Check FTP Server','Check FTP protocol, not only check port.',10,9,0,0,300,21,'QUIT','221','','',3); -INSERT INTO `tnetwork_component` VALUES (39,'Check SSH Server','Checks port 22 is opened',10,9,0,0,300,22,'','','','',2); -INSERT INTO `tnetwork_component` VALUES (40,'Check Telnet server','Check telnet port',10,9,0,0,300,23,'','','','',2); -INSERT INTO `tnetwork_component` VALUES (41,'Check SMTP server','Check if SMTP port it's open',10,9,0,0,300,25,'','','','',2); -INSERT INTO `tnetwork_component` VALUES (42,'Check POP3 server','Check POP3 port.',10,9,0,0,300,110,'','','','',2); -INSERT INTO `tnetwork_component` VALUES (43,'NIC #7 outOctects','Get outcoming octects from NIC #7',10,16,0,0,180,0,'','','public','.1.3.6.1.2.1.2.2.1.16.7',2); -INSERT INTO `tnetwork_component` VALUES (44,'NIC #7 inOctects','Get incoming octects from NIC #7',10,16,0,0,180,0,'','','public','.1.3.6.1.2.1.2.2.1.10.7',2); -INSERT INTO `tnetwork_component` VALUES (45,'NIC #4 Status','Get status of NIC #4',10,18,0,0,180,0,'','','public','.1.3.6.1.2.1.2.2.1.8.4',2); -INSERT INTO `tnetwork_component` VALUES (46,'NIC #5 Status','Get status of NIC #5',10,18,0,0,180,0,'','','public','.1.3.6.1.2.1.2.2.1.8.5',2); -INSERT INTO `tnetwork_component` VALUES (47,'NIC #6 Status','Get status of NIC #6',10,18,0,0,180,0,'','','public','.1.3.6.1.2.1.2.2.1.8.6',2); -INSERT INTO `tnetwork_component` VALUES (48,'NIC #7 Status','Get status of NIC #7',10,18,0,0,180,0,'','','public','.1.3.6.1.2.1.2.2.1.8.7',2); -INSERT INTO `tnetwork_component` VALUES (49,'CPU User','Linux User CPU Usage (%)',5,15,0,0,180,0,'','','public','.1.3.6.1.4.1.2021.11.9.0',4); -INSERT INTO `tnetwork_component` VALUES (50,'CPU System','Linux System CPU usage',5,15,0,0,180,0,'','','public','.1.3.6.1.4.1.2021.11.10.0',4); -INSERT INTO `tnetwork_component` VALUES (51,'System Context Change','Linux System Context changes ',5,15,0,0,180,0,'','','public','.1.3.6.1.4.1.2021.11.8.0',4); -INSERT INTO `tnetwork_component` VALUES (52,'System Interrupts','Linux system interrupts ',5,15,0,0,180,0,'','','public','.1.3.6.1.4.1.2021.11.7.0',4); -INSERT INTO `tnetwork_component` VALUES (53,'Sytem IO Sent','Linux System IO Sent ',5,15,0,0,180,0,'','','public','.1.3.6.1.4.1.2021.11.5.0',4); -INSERT INTO `tnetwork_component` VALUES (54,'System IO Recv','Linux System IO Recv ',5,15,0,0,180,0,'','','public','.1.3.6.1.4.1.2021.11.6.0',4); -INSERT INTO `tnetwork_component` VALUES (55,'System SwapIn ','Linux System Swap In',5,15,0,0,180,0,'','','public','.1.3.6.1.4.1.2021.11.3.0',1); -INSERT INTO `tnetwork_component` VALUES (56,'System Buffer Memory','Linux System Buffer Memory (used as available memory)',5,15,0,0,180,0,'','','public','.1.3.6.1.4.1.2021.4.14.0',4); -INSERT INTO `tnetwork_component` VALUES (57,'System Cached Memory','Linux System Cached Memory (used as free memory)',5,15,0,0,180,0,'','','public','.1.3.6.1.4.1.2021.4.15.0',4); -INSERT INTO `tnetwork_component` VALUES (58,'System Processes','Total system process on any host',12,15,0,0,180,0,'','','public','.1.3.6.1.2.1.25.1.6.0',4); - -INSERT INTO `tnetwork_component_group` VALUES (1,'General group',0); -INSERT INTO `tnetwork_component_group` VALUES (2,'Cisco MIBs',10); -INSERT INTO `tnetwork_component_group` VALUES (3,'Nortel MIBS',10); -INSERT INTO `tnetwork_component_group` VALUES (4,'3COM MIBs',10); -INSERT INTO `tnetwork_component_group` VALUES (5,'UNIX MIBs',12); -INSERT INTO `tnetwork_component_group` VALUES (6,'Packetshaper MIBs',10); -INSERT INTO `tnetwork_component_group` VALUES (7,'Nortel BPS 2000 MIBs',3); -INSERT INTO `tnetwork_component_group` VALUES (8,'Cisco Catalyst3750 MIBs',2); -INSERT INTO `tnetwork_component_group` VALUES (9,'Cisco AP120+',2); -INSERT INTO `tnetwork_component_group` VALUES (10,'Network Management',0); -INSERT INTO `tnetwork_component_group` VALUES (11,'Microsoft Windows MIB',12); -INSERT INTO `tnetwork_component_group` VALUES (12,'Operating Systems',0); - -UPDATE ttipo_modulo SET icon = 'mod_data.png' WHERE icon = 'mod_data.gif'; -UPDATE ttipo_modulo SET icon = 'mod_proc.png' WHERE icon = 'mod_proc.gif'; -UPDATE ttipo_modulo SET icon = 'mod_string.png' WHERE icon = 'mod_string.gif'; -UPDATE ttipo_modulo SET icon = 'mod_data_inc.png' WHERE icon = 'mod_data_inc.gif'; -UPDATE ttipo_modulo SET icon = 'mod_icmp_proc.png' WHERE icon = 'mod_icmp_proc.gif'; -UPDATE ttipo_modulo SET icon = 'mod_icmp_data.png' WHERE icon = 'mod_icmp_data.gif'; -UPDATE ttipo_modulo SET icon = 'mod_tcp_data.png' WHERE icon = 'mod_tcp_data.gif'; -UPDATE ttipo_modulo SET icon = 'mod_tcp_proc.png' WHERE icon = 'mod_tcp_proc.gif'; -UPDATE ttipo_modulo SET icon = 'mod_tcp_string.png' WHERE icon = 'mod_tcp_string.gif'; -UPDATE ttipo_modulo SET icon = 'mod_tcp_inc.png' WHERE icon = 'mod_tcp_inc.gif'; -UPDATE ttipo_modulo SET icon = 'mod_udp_proc.png' WHERE icon = 'mod_udp_proc.gif'; -UPDATE ttipo_modulo SET icon = 'mod_snmp_data.png' WHERE icon = 'mod_snmp_data.gif'; -UPDATE ttipo_modulo SET icon = 'mod_snmp_inc.png' WHERE icon = 'mod_snmp_inc.gif'; -UPDATE ttipo_modulo SET icon = 'mod_snmp_string.png' WHERE icon = 'mod_snmp_string.gif'; -UPDATE ttipo_modulo SET icon = 'mod_snmp_proc.png' WHERE icon = 'mod_snmp_proc.gif'; - -INSERT INTO `tnews` VALUES (1,'admin','Welcome to Pandora FMS 1.3.1!','This is the new Pandora FMS Console. A lot of new features have been added since last version. Please read the documentation about it, and feel free to test any option.\r\n\r\nThe Pandora FMS Team.','2007-06-22 13:03:20'); - -INSERT INTO `tnetwork_profile` VALUES (1,'SNMP Basic management','Basic SNMP management (only first interface)'); -INSERT INTO `tnetwork_profile` VALUES (2,'Basic Server','Check basic server services and network latency. This checks SSH, FTP and HTTP. Also a ICMP host alive check.'); -INSERT INTO `tnetwork_profile` VALUES (3,'Linux SNMP','Linux SNMP Management'); - -INSERT INTO `tnetwork_profile_component` VALUES (1,24,1); -INSERT INTO `tnetwork_profile_component` VALUES (2,27,1); -INSERT INTO `tnetwork_profile_component` VALUES (3,30,1); -INSERT INTO `tnetwork_profile_component` VALUES (4,37,2); -INSERT INTO `tnetwork_profile_component` VALUES (5,38,2); -INSERT INTO `tnetwork_profile_component` VALUES (6,39,2); -INSERT INTO `tnetwork_profile_component` VALUES (7,36,2); -INSERT INTO `tnetwork_profile_component` VALUES (8,34,2); -INSERT INTO `tnetwork_profile_component` VALUES (9,51,3); -INSERT INTO `tnetwork_profile_component` VALUES (10,52,3); -INSERT INTO `tnetwork_profile_component` VALUES (11,53,3); -INSERT INTO `tnetwork_profile_component` VALUES (12,54,3); -INSERT INTO `tnetwork_profile_component` VALUES (13,55,3); -INSERT INTO `tnetwork_profile_component` VALUES (14,56,3); -INSERT INTO `tnetwork_profile_component` VALUES (15,57,3); - - diff --git a/pandora_console/reporting/fgraph.php b/pandora_console/reporting/fgraph.php index ed6ddb0828..c1b5367738 100644 --- a/pandora_console/reporting/fgraph.php +++ b/pandora_console/reporting/fgraph.php @@ -6,8 +6,9 @@ // Please see http://pandora.sourceforge.net for full contribution list // This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License +// modify it under the terms of the GNU Lesser General Public License (LGPL) // as published by the Free Software Foundation for version 2. +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the diff --git a/pandora_console/upgrade.php b/pandora_console/upgrade.php deleted file mode 100644 index 0e7674d12d..0000000000 --- a/pandora_console/upgrade.php +++ /dev/null @@ -1,477 +0,0 @@ - - - - -Pandora FMS - Upgrade Wizard - - - - - - - - - - - - - - -INSTALLER IS NOT WORKING YET. PLEASE DO NOT USE"; -exit; - -error_reporting(0); - -function check_extension ( $ext, $label ){ - echo ""; - echo " $label "; - echo ""; - if (!extension_loaded($ext)){ - echo ""; - return 1; - } else { - echo ""; - return 0; - } - echo ""; -} - -function check_include ( $ext, $label ){ - echo ""; - echo " $label "; - echo ""; - if (!include($ext)){ - echo ""; - return 1; - } else { - echo ""; - return 0; - } - echo ""; -} - -function check_exists ( $file, $label ){ - echo ""; - echo " $label "; - echo ""; - if (!file_exists ($file)){ - echo " "; - return 1; - } else { - echo " "; - return 0; - } - echo ""; -} - -function check_generic ( $ok, $label ){ - echo ""; - echo " $label "; - echo ""; - if ($ok == 0 ){ - echo " "; - return 1; - } else { - echo " "; - return 0; - } - echo ""; -} - -function check_variable ( $var, $value, $label, $mode ){ - echo ""; - echo " $label "; - echo ""; - if ($mode == 1){ - if ($var >= $value){ - echo " "; - return 0; - } else { - echo " "; - return 1; - } - } elseif ($var == $value){ - echo " "; - return 0; - } else { - echo " "; - return 1; - } - echo ""; -} - -function migrate_data (){ - - check_generic (1, "Updating tagente_datos table"); - $sql1="SELECT * FROM tagente_datos WHERE utimestamp = 0 "; - $result1=mysql_query($sql1); - while ($row1=mysql_fetch_array($result1)){ - $id = $row1["id_agente_datos"]; - $timestamp = $row1["timestamp"]; - $utimestamp = strtotime($timestamp); - $sql2="UPDATE tagente_datos SET utimestamp = '$utimestamp' WHERE id_agente_datos = $id"; - mysql_query($sql2); - } - flush(); - - check_generic (1,"Updating tagente_datos_string table"); - $sql1="SELECT * FROM tagente_datos_string WHERE utimestamp = 0 "; - $result1=mysql_query($sql1); - while ($row1=mysql_fetch_array($result1)){ - $id = $row1["id_tagente_datos_string"]; - $timestamp = $row1["timestamp"]; - $utimestamp = strtotime($timestamp); - $sql2="UPDATE tagente_datos SET utimestamp = '$utimestamp' WHERE id_tagente_datos_string = $id"; - mysql_query($sql2); - } - flush(); - - check_generic (1,"Updating tagente_estado table"); - $sql1="SELECT * FROM tagente_estado WHERE utimestamp = 0"; - $result1=mysql_query($sql1); - while ($row1=mysql_fetch_array($result1)){ - $id = $row1["id_agente_estado"]; - $timestamp = $row1["timestamp"]; - $utimestamp = strtotime($timestamp); - $sql2="UPDATE tagente_estado SET utimestamp = '$utimestamp', last_execution_try = '$utimestamp' WHERE id_agente_estado = $id"; - mysql_query($sql2); - } - -} - -function parse_mysql_dump($url){ - if (file_exists($url)){ - $file_content = file($url); - $query = ""; - foreach($file_content as $sql_line){ - if(trim($sql_line) != "" && strpos($sql_line, "--") === false){ - $query .= $sql_line; - if(preg_match("/;[\040]*\$/", $sql_line)){ - if (!$result = mysql_query($query)) - return 0; - $query = ""; - } - } - } - return 1; - } else { - return 0; - } -} - -function random_name ($size){ - $temp = ""; - for ($a=0;$a< $size;$a++) - $temp = $temp. chr(rand(122,97)); - return $temp; -} - -function install_step1() { - echo " -
-

Pandora FMS upgrade wizard. Step #1 of 5

-
-
-

Welcome to Pandora FMS 1.3 upgrade Wizard

-

This wizard helps you to quick upgrade Pandora FMS console in your system. This tool is only to -upgrade Pandora FMS 1.2 to Pandora FMS 1.3

-

For more information, please refer to documentation.

- Pandora FMS Development Team -
Before start with upgrade process. Please STOP NOW all your Pandora FMS
"; - - if (file_exists("include/config.php")){ - echo "
Warning: You already have a config.php file in this directory, please backup and move it before continue.
"; - } - echo "
Warning: This upgrade tool will overwrite and change your existing Pandora FMS -Database and only could be used to upgrade fron Pandora FMS 1.2 to Pandora FMS 1.3. Before continue, please be sure that you -have made a SQL backup using mysqldump system tool as described in documentation.
"; - echo " -
-
-
- -
-
- -
-
-
- Pandora FMS is a Free Software project registered at SourceForge -
-
"; -} - - -function install_step2() { - echo " -
-

Pandora FMS upgrade wizard. Step #2 of 5

-
-
"; - echo "

Checking software dependencies

"; - echo ""; - $res = 0; - $res += check_variable(phpversion(),"4.3","PHP version >= 4.3.x",1); - $res += check_extension("mysql","PHP MySQL extension"); - //$res += check_extension("curl","PHP Curl extension"); - $res += check_extension("gd","PHP gd extension"); - $res += check_extension("snmp","PHP SNMP extension"); - $res += check_extension("session","PHP session extension"); - $res += check_include("PEAR.php","PEAR PHP Library"); - $step6 = is_writable("include"); - check_generic ($step6, "Write permissions to save config file in './include'"); - if ($step6 == 0) - $res++; - - //$res += check_exists ("/usr/bin/pdflatex","PDF Latex in /usr/bin/pdflatex"); - echo "
-
-
-
- -
-
"; - if ($res > 0) { - echo "
You have some uncomplete - dependencies. Please correct them or this wizard tool - will not be able to finish your installation. -

- Ignore it. Ignore it and go to Step #3"; - } else { - echo ""; - } - echo " -
-
-
- Pandora FMS is a Free Software project registered at - SourceForge -
-
"; -} - - -function install_step3() { - echo " -
-

Pandora FMS upgrade wizard. Step #3 of 5

-
-
-

Environment and database setup

-

- This wizard will transform your Pandora FMS database, and populate it with all the data needed to run for the first time, modifying existing data to be used by the new version. -

-

- You need a user to modify and create database schema, this is usually the existant pandora user, you could check on config.php file of Pandora FMS 1.2 installation. -

"; - echo "
-
DB User with privileges on MySQL
- - -
DB Password for this user
- - -
DB Hostname of MySQL
- - -
DB Name (pandora by default)
- - -
Full path to HTTP publication directory
- For example /var/www/pandora_console/. Needed for graphs and attachments. -
- - -
Full local URL to Pandora FMS Console
- For example http://localhost/pandora_console -
- - -
-
-
-
-
- -
-
-
- Pandora FMS is a Free Software project registered at - SourceForge -
-
"; -} - - -function install_step4() { - $pandora_config = "include/config.php"; - - if ( (! isset($_POST["user"])) || (! isset($_POST["dbname"])) || (! isset($_POST["host"])) || (! isset($_POST["pass"])) ) { - $dbpassword = ""; - $dbuser = ""; - $dbhost = ""; - $dbname = ""; - } else { - $dbpassword = $_POST["pass"]; - $dbuser = $_POST["user"]; - $dbhost = $_POST["host"]; - $dbname = $_POST["dbname"]; - if (isset($_POST["url"])) - $url = $_POST["url"]; - else - $url = "http://localhost"; - if (isset($_POST["path"])) - $path = $_POST["path"]; - else - $path = "/var/www"; - } - $everything_ok = 0; - $step1=0; $step2=0; $step3=0; - $step4=0; $step5=0; $step6=0; $step7=0; - echo "
-

Pandora FMS upgrade wizard. Step #4 of 5

-
-
-

Modifing database schema and adding data

This could take a while... please wait - "; - if (! mysql_connect ($dbhost,$dbuser,$dbpassword)) { - check_generic ( 0, "Connection with Database"); - } else { - check_generic ( 1, "Connection with Database"); - // Create schema - if (mysql_select_db($dbname)) - $step2 = 1; - else - $step2 = 0; - check_generic ($step2, "Opening database '$dbname'"); - flush(); - $step3 = (parse_mysql_dump("pandoradb_12_to_13.sql")); - check_generic ($step3, "Schema manipulation"); - flush(); - $step4 = parse_mysql_dump("pandoradbdata_12_to_13.sql"); - check_generic ($step4, "Populating new schema and converting data"); - flush(); - $cfgin = fopen ("include/config.inc.php","r"); - $cfgout = fopen ($pandora_config,"w"); - $config_contents = fread ($cfgin, filesize("include/config.inc.php")); - - $config_new = ''; - $step5 = fputs ($cfgout, $config_new); - $step5 = $step5 + fputs ($cfgout, $config_contents); - if ($step5 > 0) - $step5 = 1; - fclose ($cfgin); - fclose ($cfgout); - chmod ($pandora_config, 0600); - check_generic ($step5, "Created new config file at '".$pandora_config."'"); - - } - if (($step5 + $step4 + $step3 + $step2 ) == 4) { - $everything_ok = 1; - migrate_data(); - } - - echo "
-
-
- -
- -
"; - if ($everything_ok == 1) { - echo "

"; - } else { - echo "
There was some problems. Installation is not completed. -

Please correct failures, and restore original DB before trying again.

"; - - if (mysql_error() != "") - echo "
ERROR: ". mysql_error().".
"; - } - echo " -
-
-
- Pandora FMS is a Free Software project registered at - SourceForge -
-
"; - -} - -function install_step5() { - echo " -
-

Pandora FMS upgrade wizard. Finished

-
-
-

Upgrade complete!

-

You now must delete manually installer and upgrade tool ('install.php, upgrade.php') files for security before trying to access to your Pandora FMS console. -

Don't forget to check http://pandora.sourceforge.net for updates. -

Click here to access to your Pandora FMS console

-
-
-
-
-
-
-
- Pandora FMS is a Free Software project registered at - SourceForge -
-
"; -} - - -// --------------- -// Main page code -// --------------- - -if (! isset($_GET["step"])){ - install_step1(); -} else { - $step = $_GET["step"]; - switch ($step) { - case 2: install_step2(); - break; - case 3: install_step3(); - break; - case 4: install_step4(); - break; - case 5: install_step5(); - break; - case 6: install_step6(); - break; - } -} - -?> - -