use Spong::Status qw(status);
use Spong::Log;
+$0 = "spong-client"; # Change the ps arguments section early
+
srand( time() ^ ($$ + ($$ << 15 )) );
$debug = $restart = $kill = $nosleep = 0;
# Pretty simple program, check the stuff that we are looking at, report it to
# the server, sleep, and do it all again...
-$0 = "spong-client";
-
while( 1 ) {
my ($check);
foreach $check (split / /,$CHECKS) {
+ $0 = "spong-client (checking $check)";
eval { &{$CHECKFUNCS{$check}}(); };
if ($@) { &error( "Error running check $check: $@") };
}
my $sleep = int($SPONGSLEEP - (.05 * $SPONGSLEEP) +
rand(.1 * $SPONGSLEEP));
&debug( "sleeping for $sleep seconds" );
+ $0 = "spong-client (sleeping)";
sleep $sleep;
}
}