From: Stephen L Johnson Date: Wed, 15 Mar 2000 00:15:13 +0000 (+0000) Subject: current program status written to $0 in main program loop X-Git-Tag: spong-2_7-alpha5~28 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=194a28993d17fd5c74927ff2a9c61eddc04e5e6e;p=spong.git current program status written to $0 in main program loop --- diff --git a/src/spong-network.pl b/src/spong-network.pl index 1b95974..ed06155 100755 --- a/src/spong-network.pl +++ b/src/spong-network.pl @@ -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; } }