[LON-CAPA-cvs] cvs: loncom /cgi clusterstatus.pl

www lon-capa-cvs@mail.lon-capa.org
Thu, 31 Jul 2003 16:07:47 -0000


www		Thu Jul 31 12:07:47 2003 EDT

  Modified files:              
    /loncom/cgi	clusterstatus.pl 
  Log:
  Starts to do reasonable stuff.
  
  
Index: loncom/cgi/clusterstatus.pl
diff -u loncom/cgi/clusterstatus.pl:1.9 loncom/cgi/clusterstatus.pl:1.10
--- loncom/cgi/clusterstatus.pl:1.9	Thu Jul 31 11:35:02 2003
+++ loncom/cgi/clusterstatus.pl	Thu Jul 31 12:07:47 2003
@@ -3,7 +3,7 @@
 # The LearningOnline Network with CAPA
 # Cluster Status
 #
-# $Id: clusterstatus.pl,v 1.9 2003/07/31 15:35:02 www Exp $
+# $Id: clusterstatus.pl,v 1.10 2003/07/31 16:07:47 www Exp $
 
 use lib '/home/httpd/lib/perl/';
 use LONCAPA::Configuration;
@@ -178,7 +178,7 @@
 <tr><td bgcolor="#BBDDBB"><font color="#225522" face="arial"><b>
 $local $hostdom{$local}</b> <tt>($hostname{$local}; $hostrole{$local})</tt>
 <br />$domaindescription{$hostdom{$local}}
-</font></th></tr><tr><td bgcolor="DDDDBB"><font color="#225522">
+</font></th></tr><tr><td bgcolor="#DDDDBB"><font color="#225522">
 ENDHEADER
     &login($local);&server($local);&users($local);&versions($local);
     &loncron($local);&lond($local);&lonc($local);&runloncron($local);
@@ -277,7 +277,7 @@
 unless ($modes{$mode}) { $mode='trouble'; }
 # ================================================================ Send Headers
 print "Content-type: text/html\n\n".
-    "<html><body bgcolor=#FFFFFF>\n";
+    "<html><body bgcolor='#FFFFFF'>\n";
 # -------------------- Read loncapa.conf (and by default, loncapa_apache.conf).
 my $perlvarref=LONCAPA::Configuration::read_conf('loncapa.conf');
 %perlvar=%{$perlvarref};
@@ -324,7 +324,7 @@
 }
 
 
-print "<h1>Cluster Status ".localtime()."</h1>";
+print "<img src='/adm/lonIcons/lonlogos.gif' align='right' /><h1>LON-CAPA Cluster Status ".localtime()."</h1>";
 print "<form name='prgstat'>\n".
 "<input type='text' name='progress' value='Starting ...' size='100' /><br />".
 "</form>\n";;
@@ -424,7 +424,38 @@
 	foreach (&doomedness($mode)) {
 	    &serverstatus($_);
 	}
+    } elsif ($mode eq 'connections') {
+	print 
+       "<table cellspacing='3' cellpadding='3' border='0' bgcolor='#225522'>".
+       "<tr><td bgcolor='#225522'>&nbsp;</td>";
+	foreach (sort keys %hostname) {
+	    my $remote=$_;
+	    print '<th bgcolor="#DDDDBB">'.$remote.'</th>';
+	}
+	print "</tr>\n";
+# connection matrix
+	foreach (sort keys %hostname) {
+	    my $local=$_;
+	    print '<tr><th bgcolor="#DDDDBB">'.$local.'</th>';
+	    foreach (sort keys %hostname) {
+		my $remote=$_;
+		if ($connectionstatus{$local.'_TO_'.$remote} eq 'not_yet') {
+		    print '<td bgcolor="#FFFFFF">&nbsp;</td>';
+		} elsif ($connectionstatus{$local.'_TO_'.$remote} eq 'ok') {
+		    print 
+'<td bgcolor="#BBDDBB"><font color="#225522" face="arial"><b>ok</b></td>';
+		} else {
+		    print 
+		  '<td bgcolor="#DDBBBB"><font color="#552222" size="-2">'.
+		  $connectionstatus{$local.'_TO_'.$remote}.'<br />';
+		    &lonc($local); &lond($remote);
+		    print '</td>';
+		}
+	    }
+	    print "</tr>\n";
+	}
     }
+    print "</table>";
 # ============================================================== Close, refresh
 print "</form><script>";
 $runtime=time-$starttime;