=head1 SYNOPSIS
-B<spong-server> [B<--debug> I<n>] [B<--kill|--restart>] [F<config_file>]
+B<spong-server> [B<--debug> I<n>] [B<--kill|--restart>] [-B<--test>]
+ [F<config_file>]
=head1 DESCRIPTION
configuration and restart. If the B<--kill> flag if provided, a signal will
be sent to the running B<spong-server> process causing it to exit.
+The B<--test> parameter has no effect in the B<spong-server> program itself.
+If specified on the comment line, the B<--test> parameter will be passed
+to the B<spong-message> program when it is called. The <--test> paramter
+will cause B<spong-message> to skip the actual send of notifications.
+
An alternate configuration file can be specified on the command line. This
file will be read instead of the default F<spong.conf> configuration file.
# There are one or more update processes that listen for status updates
# from client programs.
-# $Id: spong-server.pl,v 1.32 2000/12/15 21:13:14 sljohnson Exp $
+# $Id: spong-server.pl,v 1.33 2000/12/15 21:39:57 sljohnson Exp $
use lib "@@LIBDIR@@";
$debug = $restart = $kill = 0;
if (! GetOptions("debug:i" => \$debuglevel, "restart" => \$restart,
- "kill" => \$kill ) ) {
+ "kill" => \$kill "test" => \$test) ) {
&usage();
exit 1;
}
my ( $host, $service, $color, $time, $sum, $duration ) = @_;
if ( -f $smessage ) {
- if ( $debug < 3 ) {
- system $smessage, $color, $host, $service, $time, $sum, $duration;
- } else {
- system $smessage, '--debug', $color, $host, $service, $time, $sum,
- $duration;
- }
+ my args;
+ push @args,$smessage;
+ if( $debug >= 3 ) { push @args,'--debug'; }
+ if( $test ) { push @args,'--test'; }
+ push @args, $color, $host, $service, $time, $sum, $duration;
+ system(@args);
} else {
&error( "could not send message, $smessage not found" );
}