From 96a0bd32aea86663df12960997d6610c06b8e162 Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Wed, 9 Feb 2000 20:18:45 +0000 Subject: [PATCH] added 'event' message type functionality --- src/spong-status.pl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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; -- 2.30.2