Fixed the functions to get agents not normal or not init in cases of agents with normal status and some modules not init. TICKET: #1791
(cherry picked from commit 51c901f3845c3b4dab809e672a3ca7e93a61fddc) Conflicts: pandora_console/include/functions_groups.php pandora_console/operation/agentes/estado_agente.php pandora_console/operation/agentes/group_view.php
This commit is contained in:
parent
6fac4670d1
commit
f3ddb8193e
|
@ -248,7 +248,11 @@ function agents_get_alerts_simple ($id_agent = false, $filter = '', $options = f
|
||||||
*
|
*
|
||||||
* @return mixed An array with all alerts defined for an agent or false in case no allowed groups are specified.
|
* @return mixed An array with all alerts defined for an agent or false in case no allowed groups are specified.
|
||||||
*/
|
*/
|
||||||
function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $order = array('field' => 'nombre', 'order' => 'ASC'), $return = false) {
|
function agents_get_agents ($filter = false, $fields = false,
|
||||||
|
$access = 'AR',
|
||||||
|
$order = array('field' => 'nombre', 'order' => 'ASC'),
|
||||||
|
$return = false) {
|
||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
if (! is_array ($filter)) {
|
if (! is_array ($filter)) {
|
||||||
|
@ -294,7 +298,11 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o
|
||||||
AND unknown_count > 0";
|
AND unknown_count > 0";
|
||||||
break;
|
break;
|
||||||
case AGENT_STATUS_NOT_NORMAL:
|
case AGENT_STATUS_NOT_NORMAL:
|
||||||
$status_sql = "normal_count <> total_count";
|
$status_sql =
|
||||||
|
"(
|
||||||
|
normal_count <> total_count
|
||||||
|
AND
|
||||||
|
(normal_count + notinit_count) <> total_count)";
|
||||||
break;
|
break;
|
||||||
case AGENT_STATUS_NOT_INIT:
|
case AGENT_STATUS_NOT_INIT:
|
||||||
$status_sql = "notinit_count = total_count";
|
$status_sql = "notinit_count = total_count";
|
||||||
|
|
|
@ -1146,6 +1146,7 @@ function groups_agent_not_init ($group_array) {
|
||||||
AND critical_count = 0
|
AND critical_count = 0
|
||||||
AND warning_count = 0
|
AND warning_count = 0
|
||||||
AND unknown_count = 0
|
AND unknown_count = 0
|
||||||
|
AND normal_count = 0
|
||||||
AND (notinit_count > 0 OR total_count = 0)
|
AND (notinit_count > 0 OR total_count = 0)
|
||||||
AND id_grupo IN $group_clause");
|
AND id_grupo IN $group_clause");
|
||||||
|
|
||||||
|
|
|
@ -385,7 +385,8 @@ if (empty ($agents)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare pagination
|
// Prepare pagination
|
||||||
ui_pagination ($total_agents, ui_get_url_refresh (array ('group_id' => $group_id, 'recursion' => $recursion, 'search' => $search, 'sort_field' => $sortField, 'sort' => $sort, 'status' => $status)));
|
ui_pagination ($total_agents,
|
||||||
|
ui_get_url_refresh (array ('group_id' => $group_id, 'recursion' => $recursion, 'search' => $search, 'sort_field' => $sortField, 'sort' => $sort, 'status' => $status)));
|
||||||
|
|
||||||
// Show data.
|
// Show data.
|
||||||
$table->cellpadding = 4;
|
$table->cellpadding = 4;
|
||||||
|
|
Loading…
Reference in New Issue