-#!@@PERL@@
+#!/usr/bin/perl
#
# This program is used to display information collected by the spong server to
# people using web based clients. This provides the same type of interface to
&load_config_files(); # Loads the user specified configuration information
+$main::WWW_DEFAULT_VIEW = "HOST" unless $main::WWW_DEFAULT_VIEW;
+
# Check to see if I am being run as a command line program (in which case I
# just generate static HTML documents), or a CGI program (in which case I
# present back an interactive web interface). The command line arguments are
# These commands control the frame interface, etc...
if( $cmd eq "" || $cmd eq "/" ) {
- $main::SPONG_DEFAULT_VIEW = "HOST" unless $main::SPONG_DEFAULT_VIEW;
- &interactive( "all" ) if $main::SPONG_DEFAULT_VIEW eq "HOST";
- &ovinteractive( "all" ) if $main::SPONG_DEFAULT_VIEW eq "OVERVIEW";
+ if ($WWWFRAMES == 3) { &toplevel(); }
+ else {
+ &interactive( "all" ) if $main::WWW_DEFAULT_VIEW eq "HOSTS";
+ &ovinteractive( "all" ) if $main::WWW_DEFAULT_VIEW eq "GROUPS";
+ }
exit;
}
+if ($cmd =~ m!^/title$! ) { &title(); exit; }
+
if( $cmd =~ m!^/group/(.*)$! ) { &interactive( $1 ); exit; }
+if( $cmd =~ m!^/bygroup/(.*)$! ) { &ovinteractive( $1 ); exit; }
if( $cmd =~ m!^/commands/(.*)$! ) { &commands( $1 ); exit; }
if( $cmd =~ m!^/ovcommands/(.*)$! ) { &ovcommands( $1 ); exit; }
# commands & error summary information is shown, and the frame for more
# detailed host information.
+
+sub toplevel {
+
+ print "Content-type: text/html\n\n";
+ print "<html><head>\n";
+ print "<title>Spong v$SPONGVER - System Status Monitor</title></head>\n";
+ print "<frameset rows=\"40,*\" border=5 frameboard=no>";
+ print "<frame src=\"$main::WWWSPONG/title\" marginwidth=5 ";
+ print "marginheight=5 noshade name=\"title\">\n";
+ print "<frame src=\"";
+
+ print "$main::WWWSPONG/bygroup/" if $main::WWW_DEFAULT_VIEW eq "GROUPS";
+ print "$main::WWWSPONG/group/all" if $main::WWW_DEFAULT_VIEW eq "HOSTS";
+
+ print "\" marginwidth=10 ";
+ print "marginheight=5 noshade name=\"view\" border=1>\n";
+ print "</frameset>\n";
+ print "<noframe>\n";
+ print "Frameless version not currently available.\n";
+ print "</noframes>\n</html>\n";
+}
+
sub interactive {
my $group = shift;
print "</noframes>\n</html>\n";
}
+# This function fills out the Title header. It had a command bar that changes
+# the the current View type in the 'view' frame
+
+sub title {
+ &header(0);
+
+ my $me = $main::WWWSPONG;
+
+ print "<base target=view>\n";
+# print "<center>";
+ print "<font size=+2><b>Spong v$SPONGVER</b></font>\n";
+# print "</center>\n";
+# print "<br>";
+ print "<a href=\"$me/bygroup/\">Groups</a> || \n";
+ print "<a href=\"$me/group/all\">Hosts</a> \n";
+
+# print "<b>Extra Tool Bar Commands:</b> ";
+# print " <a href=\"/spong-rrd/index.html\">Spong RRD Charts</a>\n";
+# print " || <a href=\"/cgi-bin/sysquery.pl?target=showall\">System Summaries</a>\n";
+
+ if ( $main::WWW_TITLE_ACTIONBAR ) { print $main::WWW_TITLE_ACTIONBAR,"\n"; }
+}
+
+
# This function fills out the action bar of the interactive spong display.
# This lists the functions that you can perform via the web interface.
&header( 1 );
print "<base target=right>\n";
- print "<font size=+2><b>Spong v$SPONGVER</b></font>\n";
+# print "<font size=+2><b>Spong v$SPONGVER</b></font>\n";
+ print "<font size=+2><b>Hosts View</b></font>\n";
+ unless ($WWWFRAMES == 3) {
+ print "<hr>\n";
+ print "<b>Views: <a href=\"$me/bygroup/\" target=_top>Groups</a> || \n";
+ print "<a href=\"$me/group/all\" target=_top>Hosts</a> \n";
+ }
print "<hr>\n";
print "<a href=\"$main::WWWACK\">Ack</a> || \n";
&header( 1 );
print "<base target=right>\n";
- print "<font size=+2><b>Spong v$SPONGVER</b></font>\n";
+# print "<font size=+2><b>Spong v$SPONGVER</b></font>\n";
+ print "<font size=+2><b>Groups View</b></font>\n";
+ unless ($WWWFRAMES == 3) {
+ print "<hr>\n";
+ print "<b>Views: </b><a href=\"$me/bygroup/\" target=_top>Groups</a> || \n";
+ print "<a href=\"$me/group/all\" target=_top>Hosts</a> \n";
+ }
print "<hr>\n";
print "<a href=\"$me/ioverview/\">Groups</a> || \n";
- print "<a href=\"$me/iovsummary/\">Group Summary</a> || \n";
- print "<a href=\"$me/group/all\" target=\"_top\">Hosts</a> \n";
+ print "<a href=\"$me/iovsummary/\">Group Summary</a>\n";
print "<hr>\n";
print "<a href=\"$main::WWWACK\">Ack</a> || \n";
&ovproblems( $group );
-# print "<p><hr><a href=\"$me/groups\">Group</a>: <b>$gname</b>\n<hr>\n";
+ print "<p><hr>";
+# print "<a href=\"$me/groups\">Group</a>: <b>$gname</b>\n<hr>\n";
print "Updated at ", POSIX::strftime( "%H:%M, on %D", localtime() ), "\n";
&footer();
}
my $group;
&header( $group, "Groups", '', 0 );
- print "<base target=_top>\n";
+ print "<base target=view>\n";
print "<font size=+2><b>Spong Groups</b></font>\n<hr>\n";
print "You can select a specific group to show only information about ";