version 1.133, 2024/07/28 23:49:32
|
version 1.135, 2024/10/24 20:50:05
|
Line 309 sub log_machine_info {
|
Line 309 sub log_machine_info {
|
|
|
sub start_logging { |
sub start_logging { |
my $fh=IO::File->new(">$statusdir/newstatus.html"); |
my $fh=IO::File->new(">$statusdir/newstatus.html"); |
my %simplestatus=(); |
%simplestatus=(); |
my $now=time; |
my $now=time; |
my $date=localtime($now); |
my $date=localtime($now); |
|
|
Line 998 sub log_simplestatus {
|
Line 998 sub log_simplestatus {
|
rename("$statusdir/newstatus.html","$statusdir/index.html"); |
rename("$statusdir/newstatus.html","$statusdir/index.html"); |
|
|
my $sfh=IO::File->new(">$statusdir/loncron_simple.txt"); |
my $sfh=IO::File->new(">$statusdir/loncron_simple.txt"); |
foreach (keys %simplestatus) { |
if (defined($sfh)) { |
print $sfh $_.'='.$simplestatus{$_}.'&'; |
foreach my $key (keys(%simplestatus)) { |
|
print $sfh $key.'='.$simplestatus{$key}.'&'; |
|
} |
|
print $sfh "\n"; |
|
$sfh->close(); |
} |
} |
print $sfh "\n"; |
|
$sfh->close(); |
|
} |
} |
|
|
sub write_loncaparevs { |
sub write_loncaparevs { |
Line 1028 sub write_loncaparevs {
|
Line 1030 sub write_loncaparevs {
|
} |
} |
} |
} |
if ($output) { |
if ($output) { |
if (open(my $fh,">$perlvar{'lonTabDir'}/loncaparevs.tab")) { |
if (open(my $fh,'>',"$perlvar{'lonTabDir'}/loncaparevs.tab")) { |
print $fh $output; |
print $fh $output; |
close($fh); |
close($fh); |
&Apache::lonnet::load_loncaparevs(); |
&Apache::lonnet::load_loncaparevs(); |
|
} else { |
|
print "Could not write to $perlvar{'lonTabDir'}/loncaparevs.tab\n"; |
} |
} |
} |
} |
return; |
return; |
Line 1064 sub write_serverhomeIDs {
|
Line 1068 sub write_serverhomeIDs {
|
} |
} |
} |
} |
if ($output) { |
if ($output) { |
if (open(my $fh,">$perlvar{'lonTabDir'}/serverhomeIDs.tab")) { |
if (open(my $fh,'>',"$perlvar{'lonTabDir'}/serverhomeIDs.tab")) { |
print $fh $output; |
print $fh $output; |
close($fh); |
close($fh); |
&Apache::lonnet::load_serverhomeIDs(); |
&Apache::lonnet::load_serverhomeIDs(); |
|
} else { |
|
print "Could not write to $perlvar{'lonTabDir'}/serverhomeIDs.tab\n"; |
} |
} |
} |
} |
return; |
return; |
Line 1128 sub write_hostips {
|
Line 1134 sub write_hostips {
|
} |
} |
close($fh); |
close($fh); |
chmod(0644,$newfile); |
chmod(0644,$newfile); |
|
} else { |
|
print "Could not write to $lontabdir/currhostips.tab\n"; |
} |
} |
} |
} |
if (keys(%prevhosts) && keys(%currhosts)) { |
if (keys(%prevhosts) && keys(%currhosts)) { |
Line 1153 sub write_hostips {
|
Line 1161 sub write_hostips {
|
} |
} |
print $fh "\n*******************\n\n"; |
print $fh "\n*******************\n\n"; |
close($fh); |
close($fh); |
|
} else { |
|
print "Could not write to $perlvar{'lonDaemons'}/logs/hostip.log\n"; |
} |
} |
my $emailto = &Apache::loncommon::build_recipient_list(undef, |
my $emailto = &Apache::loncommon::build_recipient_list(undef, |
'hostipmail',$defdom); |
'hostipmail',$defdom); |
Line 1256 sub write_connection_config {
|
Line 1266 sub write_connection_config {
|
} |
} |
close($fh); |
close($fh); |
print "Completed writing SSL options for lonc/lond for $count items.\n"; |
print "Completed writing SSL options for lonc/lond for $count items.\n"; |
|
} else { |
|
print "Could not write to $perlvar{'lonTabDir'}/connectionrules.tab\n"; |
} |
} |
} else { |
} else { |
print "Writing of SSL options skipped - no connection rules in domain configuration.\n"; |
print "Writing of SSL options skipped - no connection rules in domain configuration.\n"; |
Line 1361 sub write_hosttypes {
|
Line 1373 sub write_hosttypes {
|
} |
} |
close($fh); |
close($fh); |
print "Completed writing host type data for $count hosts.\n"; |
print "Completed writing host type data for $count hosts.\n"; |
|
} else { |
|
print "Could not write to $perlvar{'lonTabDir'}/hosttypes.tab\n"; |
} |
} |
} else { |
} else { |
print "Writing of host types skipped - no hosts found.\n"; |
print "Writing of host types skipped - no hosts found.\n"; |
Line 1666 sub send_mail {
|
Line 1680 sub send_mail {
|
"Subject: ".$subj."\n". |
"Subject: ".$subj."\n". |
"Content-type: text/html\; charset=UTF-8\n". |
"Content-type: text/html\; charset=UTF-8\n". |
"MIME-Version: 1.0\n\n"; |
"MIME-Version: 1.0\n\n"; |
if (open(my $fh,"<$statusdir/index.html")) { |
if (open(my $fh,'<',$statusdir/index.html")) { |
while (<$fh>) { |
while (<$fh>) { |
$loncronmail .= $_; |
$loncronmail .= $_; |
} |
} |
Line 1782 sub main () {
|
Line 1796 sub main () {
|
my $now = time; |
my $now = time; |
my $tmpfile = $perlvar{'lonDaemons'}.'/tmp/lciptables_iphost_'. |
my $tmpfile = $perlvar{'lonDaemons'}.'/tmp/lciptables_iphost_'. |
$now.$$.int(rand(10000)); |
$now.$$.int(rand(10000)); |
if (open(my $fh,">$tmpfile")) { |
if (open(my $fh,'>',"$tmpfile")) { |
my %iphosts = &Apache::lonnet::get_iphost(); |
my %iphosts = &Apache::lonnet::get_iphost(); |
foreach my $key (keys(%iphosts)) { |
foreach my $key (keys(%iphosts)) { |
print $fh "$key\n"; |
print $fh "$key\n"; |