From c8fcd511bf54493c179f735ead9cfeba32a6dd0d Mon Sep 17 00:00:00 2001 From: Calvo Date: Mon, 29 Nov 2021 11:07:11 +0100 Subject: [PATCH 1/4] Fix monitoring alert detail filter for defautl actions --- pandora_console/include/functions_alerts.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index 19aff75cce..ab2ea63a79 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -2183,6 +2183,7 @@ function get_group_alerts( // WHEN SELECT ALL TAGS TO FILTER ALERTS if ($action_filter) { $filter .= ' AND (talert_template_modules.id IN (SELECT id_alert_template_module FROM talert_template_module_actions where id_alert_action = '.$action_filter.'))'; + $filter .= ' OR talert_template_modules.id IN (SELECT talert_templates.id FROM talert_templates where talert_templates.id_alert_action = '.$action_filter.')'; } if (is_array($options)) { From daf0b4e6e927e7401c7778944d2632a72d94f416 Mon Sep 17 00:00:00 2001 From: Calvo Date: Mon, 27 Dec 2021 19:01:53 +0100 Subject: [PATCH 2/4] Fix alert view with default actions node and meta --- pandora_console/include/functions_alerts.php | 2 +- pandora_console/include/functions_ui.php | 6 +++--- pandora_console/operation/agentes/alerts_status.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index 7d0628861d..03ec9d8049 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -2183,7 +2183,7 @@ function get_group_alerts( // WHEN SELECT ALL TAGS TO FILTER ALERTS if ($action_filter) { $filter .= ' AND (talert_template_modules.id IN (SELECT id_alert_template_module FROM talert_template_module_actions where id_alert_action = '.$action_filter.'))'; - $filter .= ' OR talert_template_modules.id IN (SELECT talert_templates.id FROM talert_templates where talert_templates.id_alert_action = '.$action_filter.')'; + $filter .= ' OR talert_template_modules.id_alert_template IN (SELECT talert_templates.id FROM talert_templates where talert_templates.id_alert_action = '.$action_filter.')'; } if (is_array($options)) { diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index ae4321dadd..c5a8ca02e5 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1203,7 +1203,7 @@ function ui_format_alert_row( $actions = alerts_get_alert_agent_module_actions($alert['id'], false, $alert['server_data']['id']); - if (empty($actions) === false) { + if (empty($actions) === false || $actionDefault != '') { $actionText = '
    '; foreach ($actions as $action) { $actionText .= '
  • '.$action['name']; @@ -1215,9 +1215,9 @@ function ui_format_alert_row( } $actionText .= '
'; - } else { + if ($actionDefault != '') { - $actionText = db_get_sql( + $actionText .= db_get_sql( sprintf( 'SELECT name FROM talert_actions WHERE id = %d', $actionDefault diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index c5d597dd39..f5402d6f38 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -420,7 +420,7 @@ if ($filter_standby == 'standby_on') { if (is_metaconsole() === true) { include_once $config['homedir'].'/enterprise/meta/include/functions_alerts_meta.php'; if ($idAgent != 0) { - $alerts['alerts_simple'] = alerts_meta_get_alerts($agents, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user); + $alerts['alerts_simple'] = alerts_meta_get_alerts($agents, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter); $countAlertsSimple = alerts_meta_get_alerts($agents, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user); } else { From 8c86dbbc5088e87bbedea6fbc6e642394f71323c Mon Sep 17 00:00:00 2001 From: Calvo Date: Mon, 17 Jan 2022 09:17:39 +0100 Subject: [PATCH 3/4] Fix meta alerts list action filter --- pandora_console/operation/agentes/alerts_status.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index f5402d6f38..db6b859d42 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -428,7 +428,7 @@ if (is_metaconsole() === true) { users_get_groups($config['id_user'], 'AR', false) ); - $alerts['alerts_simple'] = alerts_meta_get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter); + $alerts['alerts_simple'] = alerts_meta_get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter); $countAlertsSimple = alerts_meta_get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter); } From 891c88f45888376342ee0c5f501d3aa9997e4535 Mon Sep 17 00:00:00 2001 From: Calvo Date: Tue, 18 Jan 2022 15:34:56 +0100 Subject: [PATCH 4/4] Fix meta alert action filter counter --- pandora_console/operation/agentes/alerts_status.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index db6b859d42..0f89992d3f 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -422,7 +422,7 @@ if (is_metaconsole() === true) { if ($idAgent != 0) { $alerts['alerts_simple'] = alerts_meta_get_alerts($agents, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter); - $countAlertsSimple = alerts_meta_get_alerts($agents, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user); + $countAlertsSimple = alerts_meta_get_alerts($agents, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter); } else { $id_groups = array_keys( users_get_groups($config['id_user'], 'AR', false) @@ -430,7 +430,7 @@ if (is_metaconsole() === true) { $alerts['alerts_simple'] = alerts_meta_get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter); - $countAlertsSimple = alerts_meta_get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter); + $countAlertsSimple = alerts_meta_get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter); } } else { if ($idAgent != 0) {