\n";
# Host and login info
print " | $text{'right_host'} | \n";
print "",&get_system_hostname()," |
\n";
print " | $text{'right_os'} | \n";
if ($gconfig{'os_version'} eq '*') {
print "$gconfig{'real_os_type'} |
\n";
}
else {
print "$gconfig{'real_os_type'} $gconfig{'real_os_version'} | \n";
}
print " | $text{'right_webmin'} | \n";
print "",&get_webmin_version()," |
\n";
# System time
$tm = localtime(time());
print " | $text{'right_time'} | \n";
print "$tm |
\n";
# Load and memory info
if (&foreign_check("proc")) {
&foreign_require("proc", "proc-lib.pl");
if (defined(&proc::get_cpu_info)) {
@c = &proc::get_cpu_info();
if (@c) {
print " | $text{'right_cpu'} | \n";
print "",&text('right_load', @c)," |
\n";
}
}
if (defined(&proc::get_memory_info)) {
@m = &proc::get_memory_info();
if (@m && $m[0]) {
print " | $text{'right_real'} | \n";
print "",&nice_size($m[0]*1024)." total, ".
&nice_size(($m[0]-$m[1])*1024)." used |
\n";
print " | \n";
print "",&bar_chart($m[0], $m[0]-$m[1], 1),
" |
\n";
}
if (@m && $m[2]) {
print " | $text{'right_virt'} | \n";
print "",&nice_size($m[2]*1024)." total, ".
&nice_size(($m[2]-$m[3])*1024)." used |
\n";
print " | \n";
print "",&bar_chart($m[2], $m[2]-$m[3], 1),
" |
\n";
}
}
#@procs = &proc::list_processes();
#print " | $text{'right_procs'} | \n";
#print "",scalar(@procs)," |
\n";
}
# Disk space on local drives
if (&foreign_check("mount")) {
&foreign_require("mount", "mount-lib.pl");
@mounted = &mount::list_mounted();
$total = 0;
$free = 0;
foreach $m (@mounted) {
if ($m->[2] eq "ext2" || $m->[2] eq "ext3" ||
$m->[2] eq "reiserfs" || $m->[2] eq "ufs" ||
$m->[1] =~ /^\/dev\//) {
($t, $f) = &mount::disk_space($m->[2], $m->[0]);
$total += $t*1024;
$free += $f*1024;
}
}
if ($total) {
print " | $text{'right_disk'} | \n";
print "",&text('right_used',
&nice_size($total),
&nice_size($total-$free))," |
\n";
print " | \n";
print "",&bar_chart($total, $total-$free, 1),
" |
\n";
}
}
print "
\n";
# Check for incorrect OS
if (&foreign_available("webmin")) {
&foreign_require("webmin", "webmin-lib.pl");
%realos = &webmin::detect_operating_system(undef, 1);
if ($realos{'os_version'} ne $gconfig{'os_version'} ||
$realos{'os_type'} ne $gconfig{'os_type'}) {
print "\n";
# Host and login info
print " | $text{'right_host'} | \n";
print "",&get_system_hostname()," |
\n";
print " | $text{'right_os'} | \n";
if ($gconfig{'os_version'} eq '*') {
print "$gconfig{'real_os_type'} |
\n";
}
else {
print "$gconfig{'real_os_type'} $gconfig{'real_os_version'} | \n";
}
print " | $text{'right_usermin'} | \n";
print "",&get_webmin_version()," |
\n";
# System time
$tm = localtime(time());
print " | $text{'right_time'} | \n";
print "$tm |
\n";
# Disk quotas
if (&foreign_installed("quota")) {
&foreign_require("quota", "quota-lib.pl");
$n = "a::user_filesystems($remote_user);
$usage = 0;
$quota = 0;
for($i=0; $i<$n; $i++) {
if ($quota::filesys{$i,'hblocks'}) {
$quota += $quota::filesys{$i,'hblocks'};
$usage += $quota::filesys{$i,'ublocks'};
}
elsif ($quota::filesys{$i,'sblocks'}) {
$quota += $quota::filesys{$i,'sblocks'};
$usage += $quota::filesys{$i,'ublocks'};
}
}
if ($quota) {
$bsize = $quota::config{'block_size'};
print " | $text{'right_uquota'} | \n";
print "",&text('right_out',
&nice_size($usage*$bsize),
&nice_size($quota*$bsize))," |
\n";
print " | \n";
print "",&bar_chart($quota, $usage, 1),
" |
\n";
}
}
print "
\n";
}
print "