diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 678591d308..696c6f5692 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,17 @@ +2009-03-25 Sancho Lerena + + * estado_agente.php: Correct agent down status bug. Added search + on description also, and search text parameter is moved on pagination links + + * estado_generalagente.php: Agent access graph has more height now. + + * event_statistics.php: removed unnecesary header. Better layout. + + * include/functions.php: human_time_description_raw() return "now" when + data is 0 or empty. + + * db/db_main.php: Bigger graph. + 2009-03-25 Evi Vanoost * include/functions_db.php: Made get_server_info more informational diff --git a/pandora_console/godmode/db/db_main.php b/pandora_console/godmode/db/db_main.php index 2da0d8789b..38ed5bc6d9 100644 --- a/pandora_console/godmode/db/db_main.php +++ b/pandora_console/godmode/db/db_main.php @@ -47,7 +47,7 @@ echo '

'.__('Database Maintenance').' > '.__('Current database maintenance
'.__('Please check your Pandora Server setup and be sure that database maintenance daemon is running. It\'s very important to keep up-to-date database to get the best performance and results in Pandora').'

- + '; ?> diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 8614f3c957..98fe87b2d9 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -377,7 +377,7 @@ function human_time_comparation ($timestamp) { } $seconds = get_system_time () - $timestamp; - + return human_time_description_raw ($seconds); } @@ -413,8 +413,12 @@ function get_system_time () { * @return string A human readable translation of minutes. */ function human_time_description_raw ($seconds) { + if (empty ($seconds)) { - return __('Unknown'); + return __('Now'); + // slerena 25/03/09 + // Most times $seconds is empty is because last contact is current date + // Put here "uknown" or N/A or something similar is not a good idea } if ($seconds < 60) diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 703c122539..c6d269e186 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -50,8 +50,7 @@ $offset = get_parameter ("offset", 0); $group_id = get_parameter ("group_id", 0); $ag_group = get_parameter ("ag_group", $group_id); $ag_group = get_parameter_get ("ag_group_refresh", $ag_group); //if it isn't set, defaults to prev. value - -$search = get_parameter ("search"); +$search = get_parameter ("search", ""); echo "

".__('Pandora Agents')." > ".__('Summary')."

"; @@ -84,7 +83,7 @@ value='".__('Show')."'> echo __('Free text for search (*)'); echo ""; echo "
"; -echo ""; +echo ""; echo ""; echo ""; @@ -93,7 +92,7 @@ echo ""; if ($search != ""){ - $search_sql = " AND nombre LIKE '%$search%' OR direccion LIKE '%$search%' "; + $search_sql = " AND ( nombre LIKE '%$search%' OR comentarios LIKE '%$search%' OR direccion LIKE '%$search%' ) "; } else { $search_sql = ""; } @@ -155,7 +154,7 @@ $total_events = $row2[0]; // Prepare pagination pagination ($total_events, - "index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=$ag_group&refr=60", + "index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=$ag_group&refr=60&search=$search", $offset); // Show data. $agents = get_db_all_rows_sql ($sql); @@ -181,6 +180,14 @@ if ($agents !== false) { $id_os = $agent["id_os"]; $ultimo_contacto = $agent["ultimo_contacto"]; $biginterval = $intervalo; + + // New check for agent down only based on last contact + $diff_agent_down = get_system_time () - strtotime ($agent["ultimo_contacto"]); + if ($diff_agent_down > $intervalo * 2) + $agent_down = 1; + else + $agent_down = 0; + $belongs = false; //Verifiy if the group this agent begins is one of the user groups foreach ($groups as $migrupo) { @@ -206,7 +213,6 @@ if ($agents !== false) { $monitor_warning = 0; $monitor_critical = 0; $monitor_down = 0; - $agent_down = 0; $now = get_system_time (); // Calculate module/monitor totals for this agent @@ -233,7 +239,7 @@ if ($agents !== false) { } // Defines if Agent is down (interval x 2 > time last contact if (($seconds >= ($intervalo_comp * 2)) && ($module_type < 21)) { // If (intervalx2) secs. ago we don't get anything, show alert - $agent_down = 1; + if ($async == 0) $monitor_down++; } else { @@ -288,15 +294,15 @@ if ($agents !== false) { echo ""; - echo "".$numero_modulos." : "; + echo "".$numero_modulos." "; if ($monitor_normal > 0) - echo " ".$monitor_normal.""; + echo " : ".$monitor_normal." "; if ($monitor_warning > 0) - echo " ".$monitor_warning.""; + echo " : ".$monitor_warning." "; if ($monitor_critical > 0) - echo " ".$monitor_critical.""; + echo " : ".$monitor_critical." "; if ($monitor_down > 0) - echo " ".$monitor_down.""; + echo " : ".$monitor_down.""; echo ""; echo ""; diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index 10eca6d808..978db289a6 100644 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -44,12 +44,12 @@ echo "

".__('Pandora Agents')." > ".__('Agent general information')."

echo '
 
'; //Floating div -echo '
'; -echo ''.__('Agent access rate (24h)').'

'; -echo ''; +echo '
'; +echo ''.__('Agent access rate (24h)').'
'; +echo ''; echo '
 
'; -echo ''.__('Events generated -by module-').'

'; -echo ''; +echo ''.__('Events generated -by module-').'
'; +echo ''; echo '
'; echo '
'; diff --git a/pandora_console/operation/events/event_statistics.php b/pandora_console/operation/events/event_statistics.php index 3362961633..865a66abad 100644 --- a/pandora_console/operation/events/event_statistics.php +++ b/pandora_console/operation/events/event_statistics.php @@ -27,10 +27,6 @@ if (! give_acl ($config['id_user'], 0, "AR")) { require ("general/noaccess.php"); return; } - -echo "

".__('Events')." > "; -echo __('Events statistics')."

"; -echo "

"; echo ""; echo "
"; echo "

".__('Event graph')."

";