Diff for /loncom/loncron between versions 1.109 and 1.110

version 1.109, 2018/10/25 02:48:56 version 1.110, 2018/10/25 03:27:22
Line 113  sub checkon_daemon { Line 113  sub checkon_daemon {
     my $result;      my $result;
     &log($fh,'<hr /><a name="'.$daemon.'" /><h2>'.$daemon.'</h2><h3>Log</h3><p style="white-space: pre;"><tt>');      &log($fh,'<hr /><a name="'.$daemon.'" /><h2>'.$daemon.'</h2><h3>Log</h3><p style="white-space: pre;"><tt>');
     printf("%-15s ",$daemon);      printf("%-15s ",$daemon);
     if (-e "$perlvar{'lonDaemons'}/logs/$daemon.log"){      if ($fh) {
  open (DFH,"tail -n25 $perlvar{'lonDaemons'}/logs/$daemon.log|");          if (-e "$perlvar{'lonDaemons'}/logs/$daemon.log"){
  while (my $line=<DFH>) {       if (open(DFH,"tail -n25 $perlvar{'lonDaemons'}/logs/$daemon.log|")) {
     &log($fh,"$line");          while (my $line=<DFH>) { 
     if ($line=~/INFO/) { $notices++; }              &log($fh,"$line");
     if ($line=~/WARNING/) { $notices++; }              if ($line=~/INFO/) { $notices++; }
     if ($line=~/CRITICAL/) { $warnings++; }              if ($line=~/WARNING/) { $notices++; }
  };              if ($line=~/CRITICAL/) { $warnings++; }
  close (DFH);          }
           close (DFH);
               }
           }
           &log($fh,"</tt></p>");
     }      }
     &log($fh,"</tt></p>");  
           
     my $pidfile="$perlvar{'lonDaemons'}/logs/$daemon.pid";      my $pidfile="$perlvar{'lonDaemons'}/logs/$daemon.pid";
           
Line 169  sub checkon_daemon { Line 172  sub checkon_daemon {
             &clean_lonc_childpids();              &clean_lonc_childpids();
         }          }
  &log($fh,"<h3>$daemon not running, trying to start</h3>");   &log($fh,"<h3>$daemon not running, trying to start</h3>");
   
  if (&start_daemon($fh,$daemon,$pidfile,$args)) {   if (&start_daemon($fh,$daemon,$pidfile,$args)) {
     &log($fh,"<h3>$daemon at pid $daemonpid responding</h3>");      &log($fh,"<h3>$daemon at pid $daemonpid responding</h3>");
     $simplestatus{$daemon}='restarted';      $simplestatus{$daemon}='restarted';
Line 194  sub checkon_daemon { Line 197  sub checkon_daemon {
  &log($fh,"<p>Unable to start $daemon</p>");   &log($fh,"<p>Unable to start $daemon</p>");
     }      }
  }   }
           if ($fh) {
  if (-e "$perlvar{'lonDaemons'}/logs/$daemon.log"){      if (-e "$perlvar{'lonDaemons'}/logs/$daemon.log"){
     &log($fh,"<p><pre>");          &log($fh,"<p><pre>");
     open (DFH,"tail -n100 $perlvar{'lonDaemons'}/logs/$daemon.log|");          if (open(DFH,"tail -n100 $perlvar{'lonDaemons'}/logs/$daemon.log|")) {
     while (my $line=<DFH>) {               while (my $line=<DFH>) { 
  &log($fh,"$line");          &log($fh,"$line");
  if ($line=~/WARNING/) { $notices++; }          if ($line=~/WARNING/) { $notices++; }
  if ($line=~/CRITICAL/) { $notices++; }          if ($line=~/CRITICAL/) { $notices++; }
     };              }
     close (DFH);              close (DFH);
     &log($fh,"</pre></p>");                  }
           &log($fh,"</pre></p>");
               }
  }   }
     }      }
           

Removed from v.1.109  
changed lines
  Added in v.1.110


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>