use Spong::History;
use Spong::Daemon;
use Spong::Log;
+use Spong::HostGroups;
use Sys::Hostname;
use File::Path;
if( $query eq "info" ) { &show_info( @args ); }
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 ); }
close( CLIENT );
select $output;
}
}
+sub show_overview {
+ my( $hosts, $type, $view, $other ) = @_;
+ my( $g );
+ $other = "ALL" if ! $other;
+ eval { $g = Spong::HostGroups->new( $other ); };
+ if ( $g ) {
+ print $g->display( $type, $view );
+ } else {
+ print &fmt_error($type,"Invalid request, group $other does not exist"),"\n";
+ }
+
+}
+
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",
+ "histservice=s", "overview",
"brief", "standard", "full" );
$actionbar = 0;
$opt=1;
}
+ if ( defined $opt{'overview'} ) { &overview( $opt{'overview'} ); $opt= 1; }
+
if( ! $opt ) { &summary( "all" ); }
exit(0);
if( $cmd =~ m!^/histservice/(.*)/(.*)/(.*)$! ) { &histservice( $1, "$2 $3" ); exit; }
+if( $cmd =~ m!^/overview/(.*)$! ) { &overview( $1 ); exit;}
+
# Need to do something when an invalid request comes through...
exit(0);
$time );
&footer();
}
+
+sub overview {
+ my( $other ) = @_;
+ my $view = $main::view || 'standard';
+
+ &header(0);
+ print &query( $SPONGSERVER, "overview", $other, "html", $view );
+ &footer();
+
+}