From 7017c6136eb0dd9bd8fa72c3372a3b668c3f763d Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 10 Feb 2021 10:21:39 +0100 Subject: [PATCH] Avoid events while ceasing alerts --- pandora_server/lib/PandoraFMS/Core.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 24b89ce1f1..aa63bba6d8 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -679,7 +679,12 @@ sub pandora_process_alert ($$$$$$$$;$$) { $alert->{'critical_instructions'} = $critical_instructions; $alert->{'warning_instructions'} = $warning_instructions; $alert->{'unknown_instructions'} = $unknown_instructions; - + + # Generate event only if not quieted by module or agent. + return if ((ref($module) eq 'HASH' && $module->{'quiet'} != "0") + || (ref($agent) eq 'HASH' && $agent->{'quiet'} != "0") + || (ref($alert) eq 'HASH' && $alert->{'disable_event'} != "0")); + # Generate an event if ($table eq 'tevent_alert') { pandora_event ($pa_config, "Alert ceased (" .