2010-09-09 Ramon Novoa <rnovoa@artica.es>

* lib/PandoraFMS/Core.pm: Fixed alert behaviour when time_from is
          greater than time_to. Fixes bug #3048043.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3236 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2010-09-09 18:14:05 +00:00
parent e3f2834fa5
commit 55f61be126
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2010-09-09 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm: Fixed alert behaviour when time_from is
greater than time_to. Fixes bug #3048043.
2010-09-08 Sancho Lerena <slerena@artica.es>
* util/compaq_chassis_trap_manager.pl,

View File

@ -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'};