Merge branch 'ent-10729-15255-15647-Numero-de-Agentes-en-Tactical-View-de-Metaconsola-incorrecto-cuando-los-Agentes-tienen-Grupos-Secundarios' into 'develop'
fix count See merge request artica/pandorafms!6191
This commit is contained in:
commit
47b46456b3
|
@ -150,7 +150,9 @@ function tactical_get_data(
|
||||||
$data_stats = db_get_all_rows_sql($sql_stats);
|
$data_stats = db_get_all_rows_sql($sql_stats);
|
||||||
|
|
||||||
$sql_stats_unknown = sprintf(
|
$sql_stats_unknown = sprintf(
|
||||||
'SELECT tma.id_grupo, COUNT(tma.id_agente) AS agents_unknown
|
'SELECT COUNT(*) AS agents_unknown
|
||||||
|
FROM (
|
||||||
|
SELECT tma.id_grupo, COUNT(tma.id_agente) AS agents_unknown
|
||||||
FROM tmetaconsole_agent tma
|
FROM tmetaconsole_agent tma
|
||||||
LEFT JOIN tmetaconsole_agent_secondary_group tmasg
|
LEFT JOIN tmetaconsole_agent_secondary_group tmasg
|
||||||
ON tma.id_agente = tmasg.id_agent
|
ON tma.id_agente = tmasg.id_agent
|
||||||
|
@ -159,7 +161,8 @@ function tactical_get_data(
|
||||||
AND tma.critical_count = 0
|
AND tma.critical_count = 0
|
||||||
AND tma.warning_count = 0
|
AND tma.warning_count = 0
|
||||||
AND tma.unknown_count > 0
|
AND tma.unknown_count > 0
|
||||||
GROUP BY tma.id_grupo',
|
GROUP BY tma.id_agente
|
||||||
|
) AS grouped_data',
|
||||||
$user_groups_ids,
|
$user_groups_ids,
|
||||||
$user_groups_ids
|
$user_groups_ids
|
||||||
);
|
);
|
||||||
|
@ -167,14 +170,17 @@ function tactical_get_data(
|
||||||
$data_stats_unknown = db_get_all_rows_sql($sql_stats_unknown);
|
$data_stats_unknown = db_get_all_rows_sql($sql_stats_unknown);
|
||||||
|
|
||||||
$sql_stats_not_init = sprintf(
|
$sql_stats_not_init = sprintf(
|
||||||
'SELECT tma.id_grupo, COUNT(tma.id_agente) AS agents_not_init
|
'SELECT COUNT(*) AS agents_not_init
|
||||||
|
FROM (
|
||||||
|
SELECT tma.id_grupo, COUNT(tma.id_agente) AS agents_not_init
|
||||||
FROM tmetaconsole_agent tma
|
FROM tmetaconsole_agent tma
|
||||||
LEFT JOIN tmetaconsole_agent_secondary_group tmasg
|
LEFT JOIN tmetaconsole_agent_secondary_group tmasg
|
||||||
ON tma.id_agente = tmasg.id_agent
|
ON tma.id_agente = tmasg.id_agent
|
||||||
WHERE tma.disabled = 0
|
WHERE tma.disabled = 0
|
||||||
AND (tma.id_grupo IN (%s) OR tmasg.id_group IN (%s))
|
AND (tma.id_grupo IN (%s) OR tmasg.id_group IN (%s))
|
||||||
AND (tma.total_count = 0 OR tma.total_count = tma.notinit_count)
|
AND (tma.total_count = 0 OR tma.total_count = tma.notinit_count)
|
||||||
GROUP BY tma.id_grupo',
|
GROUP BY tma.id_agente
|
||||||
|
) AS grouped_data',
|
||||||
$user_groups_ids,
|
$user_groups_ids,
|
||||||
$user_groups_ids
|
$user_groups_ids
|
||||||
);
|
);
|
||||||
|
@ -182,7 +188,9 @@ function tactical_get_data(
|
||||||
$data_stats_not_init = db_get_all_rows_sql($sql_stats_not_init);
|
$data_stats_not_init = db_get_all_rows_sql($sql_stats_not_init);
|
||||||
|
|
||||||
$sql_stats_ok = sprintf(
|
$sql_stats_ok = sprintf(
|
||||||
'SELECT tma.id_grupo, COUNT(tma.id_agente) AS agents_ok
|
'SELECT COUNT(*) AS agents_ok
|
||||||
|
FROM (
|
||||||
|
SELECT tma.id_grupo, COUNT(tma.id_agente) AS agents_ok
|
||||||
FROM tmetaconsole_agent tma
|
FROM tmetaconsole_agent tma
|
||||||
LEFT JOIN tmetaconsole_agent_secondary_group tmasg
|
LEFT JOIN tmetaconsole_agent_secondary_group tmasg
|
||||||
ON tma.id_agente = tmasg.id_agent
|
ON tma.id_agente = tmasg.id_agent
|
||||||
|
@ -192,7 +200,8 @@ function tactical_get_data(
|
||||||
AND tma.warning_count = 0
|
AND tma.warning_count = 0
|
||||||
AND tma.unknown_count = 0
|
AND tma.unknown_count = 0
|
||||||
AND tma.normal_count > 0
|
AND tma.normal_count > 0
|
||||||
GROUP BY tma.id_grupo',
|
GROUP BY tma.id_agente
|
||||||
|
) AS grouped_data',
|
||||||
$user_groups_ids,
|
$user_groups_ids,
|
||||||
$user_groups_ids
|
$user_groups_ids
|
||||||
);
|
);
|
||||||
|
@ -200,7 +209,9 @@ function tactical_get_data(
|
||||||
$data_stats_ok = db_get_all_rows_sql($sql_stats_ok);
|
$data_stats_ok = db_get_all_rows_sql($sql_stats_ok);
|
||||||
|
|
||||||
$sql_stats_warning = sprintf(
|
$sql_stats_warning = sprintf(
|
||||||
'SELECT tma.id_grupo, COUNT(tma.id_agente) AS agents_warning
|
'SELECT COUNT(*) AS agents_warning
|
||||||
|
FROM (
|
||||||
|
SELECT tma.id_grupo, COUNT(tma.id_agente) AS agents_warning
|
||||||
FROM tmetaconsole_agent tma
|
FROM tmetaconsole_agent tma
|
||||||
LEFT JOIN tmetaconsole_agent_secondary_group tmasg
|
LEFT JOIN tmetaconsole_agent_secondary_group tmasg
|
||||||
ON tma.id_agente = tmasg.id_agent
|
ON tma.id_agente = tmasg.id_agent
|
||||||
|
@ -208,7 +219,8 @@ function tactical_get_data(
|
||||||
AND (tma.id_grupo IN (%s) OR tmasg.id_group IN (%s))
|
AND (tma.id_grupo IN (%s) OR tmasg.id_group IN (%s))
|
||||||
AND tma.critical_count = 0
|
AND tma.critical_count = 0
|
||||||
AND tma.warning_count > 0
|
AND tma.warning_count > 0
|
||||||
GROUP BY tma.id_grupo',
|
GROUP BY tma.id_agente
|
||||||
|
) AS grouped_data',
|
||||||
$user_groups_ids,
|
$user_groups_ids,
|
||||||
$user_groups_ids
|
$user_groups_ids
|
||||||
);
|
);
|
||||||
|
@ -216,14 +228,17 @@ function tactical_get_data(
|
||||||
$data_stats_warning = db_get_all_rows_sql($sql_stats_warning);
|
$data_stats_warning = db_get_all_rows_sql($sql_stats_warning);
|
||||||
|
|
||||||
$sql_stats_critical = sprintf(
|
$sql_stats_critical = sprintf(
|
||||||
'SELECT tma.id_grupo, COUNT(tma.id_agente) AS agents_critical
|
'SELECT COUNT(*) AS agents_critical
|
||||||
|
FROM (
|
||||||
|
SELECT tma.id_grupo, COUNT(tma.id_agente) AS agents_critical
|
||||||
FROM tmetaconsole_agent tma
|
FROM tmetaconsole_agent tma
|
||||||
LEFT JOIN tmetaconsole_agent_secondary_group tmasg
|
LEFT JOIN tmetaconsole_agent_secondary_group tmasg
|
||||||
ON tma.id_agente = tmasg.id_agent
|
ON tma.id_agente = tmasg.id_agent
|
||||||
WHERE tma.disabled = 0
|
WHERE tma.disabled = 0
|
||||||
AND (tma.id_grupo IN (%s) OR tmasg.id_group IN (%s))
|
AND (tma.id_grupo IN (%s) OR tmasg.id_group IN (%s))
|
||||||
AND tma.critical_count > 0
|
AND tma.critical_count > 0
|
||||||
GROUP BY tma.id_grupo',
|
GROUP BY tma.id_agente
|
||||||
|
) AS grouped_data',
|
||||||
$user_groups_ids,
|
$user_groups_ids,
|
||||||
$user_groups_ids
|
$user_groups_ids
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue