diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index d364d68431..56c2192600 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2011-03-02 Miguel de Dios + + * include/functions_reporting.php: added the call to + "get_agentmodule_status" without check the alerts status for the color. + + * include/functions_db.php: in function "get_agentmodule_status" added new + parameter "$without_alerts" flag for check without alerts. + 2011-03-02 Miguel de Dios * include/db/postgresql.php, include/db/mysql.php, include/functions.php: diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index e83ede525a..f7b442cc4c 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -2594,16 +2594,19 @@ function format_array_to_where_clause_sql ($values, $join = 'AND', $prefix = fal * Get the status of an agent module. * * @param int Id agent module to check. + * @param bool $without_alerts The flag to check only the module, by default false. * * @return int Module status. Value 4 means that some alerts assigned to the * module were fired. */ -function get_agentmodule_status($id_agentmodule = 0) { +function get_agentmodule_status($id_agentmodule = 0, $without_alerts = false) { $current_timestamp = get_system_time (); - $times_fired = get_db_value ('SUM(times_fired)', 'talert_template_modules', 'id_agent_module', $id_agentmodule); - if ($times_fired > 0) { - return 4; // Alert fired + if (!$without_alerts) { + $times_fired = get_db_value ('SUM(times_fired)', 'talert_template_modules', 'id_agent_module', $id_agentmodule); + if ($times_fired > 0) { + return 4; // Alert fired + } } $status_row = get_db_row ("tagente_estado", "id_agente_modulo", $id_agentmodule); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 95b302d0bb..9789cd1d12 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -1549,9 +1549,9 @@ function get_agent_module_info ($id_agent, $filter = false) { foreach ($modules as $key => $module) { $return["modules"]++; - $module_status = get_agentmodule_status($key); + $module_status = get_agentmodule_status($key, true); - switch($module_status){ + switch ($module_status) { case 0: $return["monitor_normal"]++; break;