--- loncom/loncron 2011/10/28 14:26:15 1.91 +++ loncom/loncron 2014/03/17 14:47:38 1.100 @@ -2,7 +2,7 @@ # Housekeeping program, started by cron, loncontrol and loncron.pl # -# $Id: loncron,v 1.91 2011/10/28 14:26:15 raeburn Exp $ +# $Id: loncron,v 1.100 2014/03/17 14:47:38 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,6 +32,7 @@ use strict; use lib '/home/httpd/lib/perl/'; use LONCAPA::Configuration; +use LONCAPA::Checksumming; use LONCAPA; use Apache::lonnet; use Apache::loncommon; @@ -270,12 +271,7 @@ sub log_machine_info { &log($fh,"
"); - open(DSH,"$perlvar{'lonDaemons'}/distprobe |"); - while (my $line="); &errout($fh); @@ -515,21 +511,13 @@ sub clean_sockets { # ----------------------------------------------------------------------- httpd sub check_httpd_logs { my ($fh)=@_; - &log($fh,') { - &log($fh,&encode_entities($line,'<>&"')); - $psproc++; - } - close(DSH); + &log($fh,&encode_entities(&LONCAPA::distro(),'<>&"')); &log($fh,"
'); - - open (DFH,"tail -n25 /etc/httpd/logs/access_log|"); - while (my $line=) { &log($fh,&encode_entities($line,'<>&"')) }; - close (DFH); - - &log($fh,"
"); - - open (DFH,"tail -n25 /etc/httpd/logs/error_log|"); - while (my $line="); &errout($fh); } @@ -538,7 +526,7 @@ sub check_httpd_logs { sub rotate_lonnet_logs { my ($fh)=@_; &log($fh,') { - &log($fh,"$line"); - if ($line=~/\[error\]/) { $notices++; } + if (open(PIPE,"./lchttpdlogs|")) { + while (my $line= ) { + &log($fh,$line); + if ($line=~/\[error\]/) { $notices++; } + } + close(PIPE); } - close (DFH); - &log($fh,"
'); - print "checking logs\n"; + print "Checking logs.\n"; if (-e "$perlvar{'lonDaemons'}/logs/lonnet.log"){ open (DFH,"tail -n50 $perlvar{'lonDaemons'}/logs/lonnet.log|"); while (my $line=) { @@ -582,7 +570,7 @@ sub rotate_other_logs { sub test_connections { my ($fh)=@_; &log($fh,' Connections
'); - print "testing connections\n"; + print "Testing connections.\n"; &log($fh,"