Revision: 3236
http://pandora.svn.sourceforge.net/pandora/?rev=3236&view=revAuthor: ramonn
Date: 2010-09-09 18:14:05 +0000 (Thu, 09 Sep 2010)
Log Message:
-----------
2010-09-09 Ramon Novoa
* lib/PandoraFMS/Core.pm: Fixed alert behaviour when time_from is
greater than time_to. Fixes bug #3048043.
Modified Paths:
--------------
trunk/pandora_server/ChangeLog
trunk/pandora_server/lib/PandoraFMS/Core.pm
Modified: trunk/pandora_server/ChangeLog
===================================================================
--- trunk/pandora_server/ChangeLog 2010-09-09 14:07:21 UTC (rev 3235)
+++ trunk/pandora_server/ChangeLog 2010-09-09 18:14:05 UTC (rev 3236)
@@ -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,
Modified: trunk/pandora_server/lib/PandoraFMS/Core.pm
===================================================================
--- trunk/pandora_server/lib/PandoraFMS/Core.pm 2010-09-09 14:07:21 UTC (rev 3235)
+++ trunk/pandora_server/lib/PandoraFMS/Core.pm 2010-09-09 18:14:05 UTC (rev 3236)
@@ -228,8 +228,13 @@
# 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'};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Pandora-commits mailing list
Pandora-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pandora-commits