Fixed alert detail filter and tactical view counter for disabled alers/agents/modules

This commit is contained in:
Luis Calvo 2021-03-04 20:15:40 +01:00
parent 2955e14849
commit f8d9c00183
2 changed files with 13 additions and 9 deletions

View File

@ -2125,8 +2125,6 @@ function get_group_alerts(
$disabled = $filter;
}
$filter .= ' AND talert_template_modules.disabled = 0 ';
switch ($disabled) {
case 'notfired':
$filter .= ' AND times_fired = 0 AND talert_template_modules.disabled = 0';
@ -2144,9 +2142,13 @@ function get_group_alerts(
$filter .= ' AND talert_template_modules.disabled = 0';
break;
default:
case 'all':
$filter .= '';
break;
default:
$filter .= ' AND talert_template_modules.disabled = 0 ';
break;
}
// WHEN SELECT ALL TAGS TO FILTER ALERTS
@ -2186,8 +2188,8 @@ function get_group_alerts(
WHERE 1 = 0';
} else {
$subQuery = 'SELECT id_agente_modulo
FROM tagente_modulo
WHERE delete_pending = 0
FROM tagente_modulo tam
WHERE delete_pending = 0 AND tam.disabled = 0
AND id_agente IN (SELECT id_agente
FROM tagente ta
LEFT JOIN tagent_secondary_group tasg

View File

@ -458,7 +458,7 @@ function tactical_monitor_alerts($group_array, $strict_user=false, $id_group_str
$sql = "SELECT COUNT(talert_template_modules.id)
FROM talert_template_modules, tagente_modulo, tagente_estado, tagente
WHERE tagente.id_grupo IN $group_clause_strict AND tagente_modulo.id_agente = tagente.id_agente
AND tagente.disabled = 0
AND tagente.disabled = 0 AND tagente_modulo.disabled = 0
AND talert_template_modules.disabled = 0
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND talert_template_modules.id_agent_module = tagente_modulo.id_agente_modulo";
@ -470,7 +470,7 @@ function tactical_monitor_alerts($group_array, $strict_user=false, $id_group_str
"SELECT COUNT(talert_template_modules.id)
FROM talert_template_modules, tagente_modulo, tagente_estado, tagente
WHERE tagente.id_grupo IN $group_clause AND tagente_modulo.id_agente = tagente.id_agente
AND tagente.disabled = 0
AND tagente.disabled = 0 AND tagente_modulo.disabled = 0
AND talert_template_modules.disabled = 0
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND talert_template_modules.id_agent_module = tagente_modulo.id_agente_modulo"
@ -499,7 +499,8 @@ function tactical_monitor_fired_alerts($group_array, $strict_user=false, $id_gro
WHERE tagente.id_grupo IN $group_clause_strict AND tagente_modulo.id_agente = tagente.id_agente
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND talert_template_modules.id_agent_module = tagente_modulo.id_agente_modulo
AND times_fired > 0 AND talert_template_modules.disabled = 0";
AND times_fired > 0 AND talert_template_modules.disabled = 0
AND tagente.disabled = 0 AND tagente_modulo.disabled = 0";
$count = db_get_sql($sql);
return $count;
@ -511,7 +512,8 @@ function tactical_monitor_fired_alerts($group_array, $strict_user=false, $id_gro
WHERE tagente.id_grupo IN $group_clause AND tagente_modulo.id_agente = tagente.id_agente
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND talert_template_modules.id_agent_module = tagente_modulo.id_agente_modulo
AND times_fired > 0 AND talert_template_modules.disabled = 0"
AND times_fired > 0 AND talert_template_modules.disabled = 0
AND tagente.disabled = 0 AND tagente_modulo.disabled = 0"
);
}