From: Michael Brown Date: Thu, 21 Jun 2001 17:05:00 +0000 (+0000) Subject: When describing what add_contact is doing, show the delay,rcpt,etc. fields X-Git-Tag: spong-2_4_6~16 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfe481dfd7260acfa42bcfd7fcd55f581ec28022;p=spong.git When describing what add_contact is doing, show the delay,rcpt,etc. fields I've moved the "Test Mode: skipping page" message down below the filtering logic, so that instead of spitting a message for all possible recipients, we only get a message corresponding to a real notification that would have been sent. --- diff --git a/src/spong-message.pl b/src/spong-message.pl index 340573f..a09f388 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.30 2001/06/13 16:07:20 sljohnson Exp $ +# $Id: spong-message.pl,v 1.31 2001/06/21 17:05:00 supermathie Exp $ use lib "@@LIBDIR@@"; @@ -494,7 +494,11 @@ RULE: foreach $contact ( @{$rule->{contacts}} ) { &debug("Calling add_contact for " . (ref($contact) eq 'HASH' ? - $contact->{'rcpt'} : $contact) ); + "rcpt: " . $contact->{'rcpt'} . + " delay: " . $contact->{'delay'} . + " repeat: " . $contact->{'repeat'} . + " escalate: " . $contact->{'escalate'} + : $contact) ); add_contact(\@con,$contact); } @@ -514,19 +518,6 @@ RULE: # Starting sending out the notifications foreach $contact ( @con ) { - if ($test) { - if( ref($contact) eq 'HASH' ) { - &debug("Test mode: Skipping page to" . - " rcpt: " . $contact->{'rcpt'} . - " delay: " . $contact->{'delay'} . - " repeat: " . $contact->{'repeat'} . - " escalate: " . $contact->{'escalate'} ); - } else { - &debug("Test mode: Skipping page to $contact"); - } - next; - } - # If contact is a hash, pull out recipient as the contact if ( ref($contact) eq 'HASH') { $c = $contact->{'rcpt'}; @@ -615,6 +606,18 @@ RULE: next; } # next contact } + if ($test) { + if( ref($contact) eq 'HASH' ) { + &debug("Test mode: Skipping page to" . + " rcpt: " . $contact->{'rcpt'} . + " delay: " . $contact->{'delay'} . + " repeat: " . $contact->{'repeat'} . + " escalate: " . $contact->{'escalate'} ); + } else { + &debug("Test mode: Skipping page to $contact"); + } + next; + } # # Starting sending out the messages to $person