diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index d39ca49178..5c5908460f 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -602,12 +602,13 @@ if ($list_modules) { AND delete_pending = 0 AND disabled = 0 AND $status_filter_sql + AND $status_module_group_filter $tags_sql AND tagente_estado.estado != $monitor_filter - GROUP BY tagente_modulo.id_agente_modulo "; - $count_modules = db_get_all_rows_sql('SELECT COUNT(*)' . $sql_condition); + $count_modules = db_get_all_rows_sql('SELECT COUNT(DISTINCT tagente_modulo.id_agente_modulo)' . $sql_condition); + if (isset($count_modules[0])) $count_modules = reset($count_modules[0]); else @@ -615,7 +616,9 @@ if ($list_modules) { //Get monitors/modules // Get all module from agent - $sql_modules_info = 'SELECT tagente_estado.*, tagente_modulo.*, tmodule_group.*' . $sql_condition; + $sql_modules_info = "SELECT tagente_estado.*, tagente_modulo.*, tmodule_group.* + $sql_condition + GROUP BY tagente_modulo.id_agente_modulo ORDER BY $order_sql"; if ($monitors_change_filter) { $limit = " LIMIT " . $config['block_size'] . " OFFSET 0";