From: Stephen L Johnson Date: Wed, 9 Feb 2000 20:18:45 +0000 (+0000) Subject: added 'event' message type functionality X-Git-Tag: spong-2_7-alpha5~83 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96a0bd32aea86663df12960997d6610c06b8e162;p=spong.git added 'event' message type functionality --- diff --git a/src/spong-status.pl b/src/spong-status.pl index e9ad3b3..6a4b2af 100755 --- a/src/spong-status.pl +++ b/src/spong-status.pl @@ -42,7 +42,7 @@ if( ! GetOptions( \%opt, @options ) ) { warn "Incorrect usage:\n\n"; &help(); } my($cmd, $host, $service, $color, $summary, $ttl) = @ARGV; if (! $cmd && defined $opt{'cmd'}) { $cmd = $opt{'cmd'}; } -if ( $cmd !~ m/status/ ) { warn "Invalid cmd\n\n"; &help(); } +if ( $cmd !~ m/status|event/ ) { warn "Invalid cmd\n\n"; &help(); } if ( ! $host && defined $opt{'host'} ) { $host = $opt{'host'}; } if ( ! $host ) { warn "Host is required\n\n"; &help(); } if ( ! $service && defined $opt{'service'} ) { $service = $opt{'service'}; } @@ -74,8 +74,14 @@ else { undef $fh; } -Spong::Status::status( $SPONGSERVER, $host, $service, $color, $summary, - $message, $ttl ); +if ( $cmd eq 'status' ) { + Spong::Status::status( $SPONGSERVER, $host, $service, $color, $summary, + $message, $ttl ); +} elsif ( $cmd eq 'event') { + Spong::Status::event( $SPONGSERVER, $host, $service, $color, $summary, + $message, $ttl ); +} + exit 0;