# (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@@";
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() );
# 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() );
# 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
}