]> git.etc.gen.nz Git - spong.git/commitdiff
current program status written to $0 in main program loop
authorStephen L Johnson <sjohnson@monsters.org>
Wed, 15 Mar 2000 00:15:13 +0000 (00:15 +0000)
committerStephen L Johnson <sjohnson@monsters.org>
Wed, 15 Mar 2000 00:15:13 +0000 (00:15 +0000)
src/spong-network.pl

index 1b95974801eaf4ecba05c0d01c642d4e41ae6de4..ed06155a811414ec7f3b1b1ced7000591e95c57b 100755 (executable)
@@ -22,6 +22,8 @@ use lib "@@LIBDIR@@";
 
 $CRIT_WARN_LEVEL = 1;
 
+$0 = "spong-network";
+
 use Sys::Hostname;
 use Net::Ping;
 use Socket;
@@ -69,6 +71,7 @@ while( 1 ) {
 
       my $check;
       foreach $check (('ping',split(/\s+/,$HOSTS{$host}->{'services'}))) {
+           $0 = "spong-network (checking $host/$check)";
            &do_check($host,$check);
       }
   }
@@ -83,6 +86,7 @@ while( 1 ) {
       my $sleep = int($SPONGSLEEP - (.05 * $SPONGSLEEP) + 
                  rand(.1 * $SPONGSLEEP));
       &debug( "sleeping for $sleep seconds" );
+      $0 = "spong-network (sleeping)";
       sleep $sleep;
    }
 }