diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 5f48b93372..2f0d800361 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,15 @@ +2007-07-19 Sancho Lerena + + + * godmode/agentes/agent_manager.php: Fixed problems not really + fixed in commit 563 (bug 1744913). + + * operation/servers/view_server.php: Fixed Data information are + now more accurate (before get incorrect data for data server). + + * operation/agentes/tactical.php: Fixed the same that above and + fixed total nomber of modules for data server that was 0 always :( + 2007-07-18 Sancho Lerena * include/functions_reporting.php: With last change in server, we diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index d976fa2f0d..443b75cd36 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -64,7 +64,7 @@ echo ''.$lang_label["agent_name"].' '; -if (!isset($_GET["create_agent"])){ +if ((isset($id_agente)) && ($id_agente != "")){ echo " diff --git a/pandora_console/operation/agentes/tactical.php b/pandora_console/operation/agentes/tactical.php index 9b1bfeb00b..6b8cb69e28 100644 --- a/pandora_console/operation/agentes/tactical.php +++ b/pandora_console/operation/agentes/tactical.php @@ -163,12 +163,12 @@ $total_modules = $row1[0]; // Get total modules defined (data) - $sql1='SELECT COUNT(processed_by_server) FROM tagente_estado WHERE processed_by_server LIKE "%_Data" '; - if ($result1=mysql_query($sql1)){ - $row1=mysql_fetch_array($result1); - $total_modules_data = $row1[0]; - } else - $total_modules_data = 0; + $sql1='SELECT COUNT(id_agente_modulo) FROM tagente_modulo WHERE id_tipo_modulo < 5 AND id_tipo_modulo != -1'; + if ($result1=mysql_query($sql1)){ + $row1=mysql_fetch_array($result1); + $total_modules_data = $row1[0]; + } else + $total_modules_data = 0; // Connect DataBase $result=mysql_query($sql); @@ -205,17 +205,11 @@ $version = $row["version"]; $modules_server = 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]; - } - } + // Get total modules defined for this server (data modules) + $sql2 = "SELECT COUNT(running_by) FROM tagente_estado WHERE running_by = $id_server"; + $result2=mysql_query($sql2); + $row2=mysql_fetch_array($result2); + $modules_server = $row2[0]; echo ""; echo "$name"; echo ""; diff --git a/pandora_console/operation/servers/view_server.php b/pandora_console/operation/servers/view_server.php index 5340027200..0fd49eed25 100644 --- a/pandora_console/operation/servers/view_server.php +++ b/pandora_console/operation/servers/view_server.php @@ -85,25 +85,13 @@ if (comprueba_login() == 0) { $version = $row["version"]; $modules_server = 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(running_by) FROM tagente_estado WHERE running_by = $id_server"; - $result2=mysql_query($sql2); - $row2=mysql_fetch_array($result2); - $modules_server = $row2[0]; - } - + if (($network_server == 1) OR ($data_server == 1)){ + // Get total modules defined for this server (data modules) + $sql2 = "SELECT COUNT(running_by) FROM tagente_estado WHERE running_by = $id_server"; + $result2=mysql_query($sql2); + $row2=mysql_fetch_array($result2); + $modules_server = $row2[0]; + } echo ""; if ($recon_server == 1) echo "$name "; @@ -174,13 +162,13 @@ if (comprueba_login() == 0) { $nowtime = time(); $maxlag=0; if ($result1=mysql_query($sql1)) - while ($row1=mysql_fetch_array($result1)){ - if (($row1[0] + $row1[1]) < $nowtime){ - $maxlag2 = $nowtime - ($row1[0] + $row1[1]); - if ($maxlag2 > $maxlag) - $maxlag = $maxlag2; - } + while ($row1=mysql_fetch_array($result1)){ + if (($row1[0] + $row1[1]) < $nowtime){ + $maxlag2 = $nowtime - ($row1[0] + $row1[1]); + if ($maxlag2 > $maxlag) + $maxlag = $maxlag2; } + } if ($maxlag < 60) echo $maxlag." sec"; elseif ($maxlag < 86400)