From 013dc5496c5a085b33476c6ad69b4c13e514f411 Mon Sep 17 00:00:00 2001 From: slerena Date: Tue, 28 Aug 2007 13:33:54 +0000 Subject: [PATCH] 2007-08-27 Sancho Lerena * operation/agentes/ver_agente.php: Truncated too long agent names. * operation/agentes/tactical.php: Fixed BUG: not initializated modules are now correctly viewed. * godmode/agentes/manage_config.php: Fixed BUG: copying modules also create status record and some minor issues with visualization. * godmode/agentes/configurar_agente.php: Truncated too long agent names. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@625 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 12 ++++++ .../godmode/agentes/configurar_agente.php | 2 +- .../godmode/agentes/manage_config.php | 38 ++++++++++++++----- .../include/functions_reporting.php | 3 +- .../operation/agentes/tactical.php | 4 +- .../operation/agentes/ver_agente.php | 2 +- 6 files changed, 46 insertions(+), 15 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index f941370cf7..1cfae99aa2 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,15 @@ +2007-08-27 Sancho Lerena + + * operation/agentes/ver_agente.php: Truncated too long agent names. + + * operation/agentes/tactical.php: Fixed BUG: not initializated modules are now + correctly viewed. + + * godmode/agentes/manage_config.php: Fixed BUG: copying modules also create + status record and some minor issues with visualization. + + * godmode/agentes/configurar_agente.php: Truncated too long agent names. + 2007-08-26 Raul Mateos * upgrade.php, install.php: Corrected small typo and tag errors. diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index a12018d7a1..70dfee2dff 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -134,7 +134,7 @@ echo ""; diff --git a/pandora_console/godmode/agentes/manage_config.php b/pandora_console/godmode/agentes/manage_config.php index e00f12a9bc..8a80614564 100644 --- a/pandora_console/godmode/agentes/manage_config.php +++ b/pandora_console/godmode/agentes/manage_config.php @@ -50,7 +50,7 @@ if (comprueba_login() == 0) // Source $id_origen = $_POST["origen"]; - + // If selected modules or alerts if (isset($_POST["modules"])) $modulos = 1; @@ -89,7 +89,6 @@ if (comprueba_login() == 0) $o_id_tipo_modulo = $row["id_tipo_modulo"]; $o_nombre = $row["nombre"]; $d_id_agente = $id_agente; // Rapelace with destination agent id - // Read every module in source agent $o_descripcion = $row["descripcion"]; $o_max = $row["max"]; @@ -100,7 +99,9 @@ if (comprueba_login() == 0) $o_tcp_rcv = $row["tcp_rcv"]; $o_snmp_community = $row["snmp_community"]; $o_snmp_oid = $row["snmp_oid"]; - $o_ip_target = $row["ip_target"]; + // Replace IP Address for main ip address of destination module + $real_ip_address = give_agent_address ($id_agente); + $o_ip_target = $real_ip_address; $o_id_module_group = $row["id_module_group"]; // Write every module in destination agent @@ -108,7 +109,28 @@ if (comprueba_login() == 0) $sql = "INSERT INTO tagente_modulo (id_agente,id_tipo_modulo,descripcion,nombre, max, min, module_interval, tcp_port, tcp_send, tcp_rcv, snmp_community, snmp_oid, ip_target, id_module_group, flag) VALUES (".$d_id_agente.",'".$o_id_tipo_modulo."','".$o_descripcion."','".$o_nombre."', '$o_max', '$o_min', '$o_module_interval', '$o_tcp_port','$o_tcp_send','$o_tcp_rcv','$o_snmp_community','$o_snmp_oid','$o_ip_target',$o_id_module_group, 1)"; $result2=mysql_query($sql); - // echo "DEBUG INSERT $sql
"; + $o_id_agente_modulo = mysql_insert_id(); + + // Create with different estado if proc type or data type + if ( + ($o_id_tipo_modulo == 2) || + ($o_id_tipo_modulo == 6) || + ($o_id_tipo_modulo == 9) || + ($o_id_tipo_modulo == 12) || + ($o_id_tipo_modulo == 18)){ + $sql_status_insert = "INSERT INTO tagente_estado + (id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp) + VALUES ( + $o_id_agente_modulo, 0,'0000-00-00 00:00:00',0,0,'".$d_id_agente."',0 + )"; + } else { + $sql_status_insert = "INSERT INTO tagente_estado + (id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp) + VALUES ( + $o_id_agente_modulo, 0,'0000-00-00 00:00:00',0,100,'".$d_id_agente."',0 + )"; + } + $result_status=mysql_query($sql_status_insert); echo "
  ".$lang_label["copymod"]." ->".$o_nombre; } } @@ -218,11 +240,9 @@ if (comprueba_login() == 0) $sql_delete1="DELETE FROM tagente_datos WHERE id_agente_modulo=".$row["id_agente_modulo"]; $sql_delete2="DELETE FROM tagente_datos_inc WHERE id_agente_modulo=".$row["id_agente_modulo"]; $sql_delete3="DELETE FROM tagente_datos_string WHERE id_agente_modulo=".$row["id_agente_modulo"]; - $sql_delete4 ="DELETE FROM talerta_agente_modulo WHERE id_agente_modulo = ".$row["id_agente_modulo"]; $result=mysql_query($sql_delete1); $result=mysql_query($sql_delete2); $result=mysql_query($sql_delete3); - $result=mysql_query($sql_delete4); } // Delete conf @@ -233,8 +253,6 @@ if (comprueba_login() == 0) } // delete alerts definitions if ($alertas == 1){ - echo "
".$lang_label["deleting_data"]." -> ".dame_nombre_agente($id_agente); - // delete data $sql1='SELECT * FROM tagente_modulo WHERE id_agente = '.$id_agente; $result1=mysql_query($sql1); @@ -273,7 +291,7 @@ if (comprueba_login() == 0) } echo '  

'; echo "".$lang_label["modules"]."

"; - echo ""; if ( (isset($_POST["update_agent"])) AND (isset($_POST["origen"])) ) { // Populate Module/Agent combo $agente_modulo = $_POST["origen"]; @@ -293,7 +311,7 @@ if (comprueba_login() == 0)

- = ($module_interval*2)) $monitor_unknown++; elseif ($datos != 0) { @@ -136,6 +136,7 @@ function general_stats ( $id_user, $id_group = 0) { } } } + $data = array(); $data[0] = $monitor_checks; $data[1] = $monitor_ok; diff --git a/pandora_console/operation/agentes/tactical.php b/pandora_console/operation/agentes/tactical.php index d5ae633dea..d1e65a6e7b 100644 --- a/pandora_console/operation/agentes/tactical.php +++ b/pandora_console/operation/agentes/tactical.php @@ -76,7 +76,7 @@ echo ""."Monitor Not Init".""; echo ""; - if ($monitor_unknown > 0) + if ($monitor_not_init> 0) echo $monitor_not_init; else echo "-"; @@ -105,7 +105,7 @@ echo "-"; echo ""."Data not init".""; echo ""; - if ($data_alert > 0) + if ($data_not_init > 0) echo $data_not_init; else echo "-"; diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index af7a904e30..5fffec340f 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -50,7 +50,7 @@ if (comprueba_login() == 0) { echo "";