ssh esxi
run below command:
vsish -e get /memory/comprehensive | sed 's/:/ /' | awk '
/Phys/ { phys = $(NF-1); units = $NF; width = length(phys) }
/Free/ { free = $(NF-1) }
END { print width, units, phys, phys-free, free }' |
while read width units phys used free; do
printf "Phys %*d %s\n" $width $phys $units
printf "Used %*d %s\n" $width $used $units
printf "Free %*d %s\n" $width $free $units
done
output will be like:
Phys 217940540 KB Used 36864312 KB Free 181076228 KB