diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index d636b733b5..368173a0cc 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -297,7 +297,8 @@ function agents_get_alerts_simple ($id_agent = false, $filter = '', $options = f function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $order = array('field' => 'nombre', 'order' => 'ASC'), - $return = false) { + $return = false, + $disabled_agent = 0) { global $config; @@ -428,6 +429,13 @@ function agents_get_agents ($filter = false, $fields = false, if ($where_nogroup == '') { $where_nogroup = '1 = 1'; } + + if ($disabled_agent == 1){ + $disabled = 'disabled = 0'; + } + else{ + $disabled = '1 = 1'; + } $extra = false; @@ -438,12 +446,12 @@ function agents_get_agents ($filter = false, $fields = false, } if ($extra) { - $where = sprintf('(%s OR (%s)) AND (%s) AND (%s) %s', - $sql_extra, $where, $where_nogroup, $status_sql, $search); + $where = sprintf('(%s OR (%s)) AND (%s) AND (%s) %s AND %s', + $sql_extra, $where, $where_nogroup, $status_sql, $search, $disabled); } else { - $where = sprintf('%s AND %s AND (%s) %s', - $where, $where_nogroup, $status_sql, $search); + $where = sprintf('%s AND %s AND (%s) %s AND %s', + $where, $where_nogroup, $status_sql, $search, $disabled); } $sql = sprintf('SELECT %s FROM tagente diff --git a/pandora_console/include/functions_tactical.php b/pandora_console/include/functions_tactical.php index 69f4a27c88..a2bc1b9105 100644 --- a/pandora_console/include/functions_tactical.php +++ b/pandora_console/include/functions_tactical.php @@ -370,7 +370,7 @@ function tactical_get_data ($id_user = false, $user_strict = false, $acltags, $r $list['_monitors_alerts_fired_'] = tactical_monitor_fired_alerts (explode(',',$user_groups_ids), $user_strict,explode(',',$user_groups_ids)); $list['_monitors_alerts_'] = tactical_monitor_alerts (explode(',',$user_groups_ids), $user_strict,explode(',',$user_groups_ids)); - $total_agentes = agents_get_agents (false, array('count(*) as total_agents'), 'AR',false, false); + $total_agentes = agents_get_agents (false, array('count(*) as total_agents'), 'AR',false, false, 1); $list['_total_agents_'] = $total_agentes[0]['total_agents']; $list["_monitor_checks_"] = $list["_monitors_not_init_"] + $list["_monitors_unknown_"] + $list["_monitors_warning_"] + $list["_monitors_critical_"] + $list["_monitors_ok_"];