--- loncom/loncron 2001/09/04 17:58:44 1.23 +++ loncom/loncron 2001/09/06 19:28:06 1.24 @@ -13,16 +13,13 @@ # 12/23 Gerd Kortemeyer # YEAR=2001 # 1/10/2001, 2/12/, 2/26, 3/15, 04/11, 04/21,8/27 Scott Harrison +# 09/04,09/06 Gerd Kortemeyer + +$|=1; use IO::File; use IO::Socket; -my $qflag=0; -if (@ARGV) { - my $arg=shift @ARGV; - $qflag=1 if $arg eq 'quick'; -} - # -------------------------------------------------- Non-critical communication sub reply { my ($cmd,$server)=@_; @@ -210,7 +207,8 @@ while ($line=) { $usage=$parts[4]; $usage=~s/\W//g; if ($usage>90) { - $warnings++; + $warnings++; + $notices++; } elsif ($usage>80) { $warnings++; } elsif ($usage>60) { @@ -220,6 +218,23 @@ while ($line=) { } close (DFH); print $fh ""; + + +print $fh "

ps

"; +print $fh "
";
+$psproc=0;
+
+open (PSH,"ps -aux|");
+while ($line=) { 
+   print $fh "$line"; 
+   $psproc++;
+}
+close (PSH);
+print $fh "
"; + +if ($psproc>200) { $notices++; } +if ($psproc>250) { $notices++; } + &errout($fh); # --------------------------------------------------------------- clean out tmp @@ -332,13 +347,13 @@ if ($perlvar{'lonRole'} eq "library") { print $fh "

lonsql not running, trying to start

"; system( "$perlvar{'lonDaemons'}/lonsql 2>>$perlvar{'lonDaemons'}/logs/lonsql_errors"); - sleep 120 unless $qflag; + sleep 10; if (-e $lonsqlfile) { print $fh "Seems like it started ...

"; my $lfh=IO::File->new("$lonsqlfile"); my $lonsqlpid=<$lfh>; chomp($lonsqlpid); - sleep 30 unless $qflag; + sleep 30; if (kill 0 => $lonsqlpid) { print $fh "

lonsql at pid $lonsqlpid responding

"; } else { @@ -347,7 +362,7 @@ if ($perlvar{'lonRole'} eq "library") { print $fh "Give it one more try ...

"; system( "$perlvar{'lonDaemons'}/lonsql 2>>$perlvar{'lonDaemons'}/logs/lonsql_errors"); - sleep 120 unless $qflag; + sleep 10; } } else { print $fh "Seems like that did not work!

"; @@ -427,13 +442,13 @@ if ($restartflag==1) { print $fh "

lond not running, trying to start

"; system( "$perlvar{'lonDaemons'}/lond 2>>$perlvar{'lonDaemons'}/logs/lond_errors"); - sleep 120 unless $qflag; + sleep 10; if (-e $londfile) { print $fh "Seems like it started ...

"; my $lfh=IO::File->new("$londfile"); my $londpid=<$lfh>; chomp($londpid); - sleep 30 unless $qflag; + sleep 30; if (kill 0 => $londpid) { print $fh "

lond at pid $londpid responding

"; } else { @@ -442,7 +457,7 @@ if ($restartflag==1) { print $fh "Give it one more try ...

"; system( "$perlvar{'lonDaemons'}/lond 2>>$perlvar{'lonDaemons'}/logs/lond_errors"); - sleep 120 unless $qflag; + sleep 10; } } else { print $fh "Seems like that did not work!

"; @@ -523,13 +538,13 @@ if ($restartflag==1) { print $fh "

lonc not running, trying to start

"; system( "$perlvar{'lonDaemons'}/lonc 2>>$perlvar{'lonDaemons'}/logs/lonc_errors"); - sleep 120 unless $qflag; + sleep 10; if (-e $loncfile) { print $fh "Seems like it started ...

"; my $lfh=IO::File->new("$loncfile"); my $loncpid=<$lfh>; chomp($loncpid); - sleep 30 unless $qflag; + sleep 30; if (kill 0 => $loncpid) { print $fh "

lonc at pid $loncpid responding

"; } else { @@ -538,7 +553,7 @@ if ($restartflag==1) { print $fh "Give it one more try ...

"; system( "$perlvar{'lonDaemons'}/lonc 2>>$perlvar{'lonDaemons'}/logs/lonc_errors"); - sleep 120 unless $qflag; + sleep 10; } } else { print $fh "Seems like that did not work!

"; @@ -681,8 +696,7 @@ if ($totalcount>200) { $emailto="$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}"; $subj="LON: $perlvar{'lonHostID'} E:$errors W:$warnings N:$notices"; system( - "metasend -b -t $emailto -s '$subj' -f $statusdir/index.html -m text/html") - unless $qflag; + "metasend -b -t $emailto -s '$subj' -f $statusdir/index.html -m text/html"); } 1;