'; + + if (-e "$perlvar{'lonDaemons'}/logs/lonsql.log"){ + open (DFH,"tail -n100 $perlvar{'lonDaemons'}/logs/lonsql.log|"); + while ($line="; + + my $lonsqlfile="$perlvar{'lonDaemons'}/logs/lonsql.pid"; + + if (-e $lonsqlfile) { + my $lfh=IO::File->new("$lonsqlfile"); + my $lonsqlpid=<$lfh>; + chomp($lonsqlpid); + if (kill 0 => $lonsqlpid) { + print $fh ") { + print $fh "$line"; + if ($line=~/INFO/) { $notices++; } + if ($line=~/WARNING/) { $notices++; } + if ($line=~/CRITICAL/) { $warnings++; } + }; + close (DFH); + } + print $fh "
"; + my $lfh=IO::File->new("$lonsqlfile"); + my $lonsqlpid=<$lfh>; + chomp($lonsqlpid); + sleep 30; + if (kill 0 => $lonsqlpid) { + print $fh "
"; + system("$perlvar{'lonDaemons'}/lonsql"); + sleep 120; + } + } else { + print $fh "Seems like that did not work!
"; + $errors++; + } + if (-e "$perlvar{'lonDaemons'}/logs/lonsql.log"){ + print $fh "
"; + open (DFH,"tail -n100 $perlvar{'lonDaemons'}/logs/lonsql.log|"); + while ($line="; + } + } + + $fname="$perlvar{'lonDaemons'}/logs/lonsql.log"; + + my ($dev,$ino,$mode,$nlink, + $uid,$gid,$rdev,$size, + $atime,$mtime,$ctime, + $blksize,$blocks)=stat($fname); + + if ($size>40000) { + print $fh "Rotating logs ...) { + print $fh "$line"; + if ($line=~/WARNING/) { $notices++; } + if ($line=~/CRITICAL/) { $notices++; } + }; + close (DFH); + print $fh "
"; + rename("$fname.2","$fname.3"); + rename("$fname.1","$fname.2"); + rename("$fname","$fname.1"); + } + + &errout($fh); +} # ------------------------------------------------------------------------ lond print $fh '
'; @@ -209,8 +294,8 @@ open (DFH,"tail -n100 $perlvar{'lonDaemo while ($line="; @@ -290,8 +374,8 @@ open (DFH,"tail -n100 $perlvar{'lonDaemo while ($line=) { print $fh "$line"; if ($line=~/INFO/) { $notices++; } - if ($line=~/WARNING/) { $warnings++; } - if ($line=~/CRITICAL/) { $errors++; } + if ($line=~/WARNING/) { $notices++; } + if ($line=~/CRITICAL/) { $warnings++; } }; close (DFH); } @@ -257,9 +342,8 @@ if (-e $londfile) { open (DFH,"tail -n100 $perlvar{'lonDaemons'}/logs/lond.log|"); while ($line= ) { print $fh "$line"; - if ($line=~/INFO/) { $notices++; } - if ($line=~/WARNING/) { $warnings++; } - if ($line=~/CRITICAL/) { $errors++; } + if ($line=~/WARNING/) { $notices++; } + if ($line=~/CRITICAL/) { $notices++; } }; close (DFH); print $fh "