From 51db8643fbda28c9750c1f9685dd0bd8f6b8c7af Mon Sep 17 00:00:00 2001 From: Stephen L Johnson Date: Tue, 22 Feb 2000 05:19:43 +0000 Subject: [PATCH] added overview problem display support --- src/spong-server.pl | 5 +++++ src/www-spong.pl | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/spong-server.pl b/src/spong-server.pl index b23426a..45b6d68 100755 --- a/src/spong-server.pl +++ b/src/spong-server.pl @@ -373,6 +373,7 @@ sub listen_for_queries { if( $query eq "service" ) { &show_service( @args, $other ); } if( $query eq "histservice" ) { &show_hist_service( @args, $other ); } if( $query eq "overview" ) { &show_overview( @args, $other ); } + if( $query eq "ovproblems" ) { &show_ovproblems( @args, $other ); } close( CLIENT ); select $output; @@ -789,6 +790,10 @@ sub show_problems { my( $hosts, $type, $view ) = @_; Spong::HostList->new( hostlist($hosts) )->display_problems( $type, $view );} +sub show_ovproblems { + my ( $host, $type, $view ) = @_; + Spong::HostGroups->new("ALL")->display_problems( $type, $view );} + sub show_warnings { my( $hosts, $type, $view ) = @_; Spong::HostList->new( hostlist($hosts) )->display_problems( $type, $view ); diff --git a/src/www-spong.pl b/src/www-spong.pl index 9fe5c53..20be114 100755 --- a/src/www-spong.pl +++ b/src/www-spong.pl @@ -47,7 +47,7 @@ if( $ENV{'SCRIPT_NAME'} eq "" ) { my %opt; my @options = ( "help", "summary:s", "problems:s", "history:s", "host=s", "services=s", "stats=s", "config=s", "info=s", "service=s", - "histservice=s", "overview", + "histservice=s", "overview:s", "ovproblems", "brief", "standard", "full" ); $actionbar = 0; @@ -83,6 +83,7 @@ if( $ENV{'SCRIPT_NAME'} eq "" ) { } if ( defined $opt{'overview'} ) { &overview( $opt{'overview'} ); $opt= 1; } + if ( defined $opt{'ovproblems'} ) { &ovproblems( $opt{'ovproblems'} ); $opt= 1; } if( ! $opt ) { &summary( "all" ); } @@ -136,6 +137,7 @@ if( $cmd =~ m!^/service/(.*)/(.*)$! ) { &service( $1, $2 ); exit; } if( $cmd =~ m!^/histservice/(.*)/(.*)/(.*)$! ) { &histservice( $1, "$2 $3" ); exit; } if( $cmd =~ m!^/overview/(.*)$! ) { &overview( $1 ); exit;} +if( $cmd =~ m!^/ovproblems/(.*)$! ) { &ovproblems( $1 ); exit;} # Need to do something when an invalid request comes through... exit(0); @@ -394,8 +396,15 @@ sub overview { &footer(); } - +sub ovproblems { + my( $other ) = @_; + my $view = $main::view || 'standard'; + + &header(0); + print &query( $SPONGSERVER, "ovproblems", $other, "html", $view ); + &footer(); +} # Just print a little message to stdout showing what valid options are to # the command line interface to spong, and then exit the program. -- 2.30.2