From 86dabc6476a5d12c5ed7bcb4ef367695e1ae8610 Mon Sep 17 00:00:00 2001 From: "marcos.alconada" Date: Fri, 17 May 2019 11:31:02 +0200 Subject: [PATCH] Variability event_storm_protection check is added with empty data --- pandora_console/include/functions_config.php | 2 +- pandora_server/lib/PandoraFMS/Core.pm | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index dc0e845afb..1747629920 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -270,7 +270,7 @@ function config_update_config() $error_update[] = __('Referer security'); } - if (!config_update_value('event_storm_protection', get_parameter('event_storm_protection'))) { + if (!config_update_value('event_storm_protection', get_parameter('event_storm_protection', 0))) { $error_update[] = __('Event storm protection'); } diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 296be928a4..536669afd2 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -360,9 +360,15 @@ sub pandora_generate_alerts ($$$$$$$$;$$$) { my ($pa_config, $data, $status, $agent, $module, $utimestamp, $dbh, $timestamp, $extra_macros, $last_data_value, $alert_type) = @_; # No alerts when event storm protection is enabled - if ($EventStormProtection == 1) { + if(isnumber $EventStormProtection ){ + if ($EventStormProtection == 1) + { return; - } + } + }else{ + $EventStormProtection = 0; + return; + } # Warmup interval for alerts. if ($pa_config->{'warmup_alert_on'} == 1) {