From 561e8c4c208f2b1147aa957d009cb2e859044732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Su=C3=A1rez?= Date: Thu, 15 Jun 2023 09:29:14 -0600 Subject: [PATCH] Skip recover alert if was alredy recovered --- pandora_server/lib/PandoraFMS/Core.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 06deaa4331..18187984e7 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1041,8 +1041,12 @@ sub pandora_execute_alert { $event_generated = 1; $monitoring_event_custom_data = $custom_data; } - + + if($alert_mode == FIRED_ALERT || ($alert_mode == RECOVERED_ALERT && $action->{'recovered'} == 0)) { pandora_execute_action ($pa_config, $data, $agent, $alert, $alert_mode, $action, $module, $dbh, $timestamp, $extra_macros, $monitoring_event_custom_data); + }else{ + logger ($pa_config, "Skipping recover action " . safe_output($action->{'name'}) . " for alert '" . safe_output($alert->{'name'}) . "' module '" . safe_output($module->{'nombre'}) . "'.", 10); + } if($alert_mode == RECOVERED_ALERT) { # Reset action thresholds and set recovered