From 7a62ba22ddfd2e9affbcf9a11e24c4bf91492591 Mon Sep 17 00:00:00 2001 From: slerena Date: Mon, 6 Aug 2007 15:48:57 +0000 Subject: [PATCH] 2007-08-06 Sancho Lerena * DB.pm: Alert time support uses TIME format instead numeric (changes requested by esanchezm). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@592 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/lib/PandoraFMS/DB.pm | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) 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