Variability event_storm_protection check is added with empty data

This commit is contained in:
marcos.alconada 2019-05-17 11:31:02 +02:00
parent bf202496da
commit 86dabc6476
2 changed files with 9 additions and 3 deletions

View File

@ -270,7 +270,7 @@ function config_update_config()
$error_update[] = __('Referer security'); $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'); $error_update[] = __('Event storm protection');
} }

View File

@ -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) = @_; 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 # No alerts when event storm protection is enabled
if ($EventStormProtection == 1) { if(isnumber $EventStormProtection ){
if ($EventStormProtection == 1)
{
return; return;
} }
}else{
$EventStormProtection = 0;
return;
}
# Warmup interval for alerts. # Warmup interval for alerts.
if ($pa_config->{'warmup_alert_on'} == 1) { if ($pa_config->{'warmup_alert_on'} == 1) {