diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 7018ca25c0..e003b49292 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2010-09-09 Ramon Novoa + + * lib/PandoraFMS/Core.pm: Fixed alert behaviour when time_from is + greater than time_to. Fixes bug #3048043. + 2010-09-08 Sancho Lerena * util/compaq_chassis_trap_manager.pl, diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 6efbd61453..7909004240 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -228,8 +228,13 @@ sub pandora_evaluate_alert ($$$$$$$) { # Check time slot my $time = sprintf ("%.2d:%.2d:%.2d", $hour, $min, $sec); - return 1 if (($alert->{'time_to'} ne $alert->{'time_from'}) && - (($time ge $alert->{'time_to'}) || ($time le $alert->{'time_from'}))); + if (($alert->{'time_from'} ne $alert->{'time_to'})) { + if ($alert->{'time_from'} lt $alert->{'time_to'}) { + return 1 if (($time le $alert->{'time_from'}) || ($time ge $alert->{'time_to'})); + } else { + return 1 if (($time le $alert->{'time_from'}) && ($time ge $alert->{'time_to'})); + } + } # Check time threshold my $limit_utimestamp = $alert->{'last_reference'} + $alert->{'time_threshold'};