Diff for /loncom/loncron between versions 1.50 and 1.56

version 1.50, 2004/05/11 21:14:23 version 1.56, 2005/02/09 20:41:29
Line 83  sub start_daemon { Line 83  sub start_daemon {
  $progname='loncnew';    $progname='loncnew'; 
  print "new ";   print "new ";
     }      }
     system("$perlvar{'lonDaemons'}/$progname 2>>$perlvar{'lonDaemons'}/logs/${daemon}_errors");      my $error_fname="$perlvar{'lonDaemons'}/logs/${daemon}_errors";
       my $size=(stat($error_fname))[7];
       if ($size>40000) {
    &log($fh,"<p>Rotating error logs ...</p>");
    rename("$error_fname.2","$error_fname.3");
    rename("$error_fname.1","$error_fname.2");
    rename("$error_fname","$error_fname.1");
       }
       system("$perlvar{'lonDaemons'}/$progname 2>$perlvar{'lonDaemons'}/logs/${daemon}_errors");
     sleep 2;      sleep 2;
     if (-e $pidfile) {      if (-e $pidfile) {
  &log($fh,"<p>Seems like it started ...</p>");   &log($fh,"<p>Seems like it started ...</p>");
Line 252  sub log_machine_info { Line 260  sub log_machine_info {
     &log($fh,"<pre>");      &log($fh,"<pre>");
     my $psproc=0;      my $psproc=0;
   
     open (PSH,"ps -aux --cols 140 |");      open (PSH,"ps aux --cols 140 |");
     while (my $line=<PSH>) {       while (my $line=<PSH>) { 
  &log($fh,&encode_entities($line,'<>&"'));    &log($fh,&encode_entities($line,'<>&"')); 
  $psproc++;   $psproc++;
Line 455  sub test_connections { Line 463  sub test_connections {
     foreach my $tryserver (sort(keys(%{$hostname}))) {      foreach my $tryserver (sort(keys(%{$hostname}))) {
  print(".");   print(".");
  my $result;   my $result;
  my $answer=reply("pong",$tryserver);   my $answer=reply("ping",$tryserver);
  if ($answer eq "$tryserver:$perlvar{'lonHostID'}") {   if ($answer eq "$tryserver:$perlvar{'lonHostID'}") {
     $result="<b>ok</b>";      $result="<b>ok</b>";
     $good++;      $good++;
Line 546  sub log_simplestatus { Line 554  sub log_simplestatus {
 sub send_mail {  sub send_mail {
     print "sending mail\n";      print "sending mail\n";
     my $emailto="$perlvar{'lonAdmEMail'}";      my $emailto="$perlvar{'lonAdmEMail'}";
     if ($totalcount>1000) {      if ($totalcount>2500) {
  $emailto.=",$perlvar{'lonSysEMail'}";   $emailto.=",$perlvar{'lonSysEMail'}";
     }      }
     my $subj="LON: $perlvar{'lonHostID'} E:$errors W:$warnings N:$notices";       my $subj="LON: $perlvar{'lonHostID'} E:$errors W:$warnings N:$notices"; 
     system("metasend -b -t $emailto -s '$subj' -f $statusdir/index.html -m text/html");  
       my $result=system("metasend -b -t $emailto -s '$subj' -f $statusdir/index.html -m text/html >& /dev/null");
       if ($result != 0) {
    $result=system("mail -s '$subj' $emailto < $statusdir/index.html");
       }
 }  }
   
 sub usage {  sub usage {
Line 621  sub main () { Line 633  sub main () {
     my (%hostname,%hostdom,%hostrole,%spareid);      my (%hostname,%hostdom,%hostrole,%spareid);
     while (my $configline=<$config>) {      while (my $configline=<$config>) {
  next if ($configline =~ /^(\#|\s*\$)/);   next if ($configline =~ /^(\#|\s*\$)/);
  my ($id,$domain,$role,$name,$ip,$domdescr)=split(/:/,$configline);   my ($id,$domain,$role,$name)=split(/:/,$configline);
  if ($id && $domain && $role && $name && $ip) {   if ($id && $domain && $role && $name) {
       $name=~s/\s//g;
     $hostname{$id}=$name;      $hostname{$id}=$name;
     $hostdom{$id}=$domain;      $hostdom{$id}=$domain;
     $hostrole{$id}=$role;      $hostrole{$id}=$role;

Removed from v.1.50  
changed lines
  Added in v.1.56


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