From ffde20815d091f571762dc32f54c98a92c238673 Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Wed, 10 May 2000 04:10:41 +0000 Subject: [PATCH] code added to display Group Summary text displays usig --grpsummary (code by Andrew Ruthven ) --- src/spong.pl | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/spong.pl b/src/spong.pl index c240d42..a457d61 100755 --- a/src/spong.pl +++ b/src/spong.pl @@ -31,7 +31,8 @@ $view = "standard"; # the input they provide. %opt; -@options = ( "help", "summary:s", "problems:s", "history:s", "host=s", +@options = ( "help", "summary:s", "grpsummary", "problems:s", "history:s", + "host=s", "acks:s", "services=s", "stats=s", "config=s", "info=s", "service=s", "brief", "standard", "full" ); @@ -39,20 +40,21 @@ if( ! GetOptions( \%opt, @options ) ) { warn "Incorrect usage:\n\n"; &help(); } &help if defined $opt{'help'}; -if( defined $opt{'brief'} ) { $view = "brief"; } -if( defined $opt{'standard'} ) { $view = "standard"; } -if( defined $opt{'full'} ) { $view = "full"; } +if( defined $opt{'brief'} ) { $view = "brief"; } +if( defined $opt{'standard'} ) { $view = "standard"; } +if( defined $opt{'full'} ) { $view = "full"; } -if( defined $opt{'problems'} ) { &problems( $opt{'problems'} ); $opt = 1; } -if( defined $opt{'summary'} ) { &summary( $opt{'summary'} ); $opt = 1; } -if( defined $opt{'history'} ) { &history( $opt{'history'} ); $opt = 1; } +if( defined $opt{'problems'} ) { &problems( $opt{'problems'} ); $opt = 1; } +if( defined $opt{'summary'} ) { &summary( $opt{'summary'} ); $opt = 1; } +if( defined $opt{'grpsummary'} ) { &grpsummary($opt{'grpsummary'}); $opt = 1; } +if( defined $opt{'history'} ) { &history( $opt{'history'} ); $opt = 1; } -if( defined $opt{'host'} ) { &host( $opt{'host'} ); $opt = 1; } -if( defined $opt{'services'} ) { &services( $opt{'services'} ); $opt = 1; } -if( defined $opt{'acks'} ) { &acks( $opt{'acks'} ); $opt = 1; } -if( defined $opt{'stats'} ) { &stats( $opt{'stats'} ); $opt = 1; } -if( defined $opt{'config'} ) { &config( $opt{'config'} ); $opt = 1; } -if( defined $opt{'info'} ) { &info( $opt{'info'} ); $opt = 1; } +if( defined $opt{'host'} ) { &host( $opt{'host'} ); $opt = 1; } +if( defined $opt{'services'} ) { &services( $opt{'services'} ); $opt = 1; } +if( defined $opt{'acks'} ) { &acks( $opt{'acks'} ); $opt = 1; } +if( defined $opt{'stats'} ) { &stats( $opt{'stats'} ); $opt = 1; } +if( defined $opt{'config'} ) { &config( $opt{'config'} ); $opt = 1; } +if( defined $opt{'info'} ) { &info( $opt{'info'} ); $opt = 1; } if( defined $opt{'service'} ) { my( $host, $service ) = split( ':', $opt{'service'} ); @@ -76,6 +78,9 @@ sub problems { sub summary { print &query( $SPONGSERVER, "summary", $_[0], "text", $view ); } +sub grpsummary { + print &query( $SPONGSERVER, "grpsummary", $_[0], "text", $view ); } + sub history { print &query( $SPONGSERVER, "history", $_[0], "text", $view ); } @@ -118,6 +123,8 @@ supplied, then a table showing the status of all hosts is shown. --history [hostlist] Show history information for the host(s) --acks [hostlist] Shows acknowledgment info for the given host(s) + --grpsummary Summarizes the status of host(s) in all group(s) + --host host Shows all information available for the given host --services host Shows detailed service info for the given host --stats host Shows statistical information for the given host -- 2.30.2