$physical_memory for Proxmox VE

This commit is contained in:
josedacosta 2014-04-23 03:13:25 +02:00
parent d9eef7d752
commit 3ebb62876f
2 changed files with 1130 additions and 0 deletions

View file

@ -217,6 +217,9 @@ sub os_setup {
} else { } else {
if ($os =~ /Linux/) { if ($os =~ /Linux/) {
$physical_memory = `free -b | grep Mem | awk '{print \$2}'` or memerror; $physical_memory = `free -b | grep Mem | awk '{print \$2}'` or memerror;
if ($physical_memory == 0) {
$physical_memory = `echo \$(( \`cat /proc/meminfo | grep 'MemTotal' | awk '{print \$2}'\` * 1024 ))` or memerror;
}
$swap_memory = `free -b | grep Swap | awk '{print \$2}'` or memerror; $swap_memory = `free -b | grep Swap | awk '{print \$2}'` or memerror;
} elsif ($os =~ /Darwin/) { } elsif ($os =~ /Darwin/) {
$physical_memory = `sysctl -n hw.memsize` or memerror; $physical_memory = `sysctl -n hw.memsize` or memerror;

1127
top.txt Normal file

File diff suppressed because it is too large Load diff