diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index f2533d2f45..644d9f522c 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2007-08-06 Sancho Lerena + + * DB.pm: Alert time support uses TIME format instead numeric (changes requested + by esanchezm). + 2007-08-02 Sancho Lerena * Makefile.PL: Missing dep updated and .pl extensions purged. diff --git a/pandora_server/lib/PandoraFMS/DB.pm b/pandora_server/lib/PandoraFMS/DB.pm index 1682e788ff..599799657c 100644 --- a/pandora_server/lib/PandoraFMS/DB.pm +++ b/pandora_server/lib/PandoraFMS/DB.pm @@ -137,10 +137,10 @@ sub pandora_calcula_alerta (%$$$$$$) { my $alert_timeto = $data[19]; my $ahora_hour = &UnixDate("today","%H"); my $ahora_min = &UnixDate("today","%M"); + my $ahora_time = $ahora_hour.":".$ahora_min; # time check ! - if ( (((($ahora_hour * 60)+$ahora_min) >= ($alert_timefrom * 30)) && - ((($ahora_hour * 60)+$ahora_min) <= ($alert_timeto * 30))) || ($alert_timefrom == $alert_timeto)) { + if ((($ahora_time le $alert_timeto) && ($ahora_time ge $alert_timefrom)) || ($alert_timefrom eq $alert_timeto)){ my $comando =""; logger($pa_config, "Found an alert defined for $nombre_modulo, its ID $id_alerta",4); # Here we process alert if conditions are ok