diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 38c8085210..06f6bea2f0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2009-10-06 Miguel de Dios + + * operation/agentes/estado_generalagente.php, + operation/agentes/estado_agente.php: change the intervals, and use the + new function "getNextAgentContact" for interval in agent view. + 2009-10-06 Miguel de Dios * include/functions_agents.php: add the function "getNextAgentContact" diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index aa6f3a0848..fa465a8200 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -192,11 +192,14 @@ foreach ($agents as $agent) { $data[1] = print_os_icon ($agent["id_os"], false, true); - if ($agent_info["interval"] > $agent["intervalo"]) { - $data[2] = ''.$agent_info["interval"].''; - } else { - $data[2] = $agent["intervalo"]; - } + //The interval we are thinking that it must be the agent interval in this + //cell and it'snt the interval of modules. +// if ($agent_info["interval"] > $agent["intervalo"]) { +// $data[2] = ''.$agent_info["interval"].''; +// } else { +// $data[2] = $agent["intervalo"]; +// } + $data[2] = $agent["intervalo"]; $data[3] = print_group_icon ($agent["id_grupo"], true); diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index 392d73183b..5cbfc4600b 100644 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -17,6 +17,9 @@ // Load global vars require_once ("include/config.php"); + +require_once ("include/functions_agents.php"); + if ($config['flash_charts']) { require_once ("include/fgraph.php"); } @@ -118,19 +121,7 @@ if ($agent["ultimo_contacto_remoto"] == "0000-00-00 00:00:00") { echo ''; // Next contact (agent) -$difference = get_system_time () - strtotime ($agent["ultimo_contacto"]); -$sql = sprintf ("SELECT MAX(module_interval) FROM tagente_modulo WHERE id_agente = %d", $id_agente); -$max = (int) get_db_sql ($sql); -if ($max > 0) { - //First check if there is a maximum module interval - $progress = round ($difference / (($max * 2) / 100)); -} elseif ($agent["intervalo"] > 0) { - //Then if there is a generic agent interval - $progress = round ($difference / (($agent["intervalo"] * 2) / 100)); -} else { - //Otherwise there is no progress to be reported - $progress = -1; -} +$progress = getNextAgentContact($id_agente); echo ''.__('Next agent contact').''; echo '';