mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
Added memory function for Solaris
This commit is contained in:
@@ -10,3 +10,5 @@ When running a command, you can now select which Unix user it will be run as.
|
||||
The CPU type and speed is displayed on the processed by CPU usage page, on Linux systems.
|
||||
---- Changes since 1.330 ----
|
||||
On Virtuozzo systems, the free and used memory shown is determined by the VMs limits.
|
||||
---- Changes since 1.340 ----
|
||||
Free and used real and virtual memory is now displayed on Solaris.
|
||||
|
||||
@@ -246,6 +246,27 @@ else {
|
||||
}
|
||||
}
|
||||
|
||||
# get_memory_info()
|
||||
# Returns a list containing the real mem, free real mem, swap and free swap
|
||||
# (In kilobytes).
|
||||
sub get_memory_info
|
||||
{
|
||||
if (!&has_command("kstat")) {
|
||||
return ( );
|
||||
}
|
||||
local %stat;
|
||||
foreach my $s ("physmem", "freemem", "swap_alloc", "swap_avail") {
|
||||
local $out = &backquote_command("kstat -p -m unix -s $s");
|
||||
if ($out =~ /\s+(\d+)/) {
|
||||
$stat{$s} = $1;
|
||||
}
|
||||
}
|
||||
return ($stat{'physmem'}*8, $stat{'freemem'}*8,
|
||||
$stat{'swap_alloc'}/1024, $stat{'swap_avail'}/1024);
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach $ia (keys %text) {
|
||||
if ($ia =~ /^sysv(_\S+)/) {
|
||||
$info_arg_map{$1} = $text{$ia};
|
||||
|
||||
Reference in New Issue
Block a user