[LON-CAPA-cvs] cvs: loncom /cgi clusterstatus.pl
www
lon-capa-cvs@mail.lon-capa.org
Sun, 14 Sep 2003 19:00:03 -0000
www Sun Sep 14 15:00:03 2003 EDT
Modified files:
/loncom/cgi clusterstatus.pl
Log:
Provide links to reroute scripts
Index: loncom/cgi/clusterstatus.pl
diff -u loncom/cgi/clusterstatus.pl:1.22 loncom/cgi/clusterstatus.pl:1.23
--- loncom/cgi/clusterstatus.pl:1.22 Sun Sep 14 14:24:34 2003
+++ loncom/cgi/clusterstatus.pl Sun Sep 14 15:00:03 2003
@@ -1,7 +1,7 @@
#!/usr/bin/perl
$|=1;
# Generates a html page showing various sataus reports about the cluster
-# $Id: clusterstatus.pl,v 1.22 2003/09/14 18:24:34 www Exp $
+# $Id: clusterstatus.pl,v 1.23 2003/09/14 19:00:03 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -247,6 +247,30 @@
print &otherwindow($local,'/cgi-bin/takeonline.pl','Take online');
}
+sub takeoffline {
+ my $local=shift;
+ print &otherwindow($local,'/cgi-bin/takeoffline.pl','Take offline');
+}
+
+sub reroute {
+ my ($local,$remote)=@_;
+ print &otherwindow($local,'/cgi-bin/takeoffline.pl?'.
+ $hostname{$remote}.'&'.$hostdom{$local}
+ ,$remote)."\n";
+}
+
+sub allreroutes {
+ my $local=shift;
+ &takeoffline($local);
+ print ' Reroute to: <font size="1">';
+ foreach my $remote (sort keys %hostname) {
+ unless ($local eq $remote) {
+ &reroute($local,$remote);
+ }
+ }
+ print '</font>';
+}
+
# ========================================================= Produce a green bar
sub bar {
my $parm=shift;
@@ -318,6 +342,8 @@
if ($host{$local.'_errors'}) {
print "<br />loncron errors: ".$host{$local.'_errors'};
}
+ print "</td></tr><tr><td bgcolor='#DDDDDD'>";
+ &allreroutes($local);
print "</td></tr></table><br />";
}
@@ -600,7 +626,7 @@
$trouble='RPMs outdated.<br />';
}
if ($host{$local.'_reroute'}) {
- $trouble='Re-Routing<br >';
+ $trouble='Rerouting<br >';
}
if ($trouble) { $count++; &serverstatus($local,$trouble); }
}