From 5b65d42409f605eb924c18723a98817f2205a4ee Mon Sep 17 00:00:00 2001 From: slerena Date: Sun, 6 Apr 2008 22:18:33 +0000 Subject: [PATCH] 2008-04-09 Sancho Lerena * pandoradb.sql: New header. * pandoradb_data.sql: Removed /**/ comments, due problems with installer. * install.php: Updated installer for 2.0 version. * functions.php: Fix small problem in pandora_help() with icon. * estado_alertas.php: Do not show header "combined alert" if there is no complex alerts. * reporting_viewer.php: Round data for monitor SLA report. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@796 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 16 ++++++++++ pandora_console/include/config.inc.php | 14 ++++---- pandora_console/include/config.php | 28 ++++++++++------ pandora_console/include/functions.php | 2 +- pandora_console/install.php | 18 +++++------ .../operation/agentes/estado_alertas.php | 4 ++- .../operation/reporting/reporting_viewer.php | 2 +- pandora_console/pandoradb.sql | 18 +++++++++++ pandora_console/pandoradb_data.sql | 32 ++++++++++++++++--- 9 files changed, 103 insertions(+), 31 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 1aee538faa..267d96b1a6 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,19 @@ +2008-04-09 Sancho Lerena + + * pandoradb.sql: New header. + + * pandoradb_data.sql: Removed /**/ comments, due problems with + installer. + + * install.php: Updated installer for 2.0 version. + + * functions.php: Fix small problem in pandora_help() with icon. + + * estado_alertas.php: Do not show header "combined alert" if there + is no complex alerts. + + * reporting_viewer.php: Round data for monitor SLA report. + 2008-04-04 Jorge Gonzalez * godmode/agentes/module_manager_editor_data.php, diff --git a/pandora_console/include/config.inc.php b/pandora_console/include/config.inc.php index 7f4dc05975..aa8e7ebca0 100644 --- a/pandora_console/include/config.inc.php +++ b/pandora_console/include/config.inc.php @@ -16,14 +16,16 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Database configuration (default ones) -$config["dbname"]="pandora"; -$config["dbuser"]="pandora"; -$config["dbpass"]="pandora"; -$config["dbhost"]="localhost"; +// Default values + +// $config["dbname"]="pandora"; +// $config["dbuser"]="pandora"; +// $config["dbpass"]="pandora"; +// $config["dbhost"]="localhost"; // This is used for reporting, please add "/" character at the end -$config["homedir"]="/var/www/pandora_console/"; -$config["homeurl"]="/pandora_console/"; +// $config["homedir"]="/var/www/pandora_console/"; +// $config["homeurl"]="/pandora_console/"; // Do not display any ERROR //error_reporting(0); // Need to use active console at this moment diff --git a/pandora_console/include/config.php b/pandora_console/include/config.php index 9bfc28348b..e91fd10a85 100644 --- a/pandora_console/include/config.php +++ b/pandora_console/include/config.php @@ -1,4 +1,13 @@ '; + $output = ''; if ($return) return $return; echo $output; diff --git a/pandora_console/install.php b/pandora_console/install.php index 5727932884..a1ce98bddd 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -128,6 +128,7 @@ function parse_mysql_dump($url){ if(trim($sql_line) != "" && strpos($sql_line, "--") === false){ $query .= $sql_line; if(preg_match("/;[\040]*\$/", $sql_line)){ + // echo "DEBUG $query
"; if (!$result = mysql_query($query)) return 0; $query = ""; @@ -153,7 +154,7 @@ function install_step1() {

Pandora FMS installation wizard. Step #1 of 4

-

Welcome to Pandora FMS 1.3 installation Wizard

+

Welcome to Pandora FMS 2.0 installation Wizard

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

In four steps checks all dependencies and make your configuration for a quick installation.

For more information, please refer to documentation.

@@ -163,7 +164,7 @@ 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 continue, please be sure that you have no valuable Pandora FMS data in your Database.
"; - echo "
If you want to upgrade from Pandora FMS 1.2 to 1.3 version, + echo "
If you want to upgrade from Pandora FMS 1.3.x to 2.0 version, use the automated update wizard
"; echo "
@@ -345,15 +346,14 @@ function install_step4() { $cfgin = fopen ("include/config.inc.php","r"); $cfgout = fopen ($pandora_config,"w"); $config_contents = fread ($cfgin, filesize("include/config.inc.php")); - $config_new = ''; $step7 = fputs ($cfgout, $config_new); diff --git a/pandora_console/operation/agentes/estado_alertas.php b/pandora_console/operation/agentes/estado_alertas.php index 3a94ad57cd..bd51b4a427 100644 --- a/pandora_console/operation/agentes/estado_alertas.php +++ b/pandora_console/operation/agentes/estado_alertas.php @@ -87,9 +87,11 @@ if (isset($_GET["id_agente"])){ show_alert_show_view ($data, $tdcolor, 0); } - echo "
".lang_string("Combined alerts")."
"; // Show combined alerts for this agent $result_com = mysql_query("SELECT * FROM talerta_agente_modulo WHERE id_agent = $id_agente"); + if (mysql_num_rows ($result_com)) { + echo "
".lang_string("Combined alerts")."
"; + } while ($data_com=mysql_fetch_array($result_com)){ if ($color == 1){ $tdcolor = "datos"; diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php index de1c2c5125..c624bcf8a4 100644 --- a/pandora_console/operation/reporting/reporting_viewer.php +++ b/pandora_console/operation/reporting/reporting_viewer.php @@ -209,7 +209,7 @@ if (($report_user == $id_user) OR (dame_admin($id_user)==1) OR ($report_private echo "

"; echo $monitor_value." %".""; echo "

"; - $monitor_value2 = 100 - $monitor_value ; + $monitor_value2 = format_numeric(100 - $monitor_value,2) ; echo "

"; echo $monitor_value2." %".""; echo "

"; diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 0129e0bded..cb249c7dda 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1,4 +1,22 @@ +-- Pandora FMS - the Free Monitoring System +-- ======================================== +-- Copyright (c) 2008 Artica Soluciones Tecnológicas, http://www.artica.es +-- 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 +-- 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 +-- GNU General Public License for more details. +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +-- PLEASE NO NOT USE MULTILINE COMMENTS +-- Because Pandora Installer don't understand them +-- and fails creating database !!! -------------------------------------------------------------- -- Pandora FMS official tables for 2.0 version -- -------------------------------------------------------------- diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index b016a84042..01c27a78cd 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -1,3 +1,27 @@ +-- Pandora FMS - the Free Monitoring System +-- ======================================== +-- Copyright (c) 2008 Artica Soluciones Tecnológicas, http://www.artica.es +-- 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 +-- 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 +-- GNU General Public License for more details. +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +-- Database Data for Pandora FMS 2.0 + +-- PLEASE NO NOT USE MULTILINE COMMENTS +-- Because Pandora Installer don't understand them +-- and fails creating database !!! + + + -- -- Dumping data for table `talerta` -- @@ -62,10 +86,10 @@ UNLOCK TABLES; /*!40000 ALTER TABLE `tlanguage` DISABLE KEYS */; LOCK TABLES `tlanguage` WRITE; INSERT INTO `tlanguage` VALUES ('en','English'); -/*INSERT INTO `tlanguage` VALUES ('es_es','Español'); -INSERT INTO `tlanguage` VALUES ('de','Deutch'); -INSERT INTO `tlanguage` VALUES ('fr','Français'); -INSERT INTO `tlanguage` VALUES ('pt_br','Português-Brasil'); */ +--INSERT INTO `tlanguage` VALUES ('es_es','Español'); +--INSERT INTO `tlanguage` VALUES ('de','Deutch'); +--INSERT INTO `tlanguage` VALUES ('fr','Français'); +--INSERT INTO `tlanguage` VALUES ('pt_br','Português-Brasil'); UNLOCK TABLES; /*!40000 ALTER TABLE `tlanguage` ENABLE KEYS */;