From a3d391b57c3761cee93a04f7947a46cc389d0664 Mon Sep 17 00:00:00 2001 From: slerena Date: Fri, 17 Aug 2007 16:10:55 +0000 Subject: [PATCH] 2007-08-17 Sancho Lerena * upgrade_from_1.2.php: Deleted file, code merged in migrate.php * include/styles/install.css: Added style to show info in div. * pandoradbdata_12_to_13.sql: Fixed some items. * install.php: Added link to migrate wizard. * pandoradb_12_to_13.sql: Fixed some items. * reporting/fgraph.php: Fixed problem (NOTICE string) rendering boolean graphs. * migrate.php: Upgraded and finished migration tool from 1.2 to 1.3 :-) git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@600 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 16 ++ pandora_console/include/styles/install.css | 20 ++- pandora_console/install.php | 3 +- pandora_console/migrate.php | 192 +++++++++++---------- pandora_console/pandoradb_12_to_13.sql | 5 +- pandora_console/pandoradbdata_12_to_13.sql | 46 ++++- pandora_console/reporting/fgraph.php | 37 ++-- pandora_console/upgrade_from_1.2.php | 45 ----- 8 files changed, 195 insertions(+), 169 deletions(-) delete mode 100644 pandora_console/upgrade_from_1.2.php diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 018c099630..3efc5cce73 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,19 @@ +2007-08-17 Sancho Lerena + + * upgrade_from_1.2.php: Deleted file, code merged in migrate.php + + * include/styles/install.css: Added style to show info in div. + + * pandoradbdata_12_to_13.sql: Fixed some items. + + * install.php: Added link to migrate wizard. + + * pandoradb_12_to_13.sql: Fixed some items. + + * reporting/fgraph.php: Fixed problem (NOTICE string) rendering boolean graphs. + + * migrate.php: Upgraded and finished migration tool from 1.2 to 1.3 :-) + 2007-08-09 Sancho Lerena * upgrade_from_1.2.php, pandoradbdata_12_to_13.sql, diff --git a/pandora_console/include/styles/install.css b/pandora_console/include/styles/install.css index 38242989c7..0c5e7d04a4 100644 --- a/pandora_console/include/styles/install.css +++ b/pandora_console/include/styles/install.css @@ -74,16 +74,22 @@ input#step4, input#step4:hover { border: 0px; background-color: #fafafa; } -div.warn { - background: url(../../images/info.png) no-repeat; - color: #ac4444; - margin-top: 7px; - padding: 2px 1px 6px 25px; -} +div.warn { + background: url(../../images/info.png) no-repeat; + color: #ac4444; + margin-top: 7px; + padding: 2px 1px 6px 25px; +} +div.info { + background: url(../../images/information.png) no-repeat; + color: #000000; + margin-top: 7px; + padding: 2px 1px 6px 25px; +} span.arr{ background: url(../../images/arrow.png) no-repeat; margin-top: 2px; margin-left: 5px; padding: 2px 1px 6px 15px; display: block; -} \ No newline at end of file +} diff --git a/pandora_console/install.php b/pandora_console/install.php index 4bbe5d8ae6..18e5f9d21c 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -151,7 +151,7 @@ function install_step1() { echo "

Pandora FMS installation wizard. Step #1 of 4

-
+

Welcome to Pandora FMS 1.3 installation Wizard

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

@@ -163,6 +163,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 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 "
diff --git a/pandora_console/migrate.php b/pandora_console/migrate.php index 2494b92352..e35919934f 100644 --- a/pandora_console/migrate.php +++ b/pandora_console/migrate.php @@ -4,9 +4,6 @@ // ======================================== // Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info // Copyright (c) 2005-2007 Artica Soluciones Tecnologicas -// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com -// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net -// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -23,9 +20,9 @@ -Pandora FMS - Installation Wizard +Pandora FMS - Migration Wizard - + @@ -120,6 +117,45 @@ function check_variable ( $var, $value, $label, $mode ){ 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); @@ -150,19 +186,19 @@ function random_name ($size){ function install_step1() { echo "
-

Pandora FMS migration wizard. Step #1 of 4

-
+

Pandora FMS migration wizard. Step #1 of 5

+

Welcome to Pandora FMS 1.3 migration Wizard

-

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

-

This tool is only to migrate Pandora FMS 1.2 to Pandora FMS 1.3

+

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

For more information, please refer to documentation.

Pandora FMS Development Team - "; +
Before start with migration 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 installer will overwrite and change your existing Pandora FMS Database and cannot be used by Pandora FMS 1.2, only for 1.3 version. Before contine, please be sure that you have made a SQL backup using mysqldump system tool.
"; + echo "
Warning: This migration tool will overwrite and change your existing Pandora FMS Database and only could be used to migrate fron Pandora FMS 1.2 to Pandora FMS 1.3. Before contine, please be sure that you have made a SQL backup using mysqldump system tool as described in documentation.
"; echo "
@@ -170,7 +206,7 @@ function install_step1() {
- +
@@ -183,8 +219,8 @@ function install_step1() { function install_step2() { echo "
-

Pandora FMS console migration wizard. Step #2 of 4

-
+

Pandora FMS migration wizard. Step #2 of 5

+
"; echo "

Checking software dependencies

"; echo ""; @@ -198,7 +234,8 @@ function install_step2() { $res += check_include("PEAR.php","PEAR PHP Library"); $step6 = is_writable("include"); check_generic ($step6, "Write permissions to save config file in './include'"); - $res += $step6; + if ($step6 == 0) + $res++; //$res += check_exists ("/usr/bin/pdflatex","PDF Latex in /usr/bin/pdflatex"); echo "
@@ -210,12 +247,12 @@ function install_step2() {
"; if ($res > 0) { echo "
You have some uncomplete - dependencies. Please correct them or this installer + dependencies. Please correct them or this wizard tool will not be able to finish your installation. -
- Ignore it. Force install Step #3"; +

+ Ignore it. Ignore it and go to Step #3"; } else { - echo ""; + echo ""; } echo "
@@ -231,20 +268,16 @@ function install_step2() { function install_step3() { echo "
-

Pandora FMS console migration wizard. Step #3 of 4

-
+

Pandora FMS migration 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, modifyng existing data to be used by the new version. + 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. -

-

- Now, please, complete all details to configure your database and enviroment setup. + 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 "
Warning: This installer will overwrite and change your existing Pandora FMS Database and cannot be used by Pandora FMS 1.2, only for 1.3 version. Before contine, please be sure that you have made a SQL backup using mysqldump system tool.
"; echo "
DB User with privileges on MySQL
@@ -307,39 +340,36 @@ function install_step4() { $path = "/var/www"; } $everything_ok = 0; - $step1=0; - $step2=0; - $step3=0; + $step1=0; $step2=0; $step3=0; $step4=0; $step5=0; $step6=0; $step7=0; - echo " -
-

Pandora FMS Console migration wizard. Step #4 of 4

-
+ echo "
+

Pandora FMS migration wizard. Step #4 of 5

+
-

Modifing database schema structure and converting data (this could be a long time...)

+

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 - $step1 = mysql_query ("connect $dbname"); - check_generic ($step1, "Connecting database '$dbname'"); - if ($step1 == 1){ - $step2 = mysql_select_db($dbname); - check_generic ($step2, "Opening database '$dbname'"); + 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"); + $step3 = (parse_mysql_dump("pandoradb_12_to_13.sql")); + check_generic ($step3, "Schema manipulation"); flush(); - $step4 = parse_mysql_dump("pandoradb_data_12_to_13.sql"); - check_generic ($step4, "Populating new schema and converting data"); + $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")); + $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); - $step7 = $step7 + fputs ($cfgout, $config_contents); - if ($step7 > 0) - $step7 = 1; - fclose ($cfgin); - fclose ($cfgout); - chmod ($pandora_config, 0600); - check_generic ($step7, "Created new config file at '".$pandora_config."'"); - } + $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 (($step7 + $step6 + $step5 + $step4 + $step3 + $step2 + $step1) == 7) { + if (($step5 + $step4 + $step3 + $step2 ) == 4) { $everything_ok = 1; - } + migrate_data(); + } + echo "

@@ -370,16 +402,13 @@ $BASE_URL="'.$url.'"; // Base URL
"; if ($everything_ok == 1) { - echo "

"; + echo "

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

Please correct failures before trying again. - All database schemes created in this step have been dropped.

"; +

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

"; if (mysql_error() != "") echo "
ERROR: ". mysql_error().".
"; - - mysql_query ("DROP DATABASE $dbname"); } echo "
@@ -389,40 +418,17 @@ $BASE_URL="'.$url.'"; // Base URL SourceForge
"; + } + function install_step5() { echo "
-

Pandora FMS console migration wizard. Finished

+

Pandora FMS migration wizard. Finished

-

Data conversion

-

This step could be very long in time, so please be patieng

-
"; - - // PROCESAR upgrade_from_1.2.php - - - echo "
-
-
-
-
-
- Pandora FMS is a Free Software project registered at - SourceForge -
-
"; -} - -function install_step6() { - echo " -
-

Pandora FMS console installation wizard. Finished

-
-
-

Installation complete

-

You now must delete manually this installer ('install.php') file for security before trying to access to your Pandora FMS console. +

Migration complete

+

You now must delete manually installer and migration tool ('install.php, migrate.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

@@ -456,6 +462,8 @@ if (! isset($_GET["step"])){ break; case 5: install_step5(); break; + case 6: install_step6(); + break; } } diff --git a/pandora_console/pandoradb_12_to_13.sql b/pandora_console/pandoradb_12_to_13.sql index 31cfd4c579..1eefa6a929 100644 --- a/pandora_console/pandoradb_12_to_13.sql +++ b/pandora_console/pandoradb_12_to_13.sql @@ -28,8 +28,7 @@ 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 `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'; @@ -200,4 +199,4 @@ CREATE TABLE `tlayout_data` ( `label_color` varchar(20) DEFAULT "", `no_link_color` tinyint(1) UNSIGNED NOT NULL default 0, PRIMARY KEY(`id`) -) ENGINE = InnoDB; \ No newline at end of file +) ENGINE = InnoDB; diff --git a/pandora_console/pandoradbdata_12_to_13.sql b/pandora_console/pandoradbdata_12_to_13.sql index 77e7d7390f..3eff8ec396 100644 --- a/pandora_console/pandoradbdata_12_to_13.sql +++ b/pandora_console/pandoradbdata_12_to_13.sql @@ -27,8 +27,50 @@ 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 (1,'OS Total process','Total process in Operating System (UNIX MIB)',5,8,0,0,0,0,'','NULL','NULL','',0),(2,'OS CPU Load','CPU Load in Operating System (UNIX MIB)',5,9,0,0,0,0,'','NULL','NULL','',0),(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),(4,'OS Users','Active users in Operating System (UNIX MIB)',5,6,0,0,0,0,'','NULL','NULL','',0),(5,'CiscoAP Wifi traffic','Cisco AP AP120',9,6,0,0,0,0,'','NULL','NULL','',0),(6,'CiscoAP Wifi errors','Get errors con WiFi for Cisco AP AP120',9,16,0,0,300,0,'','','public','',2),(7,'CiscoAP RAM','Get RAM available on device',9,15,0,0,300,0,'','','public','',4),(8,'CiscoAP Ethernet OUT','Cisco AP AP120',9,6,0,0,0,0,'','NULL','NULL','',0),(9,'CiscoAP Ethernet IN','Cisco AP AP120',9,6,0,0,0,0,'','NULL','NULL','',0),(10,'CiscoAP CPU Usage','Cisco AP AP120',9,6,0,0,0,0,'','NULL','NULL','',0),(11,'Cisco Catalyst CPU Usage','Cisco Catalyst 3750',8,6,0,0,0,0,'','NULL','NULL','',0),(12,'FlashFree ','Cisco Catalyst 3750',8,6,0,0,0,0,'','NULL','NULL','',0),(13,'RAM_Usage','Cisco Catalyst 3750',8,6,0,0,0,0,'','NULL','NULL','',0),(16,'CPU Usage','',7,6,0,0,0,0,'','NULL','NULL','',0),(17,'Memory available','',7,6,0,0,0,0,'','NULL','NULL','',0),(18,'Configuration changes','',7,6,0,0,0,0,'','NULL','NULL','',0),(19,'Power #1','',6,18,0,0,180,0,'','','public',' .1.3.6.1.4.1.2334.2.1.5.8.0',4),(20,'Power #2','',6,18,0,0,180,0,'','','public',' .1.3.6.1.4.1.2334.2.1.5.10.0',4),(21,'User concurrence','',6,6,0,0,0,0,'','NULL','NULL','',0),(22,'HSRP Status','Get status of HSRP',2,18,0,0,180,0,'','','public','1.3.6.1.4.1.9.9.106.1.2.1.1.15.12.106',2),(23,'Num. of classes','',6,6,0,0,0,0,'','NULL','NULL','',0),(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),(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),(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),(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),(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),(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),(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),(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),(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),(34,'Host Alive','Check if host is alive using ICMP ping check.',10,6,0,0,120,0,'','','','',2),(36,'Host Latency','Get host network latency in miliseconds, using ICMP.',10,7,0,0,180,0,'','','','',2),(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),(38,'Check FTP Server','Check FTP protocol, not only check port.',10,9,0,0,300,21,'QUIT','221','','',3),(39,'Check SSH Server','Checks port 22 is opened',10,9,0,0,300,22,'','','','',2),(40,'Check Telnet server','Check telnet port',10,9,0,0,300,23,'','','','',2),(41,'Check SMTP server','Check if SMTP port it's open',10,9,0,0,300,25,'','','','',2),(42,'Check POP3 server','Check POP3 port.',10,9,0,0,300,110,'','','','',2),(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),(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),(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),(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),(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),(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 (1,'OS Total process','Total process in Operating System (UNIX MIB)',5,8,0,0,0,0,'','NULL','NULL','',0); +INSERT INTO `tnetwork_component` VALUES (2,'OS CPU Load','CPU Load in Operating System (UNIX MIB)',5,9,0,0,0,0,'','NULL','NULL','',0); +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 (4,'OS Users','Active users in Operating System (UNIX MIB)',5,6,0,0,0,0,'','NULL','NULL','',0); +INSERT INTO `tnetwork_component` VALUES (5,'CiscoAP Wifi traffic','Cisco AP AP120',9,6,0,0,0,0,'','NULL','NULL','',0); +INSERT INTO `tnetwork_component` VALUES (6,'CiscoAP Wifi errors','Get errors con WiFi for Cisco AP AP120',9,16,0,0,300,0,'','','public','',2); +INSERT INTO `tnetwork_component` VALUES (7,'CiscoAP RAM','Get RAM available on device',9,15,0,0,300,0,'','','public','',4); +INSERT INTO `tnetwork_component` VALUES (8,'CiscoAP Ethernet OUT','Cisco AP AP120',9,6,0,0,0,0,'','NULL','NULL','',0); +INSERT INTO `tnetwork_component` VALUES (9,'CiscoAP Ethernet IN','Cisco AP AP120',9,6,0,0,0,0,'','NULL','NULL','',0); +INSERT INTO `tnetwork_component` VALUES (10,'CiscoAP CPU Usage','Cisco AP AP120',9,6,0,0,0,0,'','NULL','NULL','',0); +INSERT INTO `tnetwork_component` VALUES (11,'Cisco Catalyst CPU Usage','Cisco Catalyst 3750',8,6,0,0,0,0,'','NULL','NULL','',0); +INSERT INTO `tnetwork_component` VALUES (12,'FlashFree ','Cisco Catalyst 3750',8,6,0,0,0,0,'','NULL','NULL','',0); +INSERT INTO `tnetwork_component` VALUES (13,'RAM_Usage','Cisco Catalyst 3750',8,6,0,0,0,0,'','NULL','NULL','',0); +INSERT INTO `tnetwork_component` VALUES (16,'CPU Usage','',7,6,0,0,0,0,'','NULL','NULL','',0); +INSERT INTO `tnetwork_component` VALUES (17,'Memory available','',7,6,0,0,0,0,'','NULL','NULL','',0); +INSERT INTO `tnetwork_component` VALUES (18,'Configuration changes','',7,6,0,0,0,0,'','NULL','NULL','',0); +INSERT INTO `tnetwork_component` VALUES (19,'Power #1','',6,18,0,0,180,0,'','','public',' .1.3.6.1.4.1.2334.2.1.5.8.0',4); +INSERT INTO `tnetwork_component` VALUES (20,'Power #2','',6,18,0,0,180,0,'','','public',' .1.3.6.1.4.1.2334.2.1.5.10.0',4); +INSERT INTO `tnetwork_component` VALUES (21,'User concurrence','',6,6,0,0,0,0,'','NULL','NULL','',0); +INSERT INTO `tnetwork_component` VALUES (22,'HSRP Status','Get status of HSRP',2,18,0,0,180,0,'','','public','1.3.6.1.4.1.9.9.106.1.2.1.1.15.12.106',2); +INSERT INTO `tnetwork_component` VALUES (23,'Num. of classes','',6,6,0,0,0,0,'','NULL','NULL','',0); +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_group` VALUES (1,'General group',0),(2,'Cisco MIBs',10),(3,'Nortel MIBS',10),(4,'3COM MIBs',10),(5,'UNIX MIBs',12),(6,'Packetshaper MIBs',10),(7,'Nortel BPS 2000 MIBs',3),(8,'Cisco Catalyst3750 MIBs',2),(9,'Cisco AP120+',2),(10,'Network Management',0),(11,'Microsoft Windows MIB',12),(12,'Operating Systems',0); diff --git a/pandora_console/reporting/fgraph.php b/pandora_console/reporting/fgraph.php index 8e2cbdbeb5..81089b09e8 100644 --- a/pandora_console/reporting/fgraph.php +++ b/pandora_console/reporting/fgraph.php @@ -1684,29 +1684,28 @@ function grafico_modulo_boolean ( $id_agente_modulo, $periodo, $show_event, $utimestamp = $row[1]; $i = round(($utimestamp - $fechatope) / $horasint); + if (isset($valores[$i][0])){ + $valores[$i][0] += $datos; + $valores[$i][1]++; - //echo "$datos $utimestamp at $i
"; - - $valores[$i][0] += $datos; - $valores[$i][1]++; - - if ($valores[$i][6] == -1) - $valores[$i][6]=$datos; + if ($valores[$i][6] == -1) + $valores[$i][6]=$datos; - // Init min value - if ($valores[$i][4] == -1) - $valores[$i][4] = $datos; - else { - // Check min value - if ($datos < $valores[$i][4]) + // Init min value + if ($valores[$i][4] == -1) $valores[$i][4] = $datos; - } - // Check max value - if ($valores[$i][5] == -1) - $valores[$i][5] = $datos; - else - if ($datos > $valores[$i][5]) + else { + // Check min value + if ($datos < $valores[$i][4]) + $valores[$i][4] = $datos; + } + // Check max value + if ($valores[$i][5] == -1) $valores[$i][5] = $datos; + else + if ($datos > $valores[$i][5]) + $valores[$i][5] = $datos; + } } diff --git a/pandora_console/upgrade_from_1.2.php b/pandora_console/upgrade_from_1.2.php deleted file mode 100644 index dd67c93fdf..0000000000 --- a/pandora_console/upgrade_from_1.2.php +++ /dev/null @@ -1,45 +0,0 @@ -Cannot find config.php!!!. FATAL ERROR UPGRADING"; - exit; -} - -include "include/config.php"; - -// tagente_datos upgrade - -echo "

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); -} - -echo "

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); -} - -echo "

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); -} - -?> \ No newline at end of file