diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 01a295872a..09819f1082 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2013-12-01 Junichi Satoh + + * include/functions_modules.php: Corrected agent counting by module + group. + 2013-11-30 Junichi Satoh * operation/tree.php, operation/agentes/datos_agente.php, diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index d13e21186b..eec258fadc 100644 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -1655,10 +1655,11 @@ function modules_agents_warning ($module_name) { function modules_group_agent_unknown ($module_group) { - return db_get_sql ("SELECT COUNT(*) + return db_get_sql ("SELECT COUNT(DISTINCT tagente.id_agente) FROM tagente, tagente_modulo WHERE tagente.id_agente=tagente_modulo.id_agente AND critical_count=0 AND warning_count=0 + AND tagente.disabled = 0 AND unknown_count>0 AND id_module_group = $module_group"); } @@ -1666,10 +1667,11 @@ function modules_group_agent_unknown ($module_group) { function modules_group_agent_ok ($module_group) { - return db_get_sql ("SELECT COUNT(*) + return db_get_sql ("SELECT COUNT(DISTINCT tagente.id_agente) FROM tagente, tagente_modulo WHERE tagente.id_agente=tagente_modulo.id_agente AND normal_count = total_count + AND tagente.disabled = 0 AND id_module_group = $module_group"); } @@ -1677,9 +1679,10 @@ function modules_group_agent_ok ($module_group) { function modules_group_agent_critical ($module_group) { - return db_get_sql ("SELECT COUNT(*) + return db_get_sql ("SELECT COUNT(DISTINCT tagente.id_agente) FROM tagente, tagente_modulo WHERE tagente.id_agente=tagente_modulo.id_agente + AND tagente.disabled = 0 AND critical_count > 0 AND id_module_group = $module_group"); } @@ -1687,10 +1690,11 @@ function modules_group_agent_critical ($module_group) { function modules_group_agent_warning ($module_group) { - return db_get_sql ("SELECT COUNT(*) + return db_get_sql ("SELECT COUNT(DISTINCT tagente.id_agente) FROM tagente, tagente_modulo WHERE tagente.id_agente=tagente_modulo.id_agente AND critical_count = 0 AND warning_count > 0 + AND tagente.disabled = 0 AND id_module_group = $module_group"); }