version 1.40, 2003/07/29 21:00:21
|
version 1.41, 2003/07/30 16:49:27
|
Line 131 $date=localtime($now);
|
Line 131 $date=localtime($now);
|
|
|
{ |
{ |
my $fh=IO::File->new(">$statusdir/newstatus.html"); |
my $fh=IO::File->new(">$statusdir/newstatus.html"); |
|
my %simplestatus=(); |
|
|
print $fh (<<ENDHEADERS); |
print $fh (<<ENDHEADERS); |
<html> |
<html> |
Line 216 while ($line=<DFH>) {
|
Line 217 while ($line=<DFH>) {
|
} elsif ($usage>60) { |
} elsif ($usage>60) { |
$notices++; |
$notices++; |
} |
} |
if ($usage>95) { $warnings++; $warnings++ } |
if ($usage>95) { $warnings++; $warnings++; $simplestatus{'diskfull'}++; } |
} |
} |
close (DFH); |
close (DFH); |
print $fh "</pre>"; |
print $fh "</pre>"; |
Line 350 my $restartflag=1;
|
Line 351 my $restartflag=1;
|
} |
} |
} |
} |
if ($restartflag==1) { |
if ($restartflag==1) { |
|
$simplestatus{'lonsql'}='off'; |
$errors++; |
$errors++; |
print $fh '<br><font color="red">Killall lonsql: '. |
print $fh '<br><font color="red">Killall lonsql: '. |
system('killall lonsql').' - '; |
system('killall lonsql').' - '; |
Line 369 my $restartflag=1;
|
Line 371 my $restartflag=1;
|
sleep 2; |
sleep 2; |
if (kill 0 => $lonsqlpid) { |
if (kill 0 => $lonsqlpid) { |
print $fh "<h3>lonsql at pid $lonsqlpid responding</h3>"; |
print $fh "<h3>lonsql at pid $lonsqlpid responding</h3>"; |
|
$simplestatus{'lonsql'}='restarted'; |
} else { |
} else { |
$errors++; $errors++; |
$errors++; $errors++; |
print $fh "<h3>lonsql at pid $lonsqlpid not responding</h3>"; |
print $fh "<h3>lonsql at pid $lonsqlpid not responding</h3>"; |
Line 446 if (-e $londfile) {
|
Line 449 if (-e $londfile) {
|
} |
} |
} |
} |
if ($restartflag==1) { |
if ($restartflag==1) { |
|
$simplestatus{'lond'}='off'; |
$errors++; |
$errors++; |
print $fh '<br><font color="red">Killall lond: '. |
print $fh '<br><font color="red">Killall lond: '. |
system('killall lond').' - '; |
system('killall lond').' - '; |
Line 464 if ($restartflag==1) {
|
Line 468 if ($restartflag==1) {
|
sleep 2; |
sleep 2; |
if (kill 0 => $londpid) { |
if (kill 0 => $londpid) { |
print $fh "<h3>lond at pid $londpid responding</h3>"; |
print $fh "<h3>lond at pid $londpid responding</h3>"; |
|
$simplestatus{'lond'}='restarted'; |
} else { |
} else { |
$errors++; $errors++; |
$errors++; $errors++; |
print $fh "<h3>lond at pid $londpid not responding</h3>"; |
print $fh "<h3>lond at pid $londpid not responding</h3>"; |
Line 542 if (-e $loncfile) {
|
Line 547 if (-e $loncfile) {
|
} |
} |
} |
} |
if ($restartflag==1) { |
if ($restartflag==1) { |
|
$simplestatus{'lonc'}='off'; |
$errors++; |
$errors++; |
print $fh '<br><font color="red">Killall lonc: '. |
print $fh '<br><font color="red">Killall lonc: '. |
system('killall lonc').' - '; |
system('killall lonc').' - '; |
Line 560 if ($restartflag==1) {
|
Line 566 if ($restartflag==1) {
|
sleep 2; |
sleep 2; |
if (kill 0 => $loncpid) { |
if (kill 0 => $loncpid) { |
print $fh "<h3>lonc at pid $loncpid responding</h3>"; |
print $fh "<h3>lonc at pid $loncpid responding</h3>"; |
|
$simplestatus{'lonc'}='restarted'; |
} else { |
} else { |
$errors++; $errors++; |
$errors++; $errors++; |
print $fh "<h3>lonc at pid $loncpid not responding</h3>"; |
print $fh "<h3>lonc at pid $loncpid not responding</h3>"; |
Line 638 if (-e $lonhttpdfile) {
|
Line 645 if (-e $lonhttpdfile) {
|
} |
} |
} |
} |
if ($restartflag==1) { |
if ($restartflag==1) { |
|
$simplestatus{'lonhttpd'}='off'; |
$errors++; |
$errors++; |
print $fh '<br><font color="red">Killall lonhttpd: '. |
print $fh '<br><font color="red">Killall lonhttpd: '. |
system('killall lonhttpd').' - '; |
system('killall lonhttpd').' - '; |
Line 656 if ($restartflag==1) {
|
Line 664 if ($restartflag==1) {
|
sleep 2; |
sleep 2; |
if (kill 0 => $lonhttpdpid) { |
if (kill 0 => $lonhttpdpid) { |
print $fh "<h3>lonhttpd at pid $lonhttpdpid responding</h3>"; |
print $fh "<h3>lonhttpd at pid $lonhttpdpid responding</h3>"; |
|
$simplestatus{'lonhttpd'}='restarted'; |
} else { |
} else { |
$errors++; $errors++; |
$errors++; $errors++; |
print $fh "<h3>lonhttpd at pid $lonhttpdpid not responding</h3>"; |
print $fh "<h3>lonhttpd at pid $lonhttpdpid not responding</h3>"; |
Line 779 $unsend=0;
|
Line 788 $unsend=0;
|
print $fh "Total unsend messages: <b>$unsend</b><p>\n"; |
print $fh "Total unsend messages: <b>$unsend</b><p>\n"; |
$warnings=$warnings+5*$unsend; |
$warnings=$warnings+5*$unsend; |
|
|
|
if ($unsend) { $simplestatus{'unsend'}=$unsend; } |
print $fh "<h3>Outgoing Buffer</h3>"; |
print $fh "<h3>Outgoing Buffer</h3>"; |
|
|
open (DFH,"ls -lF $perlvar{'lonSockDir'}/delayed|"); |
open (DFH,"ls -lF $perlvar{'lonSockDir'}/delayed|"); |
Line 796 $now=time;
|
Line 806 $now=time;
|
$date=localtime($now); |
$date=localtime($now); |
print $fh "<hr>$date ($now)</body></html>\n"; |
print $fh "<hr>$date ($now)</body></html>\n"; |
print "writing done\n"; |
print "writing done\n"; |
|
$fh->close(); |
} |
} |
|
if ($errors) { $simplestatus{'errors'}=$errors; } |
|
if ($warnings) { $simplestatus{'warnings'}=$warnings; } |
|
if ($notices) { $simplestatus{'notices'}=$notices; } |
|
$simplestatus{'time'}=time; |
|
|
rename ("$statusdir/newstatus.html","$statusdir/index.html"); |
rename ("$statusdir/newstatus.html","$statusdir/index.html"); |
|
{ |
|
my $sfh=IO::File->new(">$statusdir/loncron_simple.txt"); |
|
foreach (keys %simplestatus) { |
|
print $sfh $_.'='.$simplestatus{$_}.'&'; |
|
} |
|
print $sfh "\n"; |
|
$sfh->close(); |
|
} |
if ($totalcount>200) { |
if ($totalcount>200) { |
print "mailing\n"; |
print "mailing\n"; |
$emailto="$perlvar{'lonAdmEMail'}"; |
$emailto="$perlvar{'lonAdmEMail'}"; |