version 1.96, 2013/02/02 00:22:30
|
version 1.98, 2013/02/08 14:49:51
|
Line 271 sub log_machine_info {
|
Line 271 sub log_machine_info {
|
|
|
&log($fh,"<h3>distprobe</h3>"); |
&log($fh,"<h3>distprobe</h3>"); |
&log($fh,"<pre>"); |
&log($fh,"<pre>"); |
&get_distro($perlvar{'lonDaemons'},$fh); |
&log($fh,&encode_entities(&LONCAPA::distro(),'<>&"')); |
&log($fh,"</pre>"); |
&log($fh,"</pre>"); |
|
|
&errout($fh); |
&errout($fh); |
Line 752 sub write_serverhomeIDs {
|
Line 752 sub write_serverhomeIDs {
|
} |
} |
|
|
sub write_checksums { |
sub write_checksums { |
my ($perlvar) = @_; |
my $distro = &LONCAPA::distro(); |
return unless (ref($perlvar) eq 'HASH'); |
|
my $distro = &get_distro($perlvar->{'lonDaemons'}); |
|
if ($distro) { |
if ($distro) { |
print "Retrieving file version and checksumming.\n"; |
print "Retrieving file version and checksumming.\n"; |
|
my $numchksums = 0; |
my ($chksumsref,$versionsref) = |
my ($chksumsref,$versionsref) = |
&LONCAPA::Checksumming::get_checksums($distro,$perlvar->{'lonDaemons'}, |
&LONCAPA::Checksumming::get_checksums($distro,$perlvar{'lonDaemons'}, |
$perlvar->{'lonLib'}, |
$perlvar{'lonLib'}, |
$perlvar->{'lonIncludes'}, |
$perlvar{'lonIncludes'}, |
$perlvar->{'lonTabDir'}); |
$perlvar{'lonTabDir'}); |
if (ref($chksumsref) eq 'HASH') { |
if (ref($chksumsref) eq 'HASH') { |
$numchksums = scalar(keys(%{$chksumsref})); |
$numchksums = scalar(keys(%{$chksumsref})); |
} |
} |
Line 769 sub write_checksums {
|
Line 768 sub write_checksums {
|
} else { |
} else { |
print "File version retrieval and checksumming skipped - could not determine Linux distro.\n"; |
print "File version retrieval and checksumming skipped - could not determine Linux distro.\n"; |
} |
} |
return' |
return; |
} |
} |
|
|
sub send_mail { |
sub send_mail { |
Line 789 sub send_mail {
|
Line 788 sub send_mail {
|
} |
} |
} |
} |
|
|
sub get_distro { |
|
my ($dir,$fh) = @_; |
|
my $distro; |
|
if (open(my $disth,"$dir/distprobe |")) { |
|
while (my $line=<$disth>) { |
|
if ($fh) { |
|
&log($fh,&encode_entities($line,'<>&"')); |
|
} |
|
$distro .= $line; |
|
} |
|
close($disth); |
|
} |
|
return $distro; |
|
} |
|
|
|
sub usage { |
sub usage { |
print(<<USAGE); |
print(<<USAGE); |
loncron - housekeeping program that checks up on various parts of Lon-CAPA |
loncron - housekeeping program that checks up on various parts of Lon-CAPA |
Line 937 sub main () {
|
Line 921 sub main () {
|
&log_simplestatus(); |
&log_simplestatus(); |
&write_loncaparevs(); |
&write_loncaparevs(); |
&write_serverhomeIDs(); |
&write_serverhomeIDs(); |
&write_checksums(\%perlvar); |
&write_checksums(); |
if ($totalcount>200 && !$noemail) { &send_mail(); } |
if ($totalcount>200 && !$noemail) { &send_mail(); } |
} |
} |
} |
} |