Merge branch 'ent-7066-bug-filtro-alert-detail' into 'develop'

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

See merge request artica/pandorafms!3881
This commit is contained in:
Daniel Rodriguez 2021-04-06 17:30:27 +00:00
commit 58d5c2bc69
2 changed files with 13 additions and 9 deletions

View File

@ -2134,8 +2134,6 @@ function get_group_alerts(
$disabled = $filter; $disabled = $filter;
} }
$filter .= ' AND talert_template_modules.disabled = 0 ';
switch ($disabled) { switch ($disabled) {
case 'notfired': case 'notfired':
$filter .= ' AND times_fired = 0 AND talert_template_modules.disabled = 0'; $filter .= ' AND times_fired = 0 AND talert_template_modules.disabled = 0';
@ -2153,9 +2151,13 @@ function get_group_alerts(
$filter .= ' AND talert_template_modules.disabled = 0'; $filter .= ' AND talert_template_modules.disabled = 0';
break; break;
default: case 'all':
$filter .= ''; $filter .= '';
break; break;
default:
$filter .= ' AND talert_template_modules.disabled = 0 ';
break;
} }
// WHEN SELECT ALL TAGS TO FILTER ALERTS // WHEN SELECT ALL TAGS TO FILTER ALERTS
@ -2195,8 +2197,8 @@ function get_group_alerts(
WHERE 1 = 0'; WHERE 1 = 0';
} else { } else {
$subQuery = 'SELECT id_agente_modulo $subQuery = 'SELECT id_agente_modulo
FROM tagente_modulo FROM tagente_modulo tam
WHERE delete_pending = 0 WHERE delete_pending = 0 AND tam.disabled = 0
AND id_agente IN (SELECT id_agente AND id_agente IN (SELECT id_agente
FROM tagente ta FROM tagente ta
LEFT JOIN tagent_secondary_group tasg 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) $sql = "SELECT COUNT(talert_template_modules.id)
FROM talert_template_modules, tagente_modulo, tagente_estado, tagente 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 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 talert_template_modules.disabled = 0
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND talert_template_modules.id_agent_module = 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) "SELECT COUNT(talert_template_modules.id)
FROM talert_template_modules, tagente_modulo, tagente_estado, tagente FROM talert_template_modules, tagente_modulo, tagente_estado, tagente
WHERE tagente.id_grupo IN $group_clause AND tagente_modulo.id_agente = tagente.id_agente 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 talert_template_modules.disabled = 0
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND talert_template_modules.id_agent_module = 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 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 tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND talert_template_modules.id_agent_module = 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); $count = db_get_sql($sql);
return $count; 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 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 tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
AND talert_template_modules.id_agent_module = 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"
); );
} }