From 188615454af6c68d166a42a6ed789b1b05416221 Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Wed, 7 Feb 2001 14:33:10 +0000 Subject: [PATCH] added debug statement in delay/repeat logic --- src/spong-message.pl | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/spong-message.pl b/src/spong-message.pl index 538e313..eaf1b1c 100755 --- a/src/spong-message.pl +++ b/src/spong-message.pl @@ -12,7 +12,7 @@ # (2) Added rules based paging (Stephen Johnson Nov 14, 1998) # (3) Added checks against Acks and downtime (Stephen Johnson Mar 17, 1999) # -# $Id: spong-message.pl,v 1.26 2001/01/10 16:29:41 sljohnson Exp $ +# $Id: spong-message.pl,v 1.27 2001/02/07 14:33:10 sljohnson Exp $ use lib "@@LIBDIR@@"; @@ -577,8 +577,11 @@ RULE: if ( $delay != 0 || $escalate != 0 || $repeat != 0) { # If there is no np-file if ( $pagetime eq "") { + debug("First attempt notification for $person:$func"); # If duration is < initial delay - if ( $duration < $delay ) { next; } # next contact + if ( $duration < $delay ) { + debug( "Event duration < initial delay, skipping"); + next; } # next contact else { # Create np-file and fall thru to send message &save_data( ">", $np_file, time() ); @@ -588,13 +591,16 @@ RULE: # If duration is 0, (i.e. a change in status message) if ( $duration == 0 ) { # (This is the recovery logic) + debug("Status has recovered, removing np_file for $person:$func"); # Remove the old npfile and fall thru to send messages unlink $np_file; # If last page time + repeat time still in the future # or if no repeat specified, or status is not red } elsif ( $pagetime + $repeat > time() || $repeat == 0 || $color ne 'red' ) - { next; } # next contact + { debug("No repeat or repeat page time not reached," . + " skipping $person:$func" ); + next; } # next contact else { # Update np-file and fall thru to send message &save_data( ">", $np_file, time() ); @@ -603,7 +609,10 @@ RULE: # No special processing } else { # If duration not 0 (i.e. not a status change) - if ( $duration != 0 ) { next; } # next contact + if ( $duration != 0 ) { + debug( "No delay/repeat and not a status change" . + ", skipping $person:$func" ); + next; } # next contact } -- 2.30.2