From 720b82edf53c830c8536d0d5c2f9dbbd2f83b73f Mon Sep 17 00:00:00 2001 From: slerena Date: Mon, 12 Mar 2007 17:58:52 +0000 Subject: [PATCH] 2007-03-12 Sancho Lerena * pandoradb.sql: Upgraded scheme, many changes and many tables added. I Need to commit the new "preloaded" data for this scheme, give me some days, this stuff are on development. * includes/styles/*: Many additions to reflect new menu options, and the tab menu title. * reporting/fgraph.php: Minor changes to format progressbar. * godmode/modules/*: Many many changes and additions (manage_*) for the new management system using tabs :-) * include/languages/language_es_es.php: Many additions. * operation/servers/view_server.php: Implemented detailed load for each servertype and latency time to each server to detect problems with high load. Many changes in godmode subsystem. Not detailed at this time. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@394 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 23 + .../godmode/agentes/agent_manager.php | 39 +- .../godmode/agentes/alert_manager.php | 20 +- .../godmode/agentes/configurar_agente.php | 217 +++-- .../godmode/agentes/modificar_agente.php | 324 ++++---- .../godmode/agentes/module_manager.php | 287 ++++--- .../godmode/alertas/configurar_alerta.php | 21 +- .../godmode/grupos/configurar_grupo.php | 15 +- .../godmode/grupos/lista_grupos.php | 35 +- pandora_console/godmode/menu.php | 62 +- .../godmode/modules/manage_nc_groups.php | 119 +++ .../godmode/modules/manage_nc_groups_form.php | 87 +++ .../modules/manage_network_components.php | 255 ++++++ .../manage_network_components_form.php | 280 +++++++ .../modules/manage_network_templates.php | 23 + .../godmode/modules/module_list.php | 112 +++ .../godmode/servers/modificar_server.php | 23 +- pandora_console/godmode/setup/setup.php | 53 +- pandora_console/include/config.php | 69 +- pandora_console/include/functions.php | 27 +- pandora_console/include/functions_db.php | 80 +- .../include/languages/language_en.php | 69 +- .../include/languages/language_es_es.php | 24 +- pandora_console/include/styles/god.css | 9 +- pandora_console/include/styles/pandora.css | 51 +- pandora_console/index.php | 14 +- .../agentes/estado_generalagente.php | 18 +- .../operation/agentes/estado_grupo.php | 211 ++--- .../operation/agentes/estado_monitores.php | 4 +- .../agentes/estado_ultimopaquete.php | 35 +- .../operation/agentes/ver_agente.php | 30 +- .../operation/servers/view_server.php | 139 +++- pandora_console/pandoradb.sql | 739 ++++++++++++------ pandora_console/reporting/fgraph.php | 26 +- 34 files changed, 2618 insertions(+), 922 deletions(-) create mode 100644 pandora_console/godmode/modules/manage_nc_groups.php create mode 100644 pandora_console/godmode/modules/manage_nc_groups_form.php create mode 100644 pandora_console/godmode/modules/manage_network_components.php create mode 100644 pandora_console/godmode/modules/manage_network_components_form.php create mode 100644 pandora_console/godmode/modules/manage_network_templates.php create mode 100644 pandora_console/godmode/modules/module_list.php diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 6cce6c3647..69a289dc6d 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,25 @@ +2007-03-12 Sancho Lerena + + * pandoradb.sql: Upgraded scheme, many changes and many tables + added. I Need to commit the new "preloaded" data for this scheme, + give me some days, this stuff are on development. + + * includes/styles/*: Many additions to reflect new menu options, + and the tab menu title. + + * reporting/fgraph.php: Minor changes to format progressbar. + + * godmode/modules/*: Many many changes and additions (manage_*) + for the new management system using tabs :-) + + * include/languages/language_es_es.php: Many additions. + + * operation/servers/view_server.php: Implemented detailed load for + each servertype and latency time to each server to detect problems + with high load. + + Many changes in godmode subsystem. Not detailed at this time. + 2007-03-07 Raul Mateos * godmode/agentes/alert_manager.php, modificar_agente.php, @@ -17,6 +39,7 @@ * include/styles/menu.css: Small colour change in menu border. +>>>>>>> .r393 2007-03-06 Sancho Lerena * include/functions*.php: Some reorganization, moved some funtions diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 6cbc12cd16..eee62ab532 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -1,5 +1,29 @@ +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// +// 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; 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. + + // ======================== // AGENT GENERAL DATA FORM // ======================== @@ -13,21 +37,22 @@ if (give_acl($id_user, 0, "AW")!=1) { }; echo "

".$lang_label["agent_conf"]; -if (isset($_GET["creacion"])){ -echo " > ".$lang_label["create_agent"]." -".$lang_label["help"].""; +if (isset($_GET["create_agent"])){ + $create_agent = 1; + echo " > ".$lang_label["create_agent"]." + +  ".$lang_label["help"].""; } else { echo " > ".$lang_label["update_agent"]."  ".$lang_label["help"].""; } echo "

"; -echo "
"; +echo "
"; echo '
'; -if ($creacion_agente == 1) { +if ($create_agent == 1) { echo ""; } else { echo ""; @@ -137,7 +162,7 @@ while ($row=mysql_fetch_array($result)){
"; diff --git a/pandora_console/godmode/agentes/alert_manager.php b/pandora_console/godmode/agentes/alert_manager.php index 7eca0993dd..856057794f 100644 --- a/pandora_console/godmode/agentes/alert_manager.php +++ b/pandora_console/godmode/agentes/alert_manager.php @@ -1,14 +1,20 @@ +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// // 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; either version 2 -// of the License, or (at your option) any later version. +// as published by the Free Software Foundation; 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/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 927b772b91..a2d30a4310 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1,24 +1,27 @@ +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// // 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 version 2 +// as published by the Free Software Foundation; 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.?> +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -".$lang_label["agent_exists"].""; + else { + if ($id_server != ""){ + $sql_insert ="INSERT INTO tagente (nombre, direccion, id_grupo, intervalo, comentarios,modo, id_os, disabled, id_server) VALUES ('".$nombre_agente."', '".$direccion_agente."', '".$grupo."', '".$intervalo."', '".$comentarios."',".$modo.", ".$id_os.", '".$disabled."',$id_server)"; + } else { + $sql_insert ="INSERT INTO tagente (nombre, direccion, id_grupo, intervalo, comentarios,modo, id_os, disabled) VALUES ('".$nombre_agente."', '".$direccion_agente."', '".$grupo."', '".$intervalo."', '".$comentarios."',".$modo.", ".$id_os.", '".$disabled."')"; + } + $result=mysql_query($sql_insert); + if ($result) { + $agent_created_ok = 1; + $id_agente = mysql_insert_id(); + // Create special MODULE agent_keepalive + $sql_insert ="INSERT INTO tagente_modulo (nombre, id_agente, id_tipo_modulo, descripcion) VALUES ('agent_keepalive', ".$id_agente.",-1,'Agent Keepalive monitor')"; + $result=mysql_query($sql_insert); + } + + } +} // Show tabs // ¯----------------- + +echo ""; + + echo ""; + + // Make some space between tabs and title echo "
"; // Unset variable to allow operations to work $id_agente = ""; +// Show agent creation results +if (isset($_POST["create_agent"])){ + if ($agent_created_ok == 0) + echo "

".$lang_label["create_agent_no"]."

"; + else + echo "

".$lang_label["create_agent_ok"]."

"; +} + // Delete Alert // ============= if (isset($_GET["delete_alert"])){ // if modified some parameter @@ -176,46 +243,7 @@ if (isset($_POST["update_alert"])){ // Update an existing alert $id_agente = mysql_insert_id(); } -// ================================ -// Create AGENT -// ================================ -if (isset($_POST["create_agent"])) { // Create a new and shining agent - $nombre_agente = entrada_limpia($_POST["agente"]); - $direccion_agente = entrada_limpia($_POST["direccion"]); - $grupo = entrada_limpia($_POST["grupo"]); - $intervalo = entrada_limpia($_POST["intervalo"]); - $comentarios = entrada_limpia($_POST["comentarios"]); - $modo = entrada_limpia($_POST["modo"]); - $id_server = entrada_limpia($_POST["id_server"]); - $id_os = entrada_limpia($_POST["id_os"]); - $disabled = entrada_limpia($_POST["disabled"]); - // Check if agent exists (BUG WC-50518-2 ) - $sql1='SELECT nombre FROM tagente WHERE nombre = "'.$nombre_agente.'"'; - $result=mysql_query($sql1); - if ($row=mysql_fetch_array($result)){ - echo "

".$lang_label["agent_exists"]."

"; - $creacion_agente = 1; - } else { - if ($id_server != ""){ - $sql_insert ="INSERT INTO tagente (nombre, direccion, id_grupo, intervalo, comentarios,modo, id_os, disabled, id_server) VALUES ('".$nombre_agente."', '".$direccion_agente."', '".$grupo."', '".$intervalo."', '".$comentarios."',".$modo.", ".$id_os.", '".$disabled."',$id_server)"; - } else { - $sql_insert ="INSERT INTO tagente (nombre, direccion, id_grupo, intervalo, comentarios,modo, id_os, disabled) VALUES ('".$nombre_agente."', '".$direccion_agente."', '".$grupo."', '".$intervalo."', '".$comentarios."',".$modo.", ".$id_os.", '".$disabled."')"; - } - $result=mysql_query($sql_insert); - if (! $result) - echo "

".$lang_label["create_agent_no"]."

"; - else - echo "

".$lang_label["create_agent_ok"]."

"; - $id_agente = mysql_insert_id(); - // Create special MODULE agent_keepalive - $sql_insert ="INSERT INTO tagente_modulo (nombre, id_agente, id_tipo_modulo, descripcion) VALUES ('agent_keepalive', ".$id_agente.",-1,'Agent Keepalive monitor')"; - $result=mysql_query($sql_insert); - if (! $result) { - echo "

".$lang_label["create_keep_no"]."

"; - } - } -} // ================ // Update AGENT // ================ @@ -280,8 +308,6 @@ if (isset($_GET["id_agente"])){ exit; } } -if (isset($_GET["creacion"])) - $creacion_agente = 1; // Read data module if editing module // ================================== @@ -358,6 +384,7 @@ if ((isset($_POST["update_module"])) || (isset($_POST["insert_module"]))) { require ("general/footer.php"); exit; } + if (isset($_POST["tipo"])) $id_tipo_modulo = entrada_limpia($_POST["tipo"]); if (isset($_POST["nombre"])){ @@ -443,11 +470,41 @@ if (isset($_POST["oid"])){ } } +// ========================================================= +// Network Component UPDATE button to fill module data with NC data +// This code is only applied when creating a new module (not active in update mode) +// ========================================================= +if ( (isset($_POST["nc"]) && ($_POST["nc"]!=-1))){ + echo "

".$lang_label["using_network_component"]."

"; + $id_nc = entrada_limpia($_POST["nc"]); + $sql1="SELECT * FROM tnetwork_component WHERE id_nc = '$id_nc'"; + $result=mysql_query($sql1); + $row=mysql_fetch_array($result); + $modulo_id_agente = $row["id_agente"]; + $modulo_id_tipo_modulo = $row["type"]; + $id_module_group = $row["id_module_group"]; + $modulo_nombre = $row["name"]; + $modulo_descripcion = $row["description"]; + $tcp_send = $row["tcp_send"]; + $tcp_rcv = $row["tcp_rcv"]; + $tcp_port = $row["tcp_port"]; + $ip_target = $row["ip_target"]; + $snmp_community = $row["snmp_community"]; + $snmp_oid = $row["snmp_oid"]; + $id_module_group = $row["id_module_group"]; + $module_interval = $row["module_interval"]; + $modulo_max = $row["max"]; + $modulo_min = $row["min"]; +} // ========================================================= // MODULE INSERT // ========================================================= -if ((!isset($_POST["oid"])) && (isset($_POST["insert_module"]))){ + +if (((!isset($_POST["nc"]) OR ($_POST["nc"]==-1)) ) && + (!isset($_POST["oid"])) && + (isset($_POST["insert_module"]))){ + if (isset($_POST["combo_snmp_oid"])) { $combo_snmp_oid = entrada_limpia($_POST["combo_snmp_oid"]); } @@ -462,19 +519,11 @@ if ((!isset($_POST["oid"])) && (isset($_POST["insert_module"]))){ } if (!isset($modulo_min) || $modulo_min=="") { $modulo_min= "0"; - } + } $sql_insert = "INSERT INTO tagente_modulo (id_agente,id_tipo_modulo,nombre,descripcion,max,min,snmp_oid,snmp_community,id_module_group,module_interval,ip_target,tcp_port,tcp_rcv,tcp_send) VALUES (".$id_agente.",".$id_tipo_modulo.",'".$nombre."','".$descripcion."','".$modulo_max."','".$modulo_min."', '$snmp_oid', '$snmp_community', '$id_module_group', '$module_interval', '$ip_target', '$tcp_port', '$tcp_rcv', '$tcp_send')"; - // Init vars to null to avoid trash in forms - $id_tipo_modulo = "";$nombre = "";$descripcion = "";$modulo_max = ""; - $modulo_min = "";// Pandora 1.2 new module data: - $tcp_send = "";$tcp_rcv = "";$tcp_port = "";$ip_target = ""; - $snmp_oid = "";$snmp_community = "";$id_module_group = ""; - $module_interval = ""; - - //echo "DEBUG: ".$sql_insert; - $result=mysql_query($sql_insert); $id_agente_modulo = mysql_insert_id(); + // Create with different estado if proc type or data type if ( ($id_tipo_modulo == 2) || @@ -484,15 +533,15 @@ if ((!isset($_POST["oid"])) && (isset($_POST["insert_module"]))){ ($id_tipo_modulo == 18) ){ $sql_insert = "INSERT INTO tagente_estado - (id_agente_modulo,datos,timestamp,cambio,estado,id_agente) + (id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp) VALUES ( - $id_agente_modulo, 0,'0000-00-00 00:00:00',0,0,'".$id_agente."' + $id_agente_modulo, 0,'0000-00-00 00:00:00',0,0,'".$id_agente."',0 )"; } else { $sql_insert = "INSERT INTO tagente_estado - (id_agente_modulo,datos,timestamp,cambio,estado,id_agente) + (id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp) VALUES ( - $id_agente_modulo, 0,'0000-00-00 00:00:00',0,100,'".$id_agente."' + $id_agente_modulo, 0,'0000-00-00 00:00:00',0,100,'".$id_agente."',0 )"; } $result2=mysql_query($sql_insert); @@ -501,28 +550,24 @@ if ((!isset($_POST["oid"])) && (isset($_POST["insert_module"]))){ } else { echo "

".$lang_label["add_module_ok"]."

"; } + // Init vars to null to avoid trash in forms + $id_tipo_modulo = "";$nombre = "";$descripcion = "";$modulo_max = ""; + $modulo_min = "";// Pandora 1.2 new module data: + $tcp_send = "";$tcp_rcv = "";$tcp_port = "";$ip_target = ""; + $snmp_oid = "";$snmp_community = "";$id_module_group = ""; + $module_interval = ""; } + // MODULE DELETION // ================= if (isset($_GET["delete_module"])){ // DELETE agent module ! $id_borrar_modulo = $_GET["delete_module"]; - $id_grupo = dame_id_grupo($id_agente); - if (give_acl($id_user, $id_grupo, "AW")==0){ - audit_db($id_user,$REMOTE_ADDR, "ACL Violation", - "Trying to delete a module without admin rights"); - require ("general/noaccess.php"); - echo ""; - require ("general/footer.php"); - exit; - } - // Get information of the module to be deleted - $sql1='SELECT id_agente, nombre, id_tipo_modulo FROM tagente_modulo - WHERE id_agente_modulo = '.$id_borrar_modulo; - $result=mysql_query($sql1); - $row=mysql_fetch_array($result); - $id_agente = $row["id_agente"]; - $nombre_modulo = $row["nombre"]; - $id_tipo_modulo = $row["id_tipo_modulo"]; + $id_grupo = dame_id_grupo($id_agente); if (give_acl($id_user, $id_grupo, "AW")==0){ + audit_db($id_user,$REMOTE_ADDR, "ACL Violation", + "Trying to delete a module without admin rights"); + require ("general/noaccess.php"); + exit; + } // First detele from tagente_modulo $sql_delete= "DELETE FROM tagente_modulo WHERE id_agente_modulo = ".$id_borrar_modulo; @@ -536,20 +581,24 @@ if (isset($_GET["delete_module"])){ // DELETE agent module ! $sql_delete = "DELETE FROM tagente_estado WHERE id_agente_modulo = ".$id_borrar_modulo; $result=mysql_query($sql_delete); + $sql_delete = "DELETE FROM tagente_datos WHERE id_agente_modulo = ".$id_borrar_modulo; $result=mysql_query($sql_delete); + $sql_delete = "DELETE FROM tagente_datos_string WHERE id_agente_modulo = ".$id_borrar_modulo; $result=mysql_query($sql_delete); + $sql_delete = "DELETE FROM tagente_datos_inc WHERE id_agente_modulo = ".$id_borrar_modulo; $result=mysql_query($sql_delete); - } +// ----------------------------------- // Load page depending on tab selected // ----------------------------------- + if (isset($_GET["tab"])) $tab = $_GET["tab"]; else diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index fd3b419d9f..ccbf7723dc 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -1,14 +1,19 @@ +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// // 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; either version 2 -// of the License, or (at your option) any later version. +// as published by the Free Software Foundation; 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 @@ -17,149 +22,184 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - // Load global vars - require("include/config.php"); +// Load global vars +require("include/config.php"); - if (give_acl($id_user, 0, "AW") != 1) { +if (give_acl($id_user, 0, "AW") != 1) { + audit_db($id_user,$REMOTE_ADDR, "ACL Violation", + "Trying to access Agent Management"); + require ("general/noaccess.php"); + exit; +} + +if (isset($_GET["offset"])) + $offset = entrada_limpia($_GET["offset"]); +else + $offset = 0; + +if (isset($_GET["borrar_agente"])){ // if delete agent + $id_agente = entrada_limpia($_GET["borrar_agente"]); + $agent_name = dame_nombre_agente($id_agente); + $id_grupo = dame_id_grupo($id_agente); + if (give_acl($id_user, $id_grupo, "AW")==1){ + // Firts delete from agents table + $sql_delete= "DELETE FROM tagente + WHERE id_agente = ".$id_agente; + $result=mysql_query($sql_delete); + if (! $result) + echo "

".$lang_label["delete_agent_no"]."

"; + else + echo "

".$lang_label["delete_agent_ok"]."

"; + // Delete agent access table + $sql_delete = "DELETE FROM tagent_access + WHERE id_agent = ".$id_agente; + // Delete tagente_datos data + $result=mysql_query($sql_delete); + $sql_delete4="DELETE FROM tagente_datos + WHERE id_agente=".$id_agente; + $result=mysql_query($sql_delete4); + // Delete tagente_datos_string data + $result=mysql_query($sql_delete); + $sql_delete4="DELETE FROM tagente_datos_string + WHERE id_agente=".$id_agente; + $result=mysql_query($sql_delete4); + // Delete from tagente_datos + $sql1='SELECT * FROM tagente_modulo + WHERE id_agente = '.$id_agente; + $result1=mysql_query($sql1); + while ($row=mysql_fetch_array($result1)){ + $sql_delete4="DELETE FROM tagente_datos_inc + WHERE id_agente_modulo=".$row["id_agente_modulo"]; + $result=mysql_query($sql_delete4); + } + $sql_delete2 ="DELETE FROM tagente_modulo + WHERE id_agente = ".$id_agente; + $sql_delete3 ="DELETE FROM tagente_estado + WHERE id_agente = ".$id_agente; + $result=mysql_query($sql_delete2); + $result=mysql_query($sql_delete3); + audit_db($id_user,$REMOTE_ADDR, "Agent '$agent_name' deleted", + "Agent Management"); + } else { // NO permissions. audit_db($id_user,$REMOTE_ADDR, "ACL Violation", - "Trying to access Agent Management"); + "Trying to delete agent '$agent_name'"); require ("general/noaccess.php"); exit; } - - if (isset($_GET["offset"])) - $offset = entrada_limpia($_GET["offset"]); - else - $offset = 0; - - if (isset($_GET["borrar_agente"])){ // if delete agent - $id_agente = entrada_limpia($_GET["borrar_agente"]); - $agent_name = dame_nombre_agente($id_agente); - $id_grupo = dame_id_grupo($id_agente); - if (give_acl($id_user, $id_grupo, "AW")==1){ - // Firts delete from agents table - $sql_delete= "DELETE FROM tagente - WHERE id_agente = ".$id_agente; - $result=mysql_query($sql_delete); - if (! $result) - echo "

".$lang_label["delete_agent_no"]."

"; - else - echo "

".$lang_label["delete_agent_ok"]."

"; - // Delete agent access table - $sql_delete = "DELETE FROM tagent_access - WHERE id_agent = ".$id_agente; - // Delete tagente_datos data - $result=mysql_query($sql_delete); - $sql_delete4="DELETE FROM tagente_datos - WHERE id_agente=".$id_agente; - $result=mysql_query($sql_delete4); - // Delete tagente_datos_string data - $result=mysql_query($sql_delete); - $sql_delete4="DELETE FROM tagente_datos_string - WHERE id_agente=".$id_agente; - $result=mysql_query($sql_delete4); - // Delete from tagente_datos - $sql1='SELECT * FROM tagente_modulo - WHERE id_agente = '.$id_agente; - $result1=mysql_query($sql1); - while ($row=mysql_fetch_array($result1)){ - $sql_delete4="DELETE FROM tagente_datos_inc - WHERE id_agente_modulo=".$row["id_agente_modulo"]; - $result=mysql_query($sql_delete4); - } - $sql_delete2 ="DELETE FROM tagente_modulo - WHERE id_agente = ".$id_agente; - $sql_delete3 ="DELETE FROM tagente_estado - WHERE id_agente = ".$id_agente; - $result=mysql_query($sql_delete2); - $result=mysql_query($sql_delete3); - audit_db($id_user,$REMOTE_ADDR, "Agent '$agent_name' deleted", - "Agent Management"); - } else { // NO permissions. - audit_db($id_user,$REMOTE_ADDR, "ACL Violation", - "Trying to delete agent '$agent_name'"); - require ("general/noaccess.php"); - exit; - } - } - echo "

".$lang_label["agent_conf"]." > ".$lang_label["agent_defined2"]." - - ".$lang_label["help"]."

"; - - $sql1="SELECT id_agente, nombre, id_grupo, comentarios, id_os +} +echo "

".$lang_label["agent_conf"]." > ".$lang_label["agent_defined2"]." + +".$lang_label["help"]."

"; + +// Show group selector +if (isset($_POST["ag_group"])){ + $ag_group = $_POST["ag_group"]; + echo ""; +} else { + echo ""; +} + +echo ""; +echo ""; +echo " + +
".$lang_label["group"].""; +echo ""; +echo " + +
"; +if ($ag_group > 1){ + $sql1="SELECT id_agente, nombre, id_grupo, comentarios, id_os + FROM tagente WHERE id_grupo = $ag_group ORDER BY nombre LIMIT $offset, $block_size"; + $sql2="SELECT COUNT(id_agente) FROM tagente WHERE id_grupo = $ag_group"; +} else { + $sql1="SELECT id_agente, nombre, id_grupo, comentarios, id_os FROM tagente ORDER BY nombre LIMIT $offset, $block_size"; - $result=mysql_query($sql1); - $sql2="SELECT COUNT(id_agente) FROM tagente"; - $result2=mysql_query($sql2); - $row2=mysql_fetch_array($result2); - $total_events = $row2[0]; +} +$result=mysql_query($sql1); +$result2=mysql_query($sql2); +$row2=mysql_fetch_array($result2); +$total_events = $row2[0]; - // Prepare pagination - echo "
"; - pagination ($total_events, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente", $offset); - echo "
"; - - if (mysql_num_rows($result)){ - echo ""; - echo ""; - // Operating System icon - echo ""; - // Group icon and name - echo ""; - // Description - echo ""; - // Action - echo ""; +// Prepare pagination +pagination ($total_events, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente", $offset); +echo "
"; + +if (mysql_num_rows($result)){ + echo "
".$lang_label["agent_name"]; - echo "".$lang_label["os"]; - echo "".$lang_label["group"]; - echo "".$lang_label["description"]; - echo "".$lang_label["delete"]; - $color=1; - while ($row=mysql_fetch_array($result)){ - $id_grupo = $row["id_grupo"]; - if ($color == 1){ - $tdcolor = "datos"; - $color = 0; - } - else { - $tdcolor = "datos2"; - $color = 1; - } - if (give_acl($id_user, $id_grupo, "AW")==1){ - // Agent name - echo "
- ".$row["nombre"]." - - -   ".dame_grupo($id_grupo)."".$row["comentarios"]." - -
"; + echo ""; + // Operating System icon + echo ""; + // Group icon and name + echo ""; + // Description + echo ""; + // Action + echo ""; } - echo ""; - echo ""; - echo "
".$lang_label["agent_name"]; + echo "".$lang_label["os"]; + echo "".$lang_label["group"]; + echo "".$lang_label["description"]; + echo "".$lang_label["delete"]; + $color=1; + while ($row=mysql_fetch_array($result)){ + $id_grupo = $row["id_grupo"]; + if ($color == 1){ + $tdcolor = "datos"; + $color = 0; } + else { + $tdcolor = "datos2"; + $color = 1; + } + if (give_acl($id_user, $id_grupo, "AW")==1){ + // Agent name + echo "
+ ".$row["nombre"]." + + +   ".dame_grupo($id_grupo)."".$row["comentarios"]." + +
"; - echo "
"; - echo ""; - echo "
"; - } else { - // If no data... let's show a beautiful button to create agent - // This is a piece of crap because we're duplicanting code above - // of this, don't do again, Raul, please. - echo "
".$lang_label["no_agent_def"]."
"; - echo "
"; - echo ""; - echo "
"; } + echo "
"; + echo ""; + echo "
"; + echo ""; + echo "
"; + echo ""; +} else { + // If no data... let's show a beautiful button to create agent + // This is a piece of crap because we're duplicanting code above + // of this, don't do again, Raul, please. + echo "
".$lang_label["no_agent_def"]."
"; + echo "
"; + echo ""; + echo "
"; +} ?> diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 8030004743..d71f7ab06b 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -1,3 +1,27 @@ + +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// +// 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; 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. +?> +".$lang_label["network_component_management"].""; +echo ''; + +// Different Form url if it's a create or if it's a update form +if ($id_nc != -1) + echo ""; +else + echo ""; +echo ""; +echo '"; +echo ""; +echo '"; +echo ""; + +echo "
"; + +echo "
'.$lang_label["module_name"]; +echo ""; + +//-- Module type combobox +echo "".$lang_label["module_type"]; +echo ""; +echo '"; + +echo "
".$lang_label["group"]; +echo ""; +echo ""; + + +echo "".$lang_label["module_group"]; +echo ''; +echo '"; + +echo "
'.$lang_label["module_interval"]; +echo ''; +echo ''; +?> + + + + +
+ + + + + + +
+ + + + + +
+ + + + +'.$lang_label["comments"]; +echo ''; +echo '"; +echo "
"; +if ($id_nc != "-1") + echo ''; +else + echo ''; +echo ""; +echo "
"; + +?> \ No newline at end of file diff --git a/pandora_console/godmode/modules/manage_network_templates.php b/pandora_console/godmode/modules/manage_network_templates.php new file mode 100644 index 0000000000..8b6506909e --- /dev/null +++ b/pandora_console/godmode/modules/manage_network_templates.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/pandora_console/godmode/modules/module_list.php b/pandora_console/godmode/modules/module_list.php new file mode 100644 index 0000000000..fe3fc0a70c --- /dev/null +++ b/pandora_console/godmode/modules/module_list.php @@ -0,0 +1,112 @@ + +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// +// 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; 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. +// Load global vars +require("include/config.php"); + +if (comprueba_login() == 0) + $id_user = $_SESSION["id_usuario"]; + +if (give_acl($id_user, 0, "PM")==1) { + if (isset($_POST["update_module"])){ // if modified any parameter + $name = entrada_limpia($_POST["name"]); + $id_type = entrada_limpia($_POST["id_type"]); + $description = entrada_limpia($_POST["description"]); + $icon = entrada_limpia($_POST["icon"]); + $category = entrada_limpia($_POST["category"]); + $sql_update ="UPDATE ttipo_modulo + SET descripcion = '".$description."', categoria = '".$category."', + nombre = '".$name."', icon = '".$icon."' + WHERE id_tipo = '".$id_type."'"; + $result=mysql_query($sql_update); + if (! $result) + echo "

".$lang_label["modify_module_no"]."

"; + else + echo "

".$lang_label["modify_module_ok"]."

"; + } + + /*if (isset($_GET["borrar_grupo"])){ // if delete + $id_borrar_modulo = entrada_limpia($_GET["id_grupo"]); + + // First delete from tagente_modulo + $sql_delete= "DELETE FROM tgrupo WHERE id_grupo = ".$id_borrar_modulo; + $result=mysql_query($sql_delete); + if (! $result) + echo "

".$lang_label["delete_group_no"]."

"; + else + echo "

".$lang_label["delete_group_ok"]."

"; + }*/ + echo "

".$lang_label["module_management"]."

"; + echo "

".$lang_label["defined_modules"]."

"; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $sql1='SELECT * FROM ttipo_modulo ORDER BY nombre'; + $result=mysql_query($sql1); + $color=0; + while ($row=mysql_fetch_array($result)){ + if ($color == 1){ + $tdcolor = "datos"; + $color = 0; + } + else { + $tdcolor = "datos2"; + $color = 1; + } + if ($row["id_grupo"] != 1){ + echo " + + + + + + "; + } + } + echo ""; + echo "
".$lang_label["icon"]."".$lang_label["name"]."".$lang_label["type"]."".$lang_label["descripcion"]."
+ + + ".$row["nombre"]." + + ".give_modulecategory_name ($row["categoria"])." + + ".$row["descripcion"]." +
"; + echo "
"; + echo ""; + echo "
"; + +} // Fin pagina +else { + audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access module management"); + require ("general/noaccess.php"); +} +?> \ No newline at end of file diff --git a/pandora_console/godmode/servers/modificar_server.php b/pandora_console/godmode/servers/modificar_server.php index 3296a0296f..b7a7591f02 100644 --- a/pandora_console/godmode/servers/modificar_server.php +++ b/pandora_console/godmode/servers/modificar_server.php @@ -1,14 +1,20 @@ +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// // 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; either version 2 -// of the License, or (at your option) any later version. +// as published by the Free Software Foundation; 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 @@ -16,7 +22,6 @@ // 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. - // Load global vars require("include/config.php"); @@ -66,7 +71,7 @@ if (comprueba_login() == 0) { echo ""; echo "".$lang_label["name"].""; echo "".$lang_label['ip_address'].""; - echo "".$lang_label['description']."".$lang_label['description'].""; } else { echo "
".$lang_label["no_server"]."
"; diff --git a/pandora_console/godmode/setup/setup.php b/pandora_console/godmode/setup/setup.php index 47a5ea9554..c5321640b9 100644 --- a/pandora_console/godmode/setup/setup.php +++ b/pandora_console/godmode/setup/setup.php @@ -1,14 +1,20 @@ +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// // 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; either version 2 -// of the License, or (at your option) any later version. +// as published by the Free Software Foundation; 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 @@ -29,18 +35,19 @@ if (comprueba_login() == 0) $days_purge=$_POST["days_purge"]; $config_graph_res=$_POST["graph_res"]; $config_step_compact=$_POST["step_compact"]; - $config_graph_order=$_POST["graph_order"]; - $config_truetype=$_POST["truetype"]; $config_bgimage=$_POST["bgimage"]; + $config_show_unknown=$_POST["show_unknown"]; + $config_show_lastalerts=$_POST["show_lastalerts"]; + $result2=mysql_query("UPDATE tconfig SET VALUE='".$block_size."' WHERE TOKEN='block_size'"); $result2=mysql_query("UPDATE tconfig SET VALUE='".$language_code."' WHERE TOKEN='language_code'"); $result2=mysql_query("UPDATE tconfig SET VALUE='".$days_purge."' WHERE TOKEN='days_purge'"); $result2=mysql_query("UPDATE tconfig SET VALUE='".$days_compact." ' WHERE TOKEN='days_compact'"); $result2=mysql_query("UPDATE tconfig SET VALUE='".$config_graph_res."' WHERE TOKEN='graph_res'"); $result2=mysql_query("UPDATE tconfig SET VALUE='".$config_step_compact."' WHERE TOKEN='step_compact'"); - $result2=mysql_query("UPDATE tconfig SET VALUE='".$config_truetype."' WHERE TOKEN='truetype'"); - $result2=mysql_query("UPDATE tconfig SET VALUE='".$config_graph_order."' WHERE TOKEN='graph_order'"); $result2=mysql_query("UPDATE tconfig SET VALUE='".$config_bgimage."' WHERE token='bgimage'"); + $result2=mysql_query("UPDATE tconfig SET VALUE='".$config_show_unknown."' WHERE token='show_unknown'"); + $result2=mysql_query("UPDATE tconfig SET VALUE='".$config_show_lastalerts."' WHERE token='show_lastalerts'"); } echo "

".$lang_label["setup_screen"]."

"; echo "

".$lang_label["general_config"]." ".$lang_label["help"]."

"; @@ -57,7 +64,6 @@ if (comprueba_login() == 0) if ($row2=mysql_fetch_array($result2)){ echo ''; + echo ''; } else { - echo ''; - echo ''; + echo ''; + echo ''; } - - echo ''.$lang_label["truetype"]; - echo ''; + if ($config_show_lastalerts==1) { echo ''; echo ''; } diff --git a/pandora_console/include/config.php b/pandora_console/include/config.php index 4bf8dc3380..f50450e981 100644 --- a/pandora_console/include/config.php +++ b/pandora_console/include/config.php @@ -1,15 +1,19 @@ +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// // 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 version 2 +// as published by the Free Software Foundation; 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 @@ -17,7 +21,6 @@ // 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. - // This is the base config file //Pandora Version @@ -60,33 +63,43 @@ if (! mysql_connect($dbhost,$dbuser,$dbpassword)){ '); } + +// Default values for config +$language_code = "en"; +$block_size = 25; +$days_purge = 30; +$days_compact = 7; +$config_graph_res = 3; +$config_step_compact = 1; +$config_bgimage = "background4.jpg"; +$config_show_unknown = 0; +$config_show_lastalerts = 0; + mysql_select_db($dbname); $result2=mysql_query("SELECT * FROM tconfig"); while ($row2=mysql_fetch_array($result2)){ switch ($row2["token"]) { - case "language_code": $language_code=$row2["value"]; - break; - case "block_size": $block_size=$row2["value"]; - break; - case "days_purge": $days_purge=$row2["value"]; - break; - case "days_compact": $days_compact=$row2["value"]; - break; - case "graph_res": $config_graph_res=$row2["value"]; - break; - case "step_compact": $config_step_compact=$row2["value"]; - break; - case "truetype": $config_truetype=$row2["value"]; - break; - case "graph_order": $config_graph_order=$row2["value"]; - break; - case "bgimage": $config_bgimage=$row2["value"]; - break; + case "language_code": $language_code = $row2["value"]; + break; + case "block_size": $block_size = $row2["value"]; + break; + case "days_purge": $days_purge = $row2["value"]; + break; + case "days_compact": $days_compact = $row2["value"]; + break; + case "graph_res": $config_graph_res = $row2["value"]; + break; + case "show_unknown": $config_show_unknown = $row2["value"]; + break; + case "show_lastalerts": $config_show_lastalerts = $row2["value"]; + break; } } -if ($language_code == 'ast_es') { - $help_code='ast'; - } -else $help_code = substr($language_code,0,2); + +// Adjist helpcode from language_code +if ($language_code == 'ast_es') + $help_code = 'ast'; +else + $help_code = substr($language_code,0,2); ?> diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 0e074bfd33..0dd1538b1a 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -2,15 +2,19 @@ // Pandora FMS - the Free monitoring system // ======================================== -// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info -// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas +// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com +// Main PHP/SQL code development and project architecture and management // Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com -// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net +// CSS and some PHP additions // Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com - +// Javascript Active Console code. +// Copyright (c) 2006 Jose Navarro +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// // 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 version 2 +// as published by the Free Software Foundation; 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 @@ -18,8 +22,6 @@ // 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. -// Functions - // --------------------------------------------------------------- // input: var, string. // mesg, mesage to show, var content. @@ -363,4 +365,15 @@ function pagination ($count, $url, $offset ) { } } +// Render data in a fashion way :-) +function format_numeric ( $number, $decimals=2, $dec_point=".", $thousands_sep=",") { + if ($number == 0) + return 0; + // If has decimals + if (fmod($number , 1)> 0) + return number_format ($number, 2, $dec_point, $thousands_sep); + else + return number_format ($number, 0, $dec_point, $thousands_sep); +} + ?> diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index fd4946647a..39cdaa1bc4 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -1,11 +1,27 @@ , 2003-2006 -// Raul Mateos , 2005-2006 - +// Pandora FMS - the Free monitoring system +// ======================================== +// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com +// Main PHP/SQL code development and project architecture and management +// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com +// CSS and some PHP additions +// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com +// Javascript Active Console code. +// Copyright (c) 2006 Jose Navarro +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// +// 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; 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 functions // --------------------------------------------------------------- @@ -399,7 +415,7 @@ function give_server_name($id_server){ // Return name of a module type when given ID // --------------------------------------------------------------- -function dame_nombre_tipo_modulo($id){ +function dame_nombre_tipo_modulo ($id){ require("config.php"); $query1="SELECT * FROM ttipo_modulo WHERE id_tipo =".$id; $resq1=mysql_query($query1); @@ -414,14 +430,14 @@ function dame_nombre_tipo_modulo($id){ // Return name of a group when given ID // --------------------------------------------------------------- -function dame_nombre_grupo($id){ - require("config.php"); - $query1="SELECT * FROM tgrupo WHERE id_grupo =".$id; - $resq1=mysql_query($query1); - if ($rowdup=mysql_fetch_array($resq1)){ - $pro=$rowdup["nombre"]; - } - else $pro = ""; +function dame_nombre_grupo ($id){ + require ("config.php"); + $query1 = "SELECT * FROM tgrupo WHERE id_grupo = ".$id; + $resq1 = mysql_query($query1); + if ($rowdup = mysql_fetch_array ($resq1)) + $pro = $rowdup["nombre"]; + else + $pro = ""; return $pro; } @@ -559,6 +575,7 @@ function dame_so_icon($id){ return $pro; } + // --------------------------------------------------------------- // Return email of a user given ID // --------------------------------------------------------------- @@ -847,5 +864,38 @@ function group_belong_group($id_group_a, $id_groupset){ return 0; } +// --------------------------------------------------------------- +// Return category name +// --------------------------------------------------------------- +function give_modulecategory_name ($value) { + require("config.php"); + require ("include/languages/language_".$language_code.".php"); + switch ($value) { + case 0: return $lang_label["cat_0"]; + break; + case 1: return $lang_label["cat_1"]; + break; + case 2: return $lang_label["cat_2"]; + break; + case 3: return $lang_label["cat_3"]; + break; + } + return $lang_label["unknown"]; +} + +// --------------------------------------------------------------- +// Return network component group name given its ID +// --------------------------------------------------------------- + +function give_network_component_group_name ($id){ + require("config.php"); + $query1="SELECT * FROM tnetwork_component_group WHERE id_sg= ".$id; + $resq1=mysql_query($query1); + if ($rowdup=mysql_fetch_array($resq1)) + $pro=$rowdup["name"]; + else + $pro = ""; + return $pro; +} ?> diff --git a/pandora_console/include/languages/language_en.php b/pandora_console/include/languages/language_en.php index 284ac41c95..bcf8848fd0 100644 --- a/pandora_console/include/languages/language_en.php +++ b/pandora_console/include/languages/language_en.php @@ -1,15 +1,19 @@ +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// // 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 version 2 +// as published by the Free Software Foundation; 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 @@ -17,7 +21,6 @@ // 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. - $lang_label["view_agents"]="View Agents"; $lang_label["manage_incidents"]="Manage Incidents"; $lang_label["view_users"]= "View Users"; @@ -138,7 +141,7 @@ $lang_label["assigned_modules"]="Assigned modules"; $lang_label["learning_mode"]="Learning mode"; $lang_label["assigned_alerts"]="Assigned alerts"; $lang_label["alert_asociation_form"]="Alert association form"; -$lang_label["module_asociation_form"]="Module association form"; +$lang_label["module_asociation_form"]="Module assignment"; $lang_label["name_type"]="Name / Type"; $lang_label["min_max"]="Min/Max"; $lang_label["detailed_monitoragent_state"]="Monitor detail"; @@ -395,7 +398,7 @@ $lang_label["copy_conf"]="Copy Configuration"; $lang_label["fromagent"]="From Agent"; $lang_label["toagent"]="To Agent(s):"; -$lang_label["step_compact"]="Compact interpolation (Hours: 1 Fine, 10 medium, 20 bad)"; +$lang_label["step_compact"]="Compact interpolation in hours (1 Fine-20 bad)"; $lang_label["setup_links"]="Links"; $lang_label["create_link_no"]="There was a problem creating link"; @@ -655,19 +658,55 @@ $lang_label["no_monitors_g"]="This group doesn't have any monitor"; // New strings for 1.3 version -// 15 dev, new for 1.3 dev $lang_label["reporting"]="Reporting"; $lang_label["agent_general_reporting"]="Agent overview"; - -// 5 Jan 2007 $lang_label["active_console"]="Active console"; - $lang_label["validate_event_failed"]="Event validation failed"; -// 21 feb 2007 - $lang_label["load"]="Load"; $lang_label["information"]="General information"; - +$lang_label["parent"]="Parent"; +$lang_label["show_unknown"]="Show unknown modules in global view"; +$lang_label["show_lastalerts"]="Show last fired alerts in global view"; +$lang_label["manage_modules"]="Manage modules"; +$lang_label["modify_module_ok"]="Module updated successfully"; +$lang_label["modify_module_no"]="Problem modifying module"; +$lang_label["module_management"]="Module management"; +$lang_label["defined_modules"]="Defined modules"; +$lang_label["cat_0"] = "Software agent data"; +$lang_label["cat_1"] = "Software agent monitor"; +$lang_label["cat_2"] = "Network agent data"; +$lang_label["cat_3"] = "Network agent monitor"; +$lang_label["unknown"] = "Unknown"; +$lang_label["create_module"]="Create module"; +$lang_label["network_templates"]="Network templates"; +$lang_label["snmp_modules"]="SNMP modules"; +$lang_label["network_components_groups"]="Network components groups"; +$lang_label["network_components"]="Network components"; +$lang_label["create_ok"]="Created successfully"; +$lang_label["create_no"]="Not created. Error inserting data"; +$lang_label["modify_ok"]="Updated successfully"; +$lang_label["modify_no"]="Not updated. Error updating data"; +$lang_label["delete_no"]="Not deleted. Error deleting data"; +$lang_label["delete_ok"]="Deleted successfully"; +$lang_label["network_component_group_management"]="Network Component group management"; +$lang_label["network_component_management"]="Network component management"; +$lang_label["oid"]="OID"; +$lang_label['recon_server']="Recon Server"; +$lang_label['snmp_console']="SNMP Console"; +$lang_label['network_server']="Network Server"; +$lang_label['data_server']="Data Server"; +$lang_label["md5_checksum"]="MD5 Check"; +$lang_label["nc_groups"]="Component groups"; +$lang_label["nc.group"]="NC.Group"; +$lang_label["manual_config"]="Manual setup"; +$lang_label["network_component"]="Network Component"; +$lang_label["not_available_in_edit_mode"]="Not available in edition mode"; +$lang_label["using_network_component"]="Using Network Component"; +$lang_label["view_mode"]="View mode"; +$lang_label["setup_mode"]="Setup mode"; +$lang_label["refresh_data"]="Refresh data"; +$lang_label["lag"]="LAG"; +$lang_label["N/A"]="N/A"; global $lang_label; global $help_label; ?> \ No newline at end of file diff --git a/pandora_console/include/languages/language_es_es.php b/pandora_console/include/languages/language_es_es.php index 406b9b05d3..8200d6bf97 100644 --- a/pandora_console/include/languages/language_es_es.php +++ b/pandora_console/include/languages/language_es_es.php @@ -1,14 +1,20 @@ +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// // 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; either version 2 -// of the License, or (at your option) any later version. +// as published by the Free Software Foundation; 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 @@ -16,7 +22,6 @@ // 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. - $lang_label["view_agents"]="Ver agentes"; $lang_label["manage_incidents"]="Gestión de incidentes"; $lang_label["view_users"]="Ver usuarios"; @@ -621,7 +626,7 @@ $lang_label["no_event"]="No hay eventos"; $lang_label["agent_access_rate"]="Accesibilidad agente (24h)"; $lang_label["agent_module_shareout"]="Distribución de módulos"; $lang_label["int"]="Itv."; // Nombre corto para intervalo -$lang_label["manage_servers"]="Gestión de servidores"; +$lang_label["manage_servers"]="Gestión servidores"; $lang_label["update_server"]="Actualizar servidor"; $lang_label["upd_server_ok"]="Servidor actualizado correctamente"; $lang_label["upd_server_no"]="Ha habido un problema al actualizar el servidor"; @@ -652,6 +657,7 @@ $lang_label["reporting"]="Informes"; $lang_label["agent_general_reporting"]="Agent overview"; $lang_label["active_console"]="Consola activa"; +$lang_label["parent"]="Padre"; global $lang_label; global $help_label; diff --git a/pandora_console/include/styles/god.css b/pandora_console/include/styles/god.css index 0ca206d095..59a4ec8049 100644 --- a/pandora_console/include/styles/god.css +++ b/pandora_console/include/styles/god.css @@ -16,12 +16,12 @@ div#menug { margin-bottom: 15px; } #god1 li, #god2 li, #god3 li, #god4 li, #god5 li, #god6 li, #god7 li, #god8 li, #god1s li, -#god2s li, #god3s li, #god4s li, #god5s li, #god6s li, #god7s li, #god8s li { +#god2s li, #god3s li, #god4s li, #god5s li, #god6s li, #god7s li, #god8s li, #god_module li, #god_module_sel li { padding: 0px 0px 0px 30px; } div#god1>ul, div#god2>ul, div#god3>ul, div#god4>ul, div#god5>ul, div#god6>ul, div#god7>ul, div#god8>ul, div#god1s>ul, div#god2s>ul, div#god3s>ul, div#god4s>ul, -div#god5s>ul, div#god6s>ul, div#god7s>ul, div#god8s>ul { +div#god5s>ul, div#god6s>ul, div#god7s>ul, div#god8s>ul, div#god_module>ul, div#god_module_sel>ul { width: 124px; } #god1 li, #god1 li:hover, #god1s li { @@ -48,6 +48,9 @@ div#god5s>ul, div#god6s>ul, div#god7s>ul, div#god8s>ul { #god8 li, #god8 li:hover, #god8s li { background: url(../../images/god8.gif) no-repeat 5px 3px; } +#god_module li, #god_module li:hover, #god_module_sel li { + background: url(../../images/brick.png) no-repeat 4px 5px; +} div.arrowg>ul, div.arrowgs>ul { width: 74%; } @@ -59,7 +62,7 @@ div.arrowg>ul, div.arrowgs>ul { #god a:hover, #god1 li:hover, #god1s li, #god2 li:hover, #god2s li, #god3 li:hover, #god3s li, #god4 li:hover, #god4s li, #god5 li:hover, #god5s li, #god6 li:hover, #god6s li, -#god7 li:hover, #god7s li, #god8 li:hover, #god8s li, +#god7 li:hover, #god7s li, #god8 li:hover, #god8s li, #god_module li:hover, #god_module_sel li, .arrowg li:hover, .arrowgs li { background-color: #efefbd; diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index ec8b4add73..cfef38093f 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -1,15 +1,19 @@ /* // Pandora FMS - the Free monitoring system // ======================================== -// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info -// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas +// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com +// Main PHP/SQL code development and project architecture and management // Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com -// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net +// CSS and some PHP additions // Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com - +// Javascript Active Console code. +// Copyright (c) 2006 Jose Navarro +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// // 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 version 2 +// as published by the Free Software Foundation; 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 @@ -361,9 +365,12 @@ td.datosf9i, td.datos2f9i { .w155, .w155f10 { width: 155px; } -.top, .bgt, .f9l30t, td.datost, td.datos2t { +.top, .top_red, .bgt, .f9l30t, td.datost, td.datos2t { vertical-align: top; } +.top_red { + background: #ff0000; +} .bot, .titb, td.datosb { vertical-align: bottom; } @@ -484,7 +491,7 @@ div.data_box { background: #0FB800; padding: 2px 10px 2px 10px; color: #fff; - border: 1px solid #0F5800; + border: 1px solid #0D9D00; font-weight: bold; line-height: 18px; } @@ -509,6 +516,36 @@ div.data_box { background: #db6351; border-top: none; } +/* TAB TITLE */ + +#menu_tab_left .mn, #menu_tab_left ul, #menu_tab_left .mn ul +{ + padding: 0px 0px 0px 0px; + list-style: none; + margin: 0px 0px 0px -20px; +} +#menu_tab_left .mn li +{ + float: left; + position: relative; +} +#menu_tab_left li a, #menu_tab_left li.nomn a +{ + background: #D84437; + padding: 2px 10px 2px 10px; + color: #fff; + border: 1px solid #C43E32; + font-weight: bold; + line-height: 18px; +} + +#menu_tab_left .mn li a +{ + display: block; + text-decoration: none; +} + + span.users { background: url(../../images/group.png) no-repeat; } diff --git a/pandora_console/index.php b/pandora_console/index.php index f5073bcf78..a2ff8dcb75 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -2,15 +2,19 @@ // Pandora FMS - the Free monitoring system // ======================================== -// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info -// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas +// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com +// Main PHP/SQL code development and project architecture and management // Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com -// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net +// CSS and some PHP additions // Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com - +// Javascript Active Console code. +// Copyright (c) 2006 Jose Navarro +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// // 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 version 2 +// as published by the Free Software Foundation; 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/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index 01ae7147c0..dde5a518f5 100644 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -1,15 +1,19 @@ +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// // 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 version 2 +// as published by the Free Software Foundation; 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 @@ -17,7 +21,6 @@ // 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. - // Load global vars require("include/config.php"); @@ -64,8 +67,7 @@ if (comprueba_login() == 0) { '.$lang_label["agent_name"].' '.strtoupper(salida_limpia($nombre_agente)); - echo " -   "; + echo "".$lang_label["refresh_data"].""."  "; // Data base access graph echo ''; diff --git a/pandora_console/operation/agentes/estado_grupo.php b/pandora_console/operation/agentes/estado_grupo.php index 2d863a2c17..0bbee361a1 100644 --- a/pandora_console/operation/agentes/estado_grupo.php +++ b/pandora_console/operation/agentes/estado_grupo.php @@ -2,15 +2,19 @@ // Pandora FMS - the Free monitoring system // ======================================== -// Copyright (c) 2004-2007 Sancho Lerena, slerena@openideas.info -// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas +// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com +// Main PHP/SQL code development and project architecture and management // Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com -// Copyright (c) 2006-2007 Jose Navarro jose@jnavarro.net +// CSS and some PHP additions // Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com - +// Javascript Active Console code. +// Copyright (c) 2006 Jose Navarro +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// // 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 version 2 +// as published by the Free Software Foundation; 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 @@ -18,7 +22,6 @@ // 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. - // Load global vars require("include/config.php"); @@ -54,7 +57,7 @@ $contador_grupo = 0; $contador_agente = 0; $array_index = 0; - + // Prepare data to show // For each valid group for this user, take data from agent and modules foreach ($mis_grupos as $migrupo) { if ($migrupo != "") { @@ -78,53 +81,65 @@ $id_agente = $row1["id_agente"]; // Check for recent alerts + if ($config_show_lastalerts == 1) if (check_alert_fired($id_agente) == 1) { $grupo[$array_index]["alerts"]++; } $grupo[$array_index]["agent"]++; $grupo[$array_index]["group"] = dame_nombre_grupo ($migrupo); + // Estado grupo, agent $contador_agente++; - $sql3 = "SELECT estado, timestamp, id_agente_modulo, + $sql3 = "SELECT estado, utimestamp, id_agente_modulo, datos FROM tagente_estado WHERE id_agente = ".$row1["id_agente"]; $result3 = mysql_query ($sql3); while ($row3 = mysql_fetch_array ($result3)) { - $estado = $row3["estado"]; - // Get module interval + $estado = $row3["estado"]; $ahora = date ("Y/m/d H:i:s"); - $sql4 = "SELECT module_interval - FROM tagente_modulo - WHERE id_agente_modulo = ".$row3["id_agente_modulo"]; - $result4 = mysql_query ($sql4); - if ($row4 = mysql_fetch_array ($result4)) { - $module_interval = $row4["module_interval"]; - if ($module_interval > 0) { - $intervalo_comp = $module_interval; - } else { - $intervalo_comp = $intervalo; - } - } - $ultimo_contacto_modulo = $row3["timestamp"]; - - // Defines if module is down (interval x 2 > time last contact) - if ($ultimo_contacto_modulo != "0000-00-00 00:00:00") { - $seconds = strtotime ($ahora) - - strtotime ($ultimo_contacto_modulo); - if ($seconds >= ($intervalo_comp * 2)) { - $grupo[$array_index]["down"]++; - } elseif ($estado != 100) { - if ($row3["datos"] != 0) { - $grupo[$array_index]["ok"]++; + if ($config_show_unknown != 0){ + // Get module interval + $sql4 = "SELECT module_interval + FROM tagente_modulo + WHERE id_agente_modulo = ".$row3["id_agente_modulo"]; + $result4 = mysql_query ($sql4); + if ($row4 = mysql_fetch_array ($result4)) { + $module_interval = $row4["module_interval"]; + if ($module_interval > 0) { + $intervalo_comp = $module_interval; } else { - $grupo[$array_index]["bad"]++; + $intervalo_comp = $intervalo; } - } elseif ($estado == 100) // For data module, not monitors - $grupo[$array_index]["data"]++; // Data module - } + } + $ultimo_contacto_modulo = $row3["utimestamp"]; + // Defines if module is down (interval x 2 > time last contact) + if ($ultimo_contacto_modulo != 0) { + $seconds = strtotime ($ahora) - + $ultimo_contacto_modulo; + if ($seconds >= ($intervalo_comp * 2)) { + $grupo[$array_index]["down"]++; + } elseif ($estado != 100) { + if ($row3["datos"] != 0) { + $grupo[$array_index]["ok"]++; + } else { + $grupo[$array_index]["bad"]++; + } + } elseif ($estado == 100) // For data module, not monitors + $grupo[$array_index]["data"]++; // Data module + } + // do not use module interval neither down check + } elseif ($estado != 100) { + if ($row3["datos"] != 0) { + $grupo[$array_index]["ok"]++; + } else { + $grupo[$array_index]["bad"]++; + } + } elseif ($estado == 100) // For data module, not monitors + $grupo[$array_index]["data"]++; // Data module } + } } if ($existen_agentes == 1){ @@ -134,16 +149,14 @@ } // Draw data - if ($contador_agente != 0) { $ancho = ceil(sqrt($array_index+1)); $real_count =0; - echo ""; + echo "
"; for ($table=0; $table < $ancho; $table++) { echo ""; for ($table_row=0; $table_row < $ancho; $table_row++) { if ($real_count < $array_index) { - $group_name = $grupo[$real_count]["group"]; $icono_grupo = $grupo[$real_count]["icon"]; $icono_type = ""; @@ -170,60 +183,76 @@ "; } - // TOOLTIP. - $celda = "
- "; + + // Yellow border if agents down / unknown + if ($grupo[$real_count]["down"] > 0) + $celda = ""; + + // Red border if agents bad + if ($grupo[$real_count]["bad"] > 0) + $celda = ""; + + if (($grupo[$real_count]["bad"] > 0) && ($grupo[$real_count]["down"] > 0)) + $celda = ""; + + $celda .= " - - - - - -
". - $lang_label["agents"].":
". - $grupo[$real_count]["agent"]."
- - - - - - - - - - - - - - - - - - - - -
". - ucfirst($lang_label["monitors"]).":
- - ".$lang_label["ok"].": - ".$grupo[$real_count]["ok"]." -
- - ".$lang_label["down"].": ". - $grupo[$real_count]["down"]."
- - ".$lang_label["fail"].": ". - $grupo[$real_count]["bad"]."
- - ".$lang_label["alerts"].": ". - $grupo[$real_count]["alerts"]."
-
"; + class='info'>"; + + // Add group icon + $celda .= ""; + + // Add float info table + $celda .= " + + + + +
". + $lang_label["agents"].":
". + $grupo[$real_count]["agent"]."
+ + + + + + + + + + + + + + + + + + + + +
". + ucfirst($lang_label["monitors"]).":
+ + ".$lang_label["ok"].": + ".$grupo[$real_count]["ok"]." +
+ + ".$lang_label["down"].": ". + $grupo[$real_count]["down"]."
+ + ".$lang_label["fail"].": ". + $grupo[$real_count]["bad"]."
+ + ".$lang_label["alerts"].": ". + $grupo[$real_count]["alerts"]."
+
"; // Render network exec module button, only when this group is writtable by user if (give_acl ($id_user, $grupo[$real_count]["id_grupo"], "AW") == 1) { $celda .= "  ".$lang_label["help"].""; // Get all module from agent $sql_t='SELECT * FROM tagente_estado, tagente_modulo WHERE tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_agente='.$id_agente.' and tagente_estado.estado != 100 order by tagente_modulo.nombre'; $result_t=mysql_query($sql_t); if (mysql_num_rows ($result_t)) { - + echo "

".$lang_label["monitor_listing"]." ".$lang_label["help"]."

"; echo ""; echo "
".$lang_label["type"]."".$lang_label["module_name"]."".$lang_label["description"]."".$lang_label["status"]."".$lang_label["interval"]."".$lang_label["last_contact"]; $color=0; diff --git a/pandora_console/operation/agentes/estado_ultimopaquete.php b/pandora_console/operation/agentes/estado_ultimopaquete.php index 5e62df0c1e..65fa3b5b40 100644 --- a/pandora_console/operation/agentes/estado_ultimopaquete.php +++ b/pandora_console/operation/agentes/estado_ultimopaquete.php @@ -1,13 +1,19 @@ +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// // 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; either version 2 -// of the License, or (at your option) any later version. +// as published by the Free Software Foundation; 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 @@ -104,6 +110,7 @@ if (comprueba_login() == 0) { id_agente=".$id_agente."& id_agente_modulo=".$row3["id_agente_modulo"]."& flag=1& + tab=data& refr=60'> "; } else { @@ -111,7 +118,7 @@ if (comprueba_login() == 0) { sec2=operation/agentes/ver_agente& id_agente=".$id_agente."& id_agente_modulo=".$row3["id_agente_modulo"]."& - flag=1& + tab=data& refr=60'> "; } @@ -149,24 +156,25 @@ if (comprueba_login() == 0) { AND ($row3["id_tipo_modulo"] != 10) AND ($row3["id_tipo_modulo"] != 17)){ echo ""; - if (($row3["datos"] != 0) AND (is_numeric($row3["datos"]))){ - $mytempdata = fmod($row3["datos"], $row3["datos"]); - if ($mytempdata == 0) + if (($row3["datos"] != 0) AND (is_numeric($row3["datos"]))) { + $mytempdata = fmod($row3["datos"], 1); + if ($mytempdata == "0") $myvalue = intval($row3["datos"]); else $myvalue = $row3["datos"]; if ($myvalue > 1000000) { // Add sufix "M" for millions $mytempdata = $myvalue / 1000000; - echo $mytempdata." M"; + echo format_numeric($mytempdata)." M"; } elseif ( $myvalue > 1000){ // Add sufix "K" for thousands $mytempdata = $myvalue / 1000; - echo $mytempdata." K"; + echo format_numeric ($mytempdata)." K"; } else echo substr($myvalue,0,12); } elseif ($row3["datos"] == 0) echo "0"; else echo substr($row3["datos"],0,12); + $handle = "stat".$nombre_tipo_modulo."_".$nombre_agente; $url = 'reporting/procesos.php?agente='.$nombre_agente; $win_handle=dechex(crc32($nombre_agente.$row3["nombre"])); @@ -184,6 +192,7 @@ if (comprueba_login() == 0) { $link ="winopeng('reporting/stat_win.php?period=3600&id=".$row3["id_agente_modulo"]."&label=".$graph_label."&refresh=60','hour_".$win_handle."')"; echo ''; } + // STRING DATA else { # Writing string data in different way :) echo ""; echo salida_limpia(substr($row3["datos"],0,42)); diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 6ec6f6915b..2c836c88ea 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -1,15 +1,19 @@ +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es +// // 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 version 2 +// as published by the Free Software Foundation; 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 @@ -17,7 +21,6 @@ // 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. - // Load global vars require("include/config.php"); @@ -43,6 +46,16 @@ if (comprueba_login() == 0) { } } if (give_acl($id_usuario,$id_grupo, "AR") == 1){ + + echo ""; + + if (isset($_GET["tab"])) $tab = $_GET["tab"]; else @@ -55,6 +68,8 @@ if (comprueba_login() == 0) { echo "
  • Manage"; echo "
  • "; } + + // Main view echo "
  • "; echo " Main"; @@ -84,8 +99,7 @@ if (comprueba_login() == 0) { echo "
    "; case "main": require "estado_generalagente.php"; - echo "
    "; - //require "estado_monitores.php"; + require "estado_monitores.php"; break; case "data": require "estado_ultimopaquete.php"; diff --git a/pandora_console/operation/servers/view_server.php b/pandora_console/operation/servers/view_server.php index 433fb91b32..e5aa216b21 100644 --- a/pandora_console/operation/servers/view_server.php +++ b/pandora_console/operation/servers/view_server.php @@ -20,6 +20,10 @@ // Load global vars require("include/config.php"); +$modules_server = 0; +$total_modules = 0; +$total_modules_data = 0; + if (comprueba_login() == 0) { if ((give_acl($id_user, 0, "AR")==1) or (give_acl($id_user,0,"AW")) or (dame_admin($id_user)==1)) { @@ -28,26 +32,30 @@ if (comprueba_login() == 0) { echo "

    ".$lang_label["view_servers"]."

    "; echo "

    ".$lang_label["server_detail"]." ".$lang_label["help"]."

    "; - // Get total modules defined + // Get total modules defined (network) $sql1='SELECT COUNT(id_agente_modulo) FROM tagente_modulo WHERE id_tipo_modulo > 4'; $result1=mysql_query($sql1); $row1=mysql_fetch_array($result1); $total_modules = $row1[0]; - + // Get total modules defined (data) + $sql1='SELECT COUNT(processed_by_server) FROM tagente_estado WHERE processed_by_server LIKE "%_Data" '; + $result1=mysql_query($sql1); + $row1=mysql_fetch_array($result1); + $total_modules_data = $row1[0]; + // Connect DataBase $result=mysql_query($sql); if (mysql_num_rows($result)){ - echo ""; + echo "
    "; echo ""; echo ""; echo ""; - echo ""; + echo ""; + echo ""; echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + // echo ""; //echo ""; //echo ""; echo ""; @@ -61,6 +69,7 @@ if (comprueba_login() == 0) { $tdcolor = "datos2"; $color = 1; } + $id_server = $row["id_server"]; $name = $row["name"]; $address = $row["ip_address"]; $status = $row["status"]; @@ -69,25 +78,33 @@ if (comprueba_login() == 0) { $network_server = $row["network_server"]; $data_server = $row["data_server"]; $snmp_server = $row["snmp_server"]; + $recon_server = $row["recon_server"]; $master = $row["master"]; $checksum = $row["checksum"]; $description = $row["description"]; $modules_server = 0; - - // Get total modules defined for this server - $sql1='SELECT * FROM tagente where id_server = '.$row["id_server"]; - - $result1=mysql_query($sql1); - while ($row1=mysql_fetch_array($result1)){ - $sql2='SELECT COUNT(id_agente_modulo) FROM tagente_modulo WHERE id_tipo_modulo > 4 AND id_agente = '.$row1["id_agente"]; - $result2=mysql_query($sql2); - $row2=mysql_fetch_array($result2); - $modules_server = $modules_server + $row2[0]; - } + if (($network_server == 1) OR ($data_server == 1)) + if ($network_server == 1){ + // Get total modules defined for this server (network modules) + $sql1='SELECT * FROM tagente where id_server = '.$row["id_server"]; + $result1=mysql_query($sql1); + while ($row1=mysql_fetch_array($result1)){ + $sql2='SELECT COUNT(id_agente_modulo) FROM tagente_modulo WHERE id_tipo_modulo > 4 AND id_agente = '.$row1["id_agente"]; + $result2=mysql_query($sql2); + $row2=mysql_fetch_array($result2); + $modules_server = $modules_server + $row2[0]; + } + } else { + // Get total modules defined for this server (data modules) + $sql2 = "SELECT COUNT(processed_by_server) FROM tagente_estado WHERE processed_by_server = '$name'"; + $result2=mysql_query($sql2); + $row2=mysql_fetch_array($result2); + $modules_server = $row2[0]; + } echo ""; echo ""; } echo '
    ".$lang_label["name"]."".$lang_label['status']."".$lang_label['load']."".$lang_label['ip_address']."".$lang_label['modules']."".$lang_label['lag']."".$lang_label['description']."".$lang_label['network']."".$lang_label['data']."".$lang_label['snmp']."".$lang_label['master']."".$lang_label['type']."".$lang_label['master']."".$lang_label['checksum']."".$lang_label['laststart']."".$lang_label['lastupdate']."
    "; - echo "$name "; + echo "$name "; echo ""; if ($status ==0){ echo ""; @@ -95,37 +112,73 @@ if (comprueba_login() == 0) { echo ""; } echo ""; - $percentil = $modules_server / ($total_modules / 100); - echo ''; - //echo $modules_server . " / ". $total_modules; - echo ""; - echo "$address"; + if (($network_server == 1) OR ($data_server == 1)){ + // Progress bar calculations + if ($network_server == 1){ + if ($total_modules == 0) + $percentil = 0; + $percentil = $modules_server / ($total_modules / 100); + $total_modules_temp = $total_modules; + } else { + if ($total_modules_data == 0) + $percentil = 0; + else + $percentil = $modules_server / ($total_modules_data / 100); + $total_modules_temp = $total_modules_data; + } + // Progress bar render + echo ''; + } else + echo "-"; + echo ""; + if (($network_server == 1) OR ($data_server == 1)) + echo $modules_server . " / ". $total_modules_temp; + else + echo "-"; + + echo ""; + // Calculate lag: get oldest module, for this server, + // and calculate difference in seconds + // Get total modules defined for this server + if (($network_server == 1) OR ($data_server == 1)){ + $sql1 = "SELECT utimestamp, current_interval FROM tagente_estado WHERE processed_by_server = '$name' "; + $result1=mysql_query($sql1); + $nowtime = time(); + $maxlag=0; + while ($row1=mysql_fetch_array($result1)){ + if (($row1["utimestamp"] + $row1["current_interval"]) < $nowtime) + $maxlag = $nowtime - ($row1["utimestamp"] + $row1["current_interval"]); + } + echo $maxlag." sec"; + } else + echo "-"; echo "".substr($description,0,25); echo ""; if ($network_server == 1){ - echo ""; + echo " "; } - echo ""; if ($data_server == 1){ - echo ""; + echo "  "; } - echo ""; if ($snmp_server == 1){ - echo ""; + echo "  "; + } + if ($recon_server == 1){ + echo "  "; } - echo ""; if ($master == 1){ - echo ""; + echo "  "; + } + if ($checksum == 1){ + echo "  "; } - //echo ""; - //if ($checksum == 1){ - //echo ""; - //} //echo "" //.substr($laststart,0,25).""; if ($status ==0) echo ""; + else + echo ""; echo substr($keepalive,0,25)."
    '; @@ -137,5 +190,19 @@ if (comprueba_login() == 0) { audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Agent view"); require ("general/noaccess.php"); } + echo ""; + echo "
    "; + echo "".$lang_label["network_server"]; + echo ""; + echo "".$lang_label["master"]; + echo ""; + echo "".$lang_label["data_server"]; + echo ""; + echo "".$lang_label["md5_checksum"]; + echo ""; + echo "".$lang_label["snmp_console"]; + echo ""; + echo "".$lang_label["recon_server"]; + echo "
    "; } ?> \ No newline at end of file diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 42677d60ea..9e7c4e44a6 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -1,131 +1,244 @@ -/* -// Pandora FMS - the Free monitoring system -// ======================================== -// 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 +-- MySQL dump 10.10 +-- +-- Host: localhost Database: pandora +-- ------------------------------------------------------ +-- Server version 5.0.24a-Debian_9-log -// 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 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. -Create Database if not exists -*/ -create database if not exists `pandora`; -USE `pandora`; +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -# Database: pandora -# Table: 'tagent_access' -# +-- +-- Table structure for table `estado_consola` +-- + +DROP TABLE IF EXISTS `estado_consola`; +CREATE TABLE `estado_consola` ( + `id_usuario` varchar(50) NOT NULL, + `idPerfilActivo` int(5) NOT NULL, + `idVistaActiva` int(5) NOT NULL, + `menuX` int(5) NOT NULL, + `menuY` int(5) NOT NULL, + PRIMARY KEY (`id_usuario`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Table structure for table `objeto_consola` +-- + +DROP TABLE IF EXISTS `objeto_consola`; +CREATE TABLE `objeto_consola` ( + `id_objeto` int(5) NOT NULL auto_increment, + `nom_img` varchar(50) NOT NULL, + `tipo` varchar(2) NOT NULL, + `left` int(5) NOT NULL, + `top` int(5) NOT NULL, + `id_tipo` varchar(20) NOT NULL, + `idVista` int(5) NOT NULL, + PRIMARY KEY (`id_objeto`) +) ENGINE=MyISAM AUTO_INCREMENT=37 DEFAULT CHARSET=latin1; + +-- +-- Table structure for table `perfil` +-- + +DROP TABLE IF EXISTS `perfil`; +CREATE TABLE `perfil` ( + `idPerfil` int(5) NOT NULL auto_increment, + `Nombre` varchar(50) NOT NULL, + `Descripcion` varchar(250) NOT NULL, + PRIMARY KEY (`idPerfil`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; + +-- +-- Table structure for table `perfil_vista` +-- + +DROP TABLE IF EXISTS `perfil_vista`; +CREATE TABLE `perfil_vista` ( + `idPerfil` int(5) NOT NULL, + `idVista` int(5) NOT NULL, + `activa` tinyint(1) NOT NULL default '1', + PRIMARY KEY (`idPerfil`,`idVista`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Table structure for table `relacion_estado` +-- + +DROP TABLE IF EXISTS `relacion_estado`; +CREATE TABLE `relacion_estado` ( + `id_objeto` int(5) NOT NULL, + `relacion` varchar(50) NOT NULL, + PRIMARY KEY (`id_objeto`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Table structure for table `relacion_objetos` +-- + +DROP TABLE IF EXISTS `relacion_objetos`; +CREATE TABLE `relacion_objetos` ( + `idObjeto1` int(5) NOT NULL, + `idObjeto2` int(5) NOT NULL, + PRIMARY KEY (`idObjeto1`,`idObjeto2`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Table structure for table `taddress` +-- + +DROP TABLE IF EXISTS `taddress`; +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 DEFAULT CHARSET=latin1; + +-- +-- Table structure for table `taddress_agent` +-- + +DROP TABLE IF EXISTS `taddress_agent`; +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 DEFAULT CHARSET=latin1; + +-- +-- Table structure for table `tagent_access` +-- + +DROP TABLE IF EXISTS `tagent_access`; CREATE TABLE `tagent_access` ( `id_ac` bigint(20) unsigned NOT NULL auto_increment, - `id_agent` int(8) unsigned NOT NULL default '0', + `id_agent` int(11) NOT NULL default '0', `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', - `utimestamp` integer unsigned NOT NULL default '0', + `utimestamp` bigint(20) NOT NULL default '0', PRIMARY KEY (`id_ac`), KEY `agent_index` (`id_agent`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tagente' -# +-- +-- Table structure for table `tagente` +-- + +DROP TABLE IF EXISTS `tagente`; CREATE TABLE `tagente` ( - `id_agente` int(8) unsigned NOT NULL auto_increment, + `id_agente` mediumint(8) unsigned NOT NULL auto_increment, `nombre` varchar(100) NOT NULL default '', `direccion` varchar(100) default '', `comentarios` varchar(255) default '', - `id_grupo` int(8) unsigned NOT NULL default '0', - `ultimo_contacto` datetime NOT NULL default '0000-00-00 00:00:00', - `modo` tinyint(1) unsigned NOT NULL default '0', - `intervalo` int(8) unsigned NOT NULL default '300', - `id_os` tinyint(4) unsigned default '0', + `id_grupo` int(10) unsigned NOT NULL default '0', + `ultimo_contacto` datetime NOT NULL default '2004-01-01 00:00:00', + `modo` tinyint(1) NOT NULL default '0', + `intervalo` int(11) NOT NULL default '0', + `id_os` tinyint(3) unsigned default '0', `os_version` varchar(100) default '', `agent_version` varchar(100) default '', `ultimo_contacto_remoto` datetime default '0000-00-00 00:00:00', - `disabled` tinyint(2) unsigned NOT NULL default '0', - `agent_type` tinyint(2) unsigned NOT NULL default '0', - `id_server` int(4) unsigned default '0', + `disabled` tinyint(2) NOT NULL default '0', + `agent_type` int(2) unsigned NOT NULL default '0', + `id_server` int(10) unsigned default '0', PRIMARY KEY (`id_agente`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tagente_datos' -# +-- +-- Table structure for table `tagente_datos` +-- + +DROP TABLE IF EXISTS `tagente_datos`; CREATE TABLE `tagente_datos` ( - `id_agente_datos` bigint(20) unsigned NOT NULL auto_increment, - `id_agente_modulo` int(10) unsigned NOT NULL default '0', + `id_agente_datos` bigint(10) unsigned NOT NULL auto_increment, + `id_agente_modulo` mediumint(8) unsigned NOT NULL default '0', `datos` double(18,2) default NULL, `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', `id_agente` mediumint(8) unsigned NOT NULL default '0', - `utimestamp` integer unsigned NOT NULL default '0', + `utimestamp` int(10) unsigned default '0', PRIMARY KEY (`id_agente_datos`), - KEY `data_index_1` (`id_agente_modulo`, `id_agente` ), -) TYPE=InnoDB; + KEY `data_index2` (`id_agente`,`id_agente_modulo`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tagente_datos_inc' -# +-- +-- Table structure for table `tagente_datos_inc` +-- + +DROP TABLE IF EXISTS `tagente_datos_inc`; CREATE TABLE `tagente_datos_inc` ( `id_adi` bigint(20) unsigned NOT NULL auto_increment, - `id_agente_modulo` mediumint(8) unsigned NOT NULL default '0', - `datos` double(18,2) default NULL, + `id_agente_modulo` bigint(20) NOT NULL default '0', + `datos` bigint(12) default NULL, `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id_adi`), KEY `data_inc_index_1` (`id_agente_modulo`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tagente_datos_string' -# +-- +-- Table structure for table `tagente_datos_string` +-- + +DROP TABLE IF EXISTS `tagente_datos_string`; CREATE TABLE `tagente_datos_string` ( `id_tagente_datos_string` bigint(20) unsigned NOT NULL auto_increment, - `id_agente_modulo` int(10) unsigned NOT NULL default '0', + `id_agente_modulo` int(11) NOT NULL default '0', `datos` tinytext NOT NULL, `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', - `id_agente` mediumint(8) unsigned NOT NULL default '0', - `utimestamp` integer unsigned NOT NULL default '0', + `id_agente` bigint(4) unsigned NOT NULL default '0', + `utimestamp` bigint(20) NOT NULL default '0', PRIMARY KEY (`id_tagente_datos_string`), - KEY `data_index_1` (`id_agente_modulo`, `id_agente` ), -) TYPE=InnoDB; + KEY `data_string_index_1` (`id_agente_modulo`), + KEY `data_string_index_2` (`id_agente`), + KEY `data_string_index_3` (`timestamp`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tagente_estado' -# +-- +-- Table structure for table `tagente_estado` +-- + +DROP TABLE IF EXISTS `tagente_estado`; CREATE TABLE `tagente_estado` ( `id_agente_estado` int(10) unsigned NOT NULL auto_increment, - `id_agente_modulo` mediumint(8) unsigned NOT NULL default '0', + `id_agente_modulo` int(20) NOT NULL default '0', `datos` varchar(255) NOT NULL default '', `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', - `cambio` tinyint(2) unsigned NOT NULL default '0', - `estado` tinyint(2) unsigned NOT NULL default '0', - `id_agente` mediumint(8) unsigned NOT NULL default '0', + `cambio` int(11) NOT NULL default '0', + `estado` int(11) NOT NULL default '0', + `id_agente` int(11) NOT NULL default '0', `last_try` datetime default NULL, - `utimestamp` integer unsigned NOT NULL default '0', + `utimestamp` bigint(20) NOT NULL default '0', + `inc_lastrealvalue` double(18,2) NOT NULL default '0.00', + `current_interval` int(10) unsigned NOT NULL default '0', + `processed_by_server` varchar(100) default NULL, PRIMARY KEY (`id_agente_estado`), + KEY `status_index_1` (`id_agente_modulo`), KEY `status_index_2` (`id_agente_modulo`,`estado`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tagente_modulo' -# +-- +-- Table structure for table `tagente_modulo` +-- + +DROP TABLE IF EXISTS `tagente_modulo`; CREATE TABLE `tagente_modulo` ( - `id_agente_modulo` int(10) unsigned NOT NULL auto_increment, - `id_agente` int(10) unsigned NOT NULL default '0', - `id_tipo_modulo` int(10) unsigned NOT NULL default '0', + `id_agente_modulo` bigint(100) unsigned NOT NULL auto_increment, + `id_agente` int(11) NOT NULL default '0', + `id_tipo_modulo` int(11) NOT NULL default '0', `descripcion` varchar(100) NOT NULL default '', `nombre` varchar(100) NOT NULL default '', - `max` int(10) default '0', - `min` int(10) default '0', - `module_interval` int(8) unsigned default '0', - `tcp_port` int(5) unsigned default '0', + `max` bigint(20) default '0', + `min` bigint(20) default '0', + `module_interval` int(4) unsigned default '0', + `tcp_port` int(4) unsigned default '0', `tcp_send` varchar(150) default '', `tcp_rcv` varchar(100) default '', `snmp_community` varchar(100) default '', @@ -135,11 +248,13 @@ CREATE TABLE `tagente_modulo` ( `flag` tinyint(3) unsigned default '0', PRIMARY KEY (`id_agente_modulo`), KEY `tam_agente` (`id_agente`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'talert_snmp' -# +-- +-- Table structure for table `talert_snmp` +-- + +DROP TABLE IF EXISTS `talert_snmp`; CREATE TABLE `talert_snmp` ( `id_as` int(10) unsigned NOT NULL auto_increment, `id_alert` int(10) unsigned NOT NULL default '0', @@ -151,244 +266,358 @@ CREATE TABLE `talert_snmp` ( `agent` varchar(100) default '', `custom_oid` varchar(200) default '', `oid` varchar(255) NOT NULL default '', - `time_threshold` int(10) unsigned NOT NULL default '0', + `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` tinyint(4) unsigned NOT NULL default '1', - `min_alerts` tinyint(4) unsigned NOT NULL default '1', + `last_fired` datetime NOT NULL default '2005-01-01 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; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'talerta' -# +-- +-- Table structure for table `talerta` +-- + +DROP TABLE IF EXISTS `talerta`; CREATE TABLE `talerta` ( `id_alerta` int(10) unsigned NOT NULL auto_increment, `nombre` varchar(100) NOT NULL default '', `comando` varchar(100) default '', `descripcion` varchar(255) default '', PRIMARY KEY (`id_alerta`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'talerta_agente_modulo' -# +-- +-- Table structure for table `talerta_agente_modulo` +-- +DROP TABLE IF EXISTS `talerta_agente_modulo`; CREATE TABLE `talerta_agente_modulo` ( - `id_aam` int(10) unsigned NOT NULL auto_increment, - `id_agente_modulo` int(10) unsigned NOT NULL default '0', - `id_alerta` int(10) unsigned NOT NULL default '0', + `id_aam` int(11) unsigned NOT NULL auto_increment, + `id_agente_modulo` int(11) NOT NULL default '0', + `id_alerta` int(11) NOT NULL default '0', `al_campo1` varchar(255) default '', `al_campo2` varchar(255) default '', `al_campo3` mediumtext, `descripcion` varchar(255) default '', - `dis_max` int(8) default NULL, - `dis_min` int(8) default NULL, - `time_threshold` int(8) NOT NULL default '0', - `last_fired` datetime NOT NULL default '0000-00-00 00:00:00', - `max_alerts` tinyint(4) unsigned NOT NULL default '1', - `times_fired` tinyint(4) unsigned NOT NULL default '0', - `module_type` tinyint(4) unsigned NOT NULL default '0', - `min_alerts` tinyint(4) unsigned NOT NULL default '0', - `internal_counter` tinyint(4) unsigned default '0', + `dis_max` bigint(12) default NULL, + `dis_min` bigint(12) default NULL, + `time_threshold` int(11) NOT NULL default '0', + `last_fired` datetime NOT NULL default '2001-01-01 00:00:00', + `max_alerts` int(4) NOT NULL default '1', + `times_fired` int(11) NOT NULL default '0', + `module_type` int(11) NOT NULL default '0', + `min_alerts` int(4) NOT NULL default '0', + `internal_counter` int(4) default '0', PRIMARY KEY (`id_aam`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tattachment' -# +-- +-- Table structure for table `tattachment` +-- + +DROP TABLE IF EXISTS `tattachment`; CREATE TABLE `tattachment` ( - `id_attachment` int(10) unsigned NOT NULL auto_increment, - `id_incidencia` int(10) unsigned NOT NULL default '0', + `id_attachment` bigint(20) unsigned NOT NULL auto_increment, + `id_incidencia` bigint(20) NOT NULL default '0', `id_usuario` varchar(60) NOT NULL default '', `filename` varchar(255) NOT NULL default '', `description` varchar(150) default '', - `size` int(10) unsigned NOT NULL default '0', + `size` bigint(20) NOT NULL default '0', PRIMARY KEY (`id_attachment`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tconfig' -# +-- +-- Table structure for table `tconfig` +-- + +DROP TABLE IF EXISTS `tconfig`; CREATE TABLE `tconfig` ( `id_config` int(10) unsigned NOT NULL auto_increment, `token` varchar(100) NOT NULL default '', `value` varchar(100) NOT NULL default '', PRIMARY KEY (`id_config`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tconfig_os' -# +-- +-- Table structure for table `tconfig_os` +-- + +DROP TABLE IF EXISTS `tconfig_os`; CREATE TABLE `tconfig_os` ( `id_os` int(10) unsigned NOT NULL auto_increment, `name` varchar(100) NOT NULL default '', `description` varchar(250) default '', `icon_name` varchar(100) default '', PRIMARY KEY (`id_os`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tevento' -# +-- +-- Table structure for table `tevento` +-- + +DROP TABLE IF EXISTS `tevento`; CREATE TABLE `tevento` ( `id_evento` bigint(20) unsigned NOT NULL auto_increment, - `id_agente` int(10) unsigned NOT NULL default '0', + `id_agente` bigint(20) NOT NULL default '0', `id_usuario` varchar(60) NOT NULL default '0', - `id_grupo` int(10) unsigned NOT NULL default '0', - `estado` tinyint(4) unsigned NOT NULL default '0', + `id_grupo` bigint(20) NOT NULL default '0', + `estado` int(10) unsigned NOT NULL default '0', `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', `evento` varchar(255) NOT NULL default '', PRIMARY KEY (`id_evento`), - KEY `indice_1` (`id_agente`), - KEY `indice_2` (`id_grupo`), - KEY `indice_3` (`id_usuario`) -) TYPE=InnoDB; + KEY `indice_1` (`id_agente`,`id_evento`), + KEY `indice_2` (`timestamp`,`id_evento`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tgrupo' -# +-- +-- Table structure for table `tgrupo` +-- + +DROP TABLE IF EXISTS `tgrupo`; CREATE TABLE `tgrupo` ( `id_grupo` mediumint(8) unsigned NOT NULL auto_increment, `nombre` varchar(100) NOT NULL default '', `icon` varchar(50) default NULL, + `parent` tinyint(4) NOT NULL default '-1', PRIMARY KEY (`id_grupo`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tincidencia' -# +-- +-- Table structure for table `tincidencia` +-- + +DROP TABLE IF EXISTS `tincidencia`; CREATE TABLE `tincidencia` ( - `id_incidencia` int(10) unsigned NOT NULL auto_increment, + `id_incidencia` bigint(20) unsigned NOT NULL auto_increment, `inicio` datetime NOT NULL default '0000-00-00 00:00:00', `cierre` datetime NOT NULL default '0000-00-00 00:00:00', `titulo` varchar(100) NOT NULL default '', `descripcion` mediumtext NOT NULL, `id_usuario` varchar(100) NOT NULL default '', `origen` varchar(100) NOT NULL default '', - `estado` tinyint(4) unsigned NOT NULL default '0', - `prioridad` tinyint(4) unsigned NOT NULL default '0', - `id_grupo` int(10) unsigned NOT NULL default '0', + `estado` int(11) NOT NULL default '0', + `prioridad` int(11) NOT NULL default '0', + `id_grupo` mediumint(9) NOT NULL default '0', `actualizacion` datetime NOT NULL default '0000-00-00 00:00:00', `id_creator` varchar(60) default NULL, PRIMARY KEY (`id_incidencia`), KEY `incident_index_1` (`id_usuario`,`id_incidencia`) - KEY `indident_index_2` (`id_grupo`), -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tlanguage' -# +-- +-- Table structure for table `tlanguage` +-- + +DROP TABLE IF EXISTS `tlanguage`; CREATE TABLE `tlanguage` ( - `id_language` char(6) NOT NULL default '', - `name` varchar(50) NOT NULL default '', + `id_language` varchar(5) NOT NULL default '', + `name` varchar(100) NOT NULL default '', PRIMARY KEY (`id_language`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tlink' -# +-- +-- Table structure for table `tlink` +-- + +DROP TABLE IF EXISTS `tlink`; CREATE TABLE `tlink` ( `id_link` int(10) unsigned zerofill NOT NULL auto_increment, `name` varchar(100) NOT NULL default '', `link` varchar(255) NOT NULL default '', PRIMARY KEY (`id_link`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tmensajes' -# +-- +-- Table structure for table `tmensajes` +-- + +DROP TABLE IF EXISTS `tmensajes`; CREATE TABLE `tmensajes` ( - `id_mensaje` int(10) unsigned NOT NULL auto_increment, + `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` tinytext NOT NULL, - `timestamp` datetime NOT NULL default '0000-00-00 00:00:00', + `timestamp` datetime NOT NULL default '2005-01-01 00:00:00', `subject` varchar(255) NOT NULL default '', `estado` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`id_mensaje`), - KEY `msg_index_1` (`id_usuario_origen`), -) TYPE=InnoDB; + PRIMARY KEY (`id_mensaje`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tmodule_group' -# +-- +-- Table structure for table `tmodule_group` +-- + +DROP TABLE IF EXISTS `tmodule_group`; CREATE TABLE `tmodule_group` ( - `id_mg` int(10) unsigned NOT NULL auto_increment, + `id_mg` bigint(20) unsigned NOT NULL auto_increment, `name` varchar(150) NOT NULL default '', PRIMARY KEY (`id_mg`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tnota' -# +-- +-- Table structure for table `tnetwork_component` +-- + +DROP TABLE IF EXISTS `tnetwork_component`; +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(255) NOT NULL, + `tcp_rcv` varchar(255) NOT NULL default 'NULL', + `snmp_community` varchar(255) NOT NULL default 'NULL', + `snmp_oid` varchar(400) NOT NULL, + `id_module_group` tinyint(4) NOT NULL default '0', + PRIMARY KEY (`id_nc`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Table structure for table `tnetwork_component_group` +-- + +DROP TABLE IF EXISTS `tnetwork_component_group`; +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 DEFAULT CHARSET=latin1; + +-- +-- Table structure for table `tnetwork_profile` +-- + +DROP TABLE IF EXISTS `tnetwork_profile`; +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 DEFAULT CHARSET=latin1; + +-- +-- Table structure for table `tnetwork_profile_component` +-- + +DROP TABLE IF EXISTS `tnetwork_profile_component`; +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 DEFAULT CHARSET=latin1; + +-- +-- Table structure for table `tnota` +-- + +DROP TABLE IF EXISTS `tnota`; CREATE TABLE `tnota` ( `id_nota` mediumint(8) unsigned NOT NULL auto_increment, `id_usuario` varchar(100) NOT NULL default '0', `timestamp` tinyblob NOT NULL, `nota` mediumtext NOT NULL, PRIMARY KEY (`id_nota`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tnota_inc' -# +-- +-- Table structure for table `tnota_inc` +-- + +DROP TABLE IF EXISTS `tnota_inc`; CREATE TABLE `tnota_inc` ( `id_nota_inc` mediumint(8) unsigned NOT NULL auto_increment, - `id_incidencia` mediumint(8) unsigned NOT NULL default '0', - `id_nota` mediumint(8) unsigned NOT NULL default '0', + `id_incidencia` mediumint(9) NOT NULL default '0', + `id_nota` mediumint(9) NOT NULL default '0', PRIMARY KEY (`id_nota_inc`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'torigen' -# +-- +-- Table structure for table `torigen` +-- + +DROP TABLE IF EXISTS `torigen`; CREATE TABLE `torigen` ( `origen` varchar(100) NOT NULL default '' -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tperfil' -# +-- +-- Table structure for table `tperfil` +-- + +DROP TABLE IF EXISTS `tperfil`; CREATE TABLE `tperfil` ( - `id_perfil` mediumint(8) unsigned NOT NULL auto_increment, + `id_perfil` int(10) unsigned NOT NULL auto_increment, `name` varchar(60) NOT NULL default '', - `incident_edit` tinyint(3) unsigned NOT NULL default '0', - `incident_view` tinyint(3) unsigned NOT NULL default '0', - `incident_management` tinyint(3) unsigned NOT NULL default '0', - `agent_view` tinyint(3) unsigned NOT NULL default '0', - `agent_edit` tinyint(3) unsigned NOT NULL default '0', - `alert_edit` tinyint(3) unsigned NOT NULL default '0', - `user_management` tinyint(3) unsigned NOT NULL default '0', - `db_management` tinyint(3) unsigned NOT NULL default '0', - `alert_management` tinyint(3) unsigned NOT NULL default '0', - `pandora_management` tinyint(3) unsigned NOT NULL default '0', + `incident_edit` int(11) NOT NULL default '0', + `incident_view` int(11) NOT NULL default '0', + `incident_management` int(11) NOT NULL default '0', + `agent_view` int(11) NOT NULL default '0', + `agent_edit` int(11) NOT NULL default '0', + `alert_edit` int(11) NOT NULL default '0', + `user_management` int(11) NOT NULL default '0', + `db_management` int(11) NOT NULL default '0', + `alert_management` int(11) NOT NULL default '0', + `pandora_management` int(11) NOT NULL default '0', PRIMARY KEY (`id_perfil`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tserver' -# +-- +-- Table structure for table `trecon_task` +-- + +DROP TABLE IF EXISTS `trecon_task`; +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(20) 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` int(10) unsigned NOT NULL default '1440', + PRIMARY KEY (`id_rt`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Table structure for table `tserver` +-- + +DROP TABLE IF EXISTS `tserver`; 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` tinyint(3) unsigned NOT NULL default '0', + `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` tinyint(3) unsigned NOT NULL default '1', - `network_server` tinyint(3) unsigned NOT NULL default '0', - `data_server` tinyint(3) unsigned NOT NULL default '0', - `master` tinyint(3) unsigned NOT NULL default '1', - `checksum` tinyint(3) unsigned NOT NULL default '1', - `description` varchar(255) NOT NULL default '', + `snmp_server` tinyint(3) unsigned NOT NULL default '0', + `network_server` tinyint(3) unsigned NOT NULL default '0', + `data_server` tinyint(3) unsigned NOT NULL default '0', + `master` tinyint(3) unsigned NOT NULL default '0', + `checksum` tinyint(3) unsigned NOT NULL default '0', + `description` varchar(255) default NULL, + `recon_server` tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (`id_server`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tsesion' -# +-- +-- Table structure for table `tsesion` +-- + +DROP TABLE IF EXISTS `tsesion`; CREATE TABLE `tsesion` ( `ID_sesion` bigint(4) unsigned NOT NULL auto_increment, `ID_usuario` varchar(60) NOT NULL default '0', @@ -397,43 +626,48 @@ CREATE TABLE `tsesion` ( `descripcion` varchar(200) NOT NULL default '', `fecha` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`ID_sesion`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'ttipo_modulo' -# +-- +-- Table structure for table `ttipo_modulo` +-- + +DROP TABLE IF EXISTS `ttipo_modulo`; CREATE TABLE `ttipo_modulo` ( `id_tipo` smallint(5) unsigned NOT NULL auto_increment, `nombre` varchar(100) NOT NULL default '', - `categoria` tinyint(3) unsigned NOT NULL default '0', + `categoria` int(11) NOT NULL default '0', `descripcion` varchar(100) NOT NULL default '', `icon` varchar(100) default NULL, PRIMARY KEY (`id_tipo`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'ttrap' -# +-- +-- Table structure for table `ttrap` +-- + +DROP TABLE IF EXISTS `ttrap`; CREATE TABLE `ttrap` ( - `id_trap` int(10) unsigned NOT NULL auto_increment, + `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` tinyint(3) unsigned NOT NULL default '0', + `type` int(11) NOT NULL default '0', `type_custom` varchar(100) default '', `value` varchar(255) default '', `value_custom` varchar(255) default '', - `alerted` tinyint(3) unsigned NOT NULL default '0', - `status`tinyint(3) unsigned NOT NULL default '0', + `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', - `utimestamp` integer unsigned NOT NULL default '0', PRIMARY KEY (`id_trap`) -) TYPE=InnoDB COMMENT='SNMP Trap table'; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='SNMP Trap table'; -# Database: pandora -# Table: 'tusuario' -# +-- +-- Table structure for table `tusuario` +-- + +DROP TABLE IF EXISTS `tusuario`; CREATE TABLE `tusuario` ( `id_usuario` varchar(60) NOT NULL default '0', `nombre_real` varchar(125) NOT NULL default '', @@ -443,17 +677,40 @@ CREATE TABLE `tusuario` ( `direccion` varchar(100) default '', `telefono` varchar(100) default '', `nivel` tinyint(1) NOT NULL default '0' -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -# Database: pandora -# Table: 'tusuario_perfil' -# +-- +-- Table structure for table `tusuario_perfil` +-- + +DROP TABLE IF EXISTS `tusuario_perfil`; CREATE TABLE `tusuario_perfil` ( - `id_up` int(10) unsigned NOT NULL auto_increment, + `id_up` bigint(20) unsigned NOT NULL auto_increment, `id_usuario` varchar(100) NOT NULL default '', - `id_perfil` tinyint(3) unsigned NOT NULL default '0', - `id_grupo` tinyint(3) unsigned NOT NULL default '0', + `id_perfil` int(20) NOT NULL default '0', + `id_grupo` int(11) NOT NULL default '0', `assigned_by` varchar(100) NOT NULL default '', PRIMARY KEY (`id_up`) -) TYPE=InnoDB; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- +-- Table structure for table `vistas_consola` +-- + +DROP TABLE IF EXISTS `vistas_consola`; +CREATE TABLE `vistas_consola` ( + `idVista` int(5) NOT NULL auto_increment, + `nombre` varchar(50) NOT NULL, + `descripcion` varchar(250) NOT NULL, + PRIMARY KEY (`idVista`) +) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; diff --git a/pandora_console/reporting/fgraph.php b/pandora_console/reporting/fgraph.php index d91ec6ff62..ece4227453 100644 --- a/pandora_console/reporting/fgraph.php +++ b/pandora_console/reporting/fgraph.php @@ -1,16 +1,20 @@ +// Additions to Pandora FMS 1.2 graph code and new XML reporting template management +// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es // // 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; either version 2 -// of the License, or (at your option) any later version. +// as published by the Free Software Foundation; 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 @@ -18,7 +22,6 @@ // 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. - // Load global vars include ("../include/config.php"); include ("../include/functions.php"); @@ -66,7 +69,9 @@ function dame_fecha($mh){ return $m; } -function dame_fecha_grafico_timestamp ($timestamp) { return date('d/m H:i', $timestamp); } +function dame_fecha_grafico_timestamp ($timestamp) { + return date('d/m H:i', $timestamp); +} function grafico_modulo_sparse ( $id_agente_modulo, $periodo, $draw_events, $width, $height , $title, $unit_name ) { @@ -1259,7 +1264,6 @@ function progress_bar($progress,$width,$height) { if ($height == 0) { $height = 20; } - //$rating = $_GET['rating']; $ratingbar = (($rating/100)*$width)-2; $image = imagecreate($width,$height); @@ -1268,7 +1272,7 @@ function progress_bar($progress,$width,$height) { $border = ImageColorAllocate($image,0,0,0); $red = ImageColorAllocate($image,255,60,75); $fill = ImageColorAllocate($image,44,81,150); - + $rating = format_numeric ( $rating, 2); ImageFilledRectangle($image,0,0,$width-1,$height-1,$back); if ($rating > 100) ImageFilledRectangle($image,1,1,$ratingbar,$height-1,$red);