From eb87406e581b6d6a24515bdc36cbf1a87ecee576 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Mon, 7 Jun 2021 15:22:20 +0200 Subject: [PATCH] fixed bug in unknown alerts --- pandora_server/lib/PandoraFMS/Core.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index bbce7913e9..d962635c37 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -5645,6 +5645,8 @@ Set the status of unknown modules. sub pandora_module_unknown ($$) { my ($pa_config, $dbh) = @_; + my $timestamp = strftime ("%Y-%m-%d %H:%M:%S", localtime(time())); + # Warmup interval for unknown modules. if ($pa_config->{'warmup_unknown_on'} == 1) { @@ -5702,7 +5704,7 @@ sub pandora_module_unknown ($$) { # Generate alerts if (pandora_inhibit_alerts ($pa_config, $agent, $dbh, 0) == 0 && pandora_cps_enabled($agent, $module) == 0) { my $extra_macros = { _modulelaststatuschange_ => $module->{'last_status_change'}}; - pandora_generate_alerts ($pa_config, 0, 3, $agent, $module, time (), $dbh, $extra_macros, undef, 0, 'unknown'); + pandora_generate_alerts ($pa_config, 0, 3, $agent, $module, time (), $dbh, $timestamp, $extra_macros, 0, 'unknown'); } else { logger($pa_config, "Alerts inhibited for agent '" . $agent->{'nombre'} . "'.", 10); @@ -5749,7 +5751,7 @@ sub pandora_module_unknown ($$) { # Generate alerts if (pandora_inhibit_alerts ($pa_config, $agent, $dbh, 0) == 0 && pandora_cps_enabled($agent, $module) == 0) { my $extra_macros = { _modulelaststatuschange_ => $module->{'last_status_change'}}; - pandora_generate_alerts ($pa_config, 0, 3, $agent, $module, time (), $dbh, $extra_macros, undef, 0, 'unknown'); + pandora_generate_alerts ($pa_config, 0, 3, $agent, $module, time (), $dbh, $timestamp, $extra_macros, 0, 'unknown'); } else { logger($pa_config, "Alerts inhibited for agent '" . $agent->{'nombre'} . "'.", 10);