Browse Source

Updated RAM usage to work with changes to free command

pull/1936/head
Daniel Gibbs 7 years ago
parent
commit
7dc37b5e4d
  1. 3
      lgsm/functions/info_distro.sh
  2. 4
      lgsm/functions/info_messages.sh

3
lgsm/functions/info_distro.sh

@ -77,9 +77,10 @@ physmemtotal=$(free ${humanreadable} | awk '/Mem:/ {print $2}')
physmemtotalmb=$(free -m | awk '/Mem:/ {print $2}') physmemtotalmb=$(free -m | awk '/Mem:/ {print $2}')
physmemused=$(free ${humanreadable} | awk '/Mem:/ {print $3}') physmemused=$(free ${humanreadable} | awk '/Mem:/ {print $3}')
physmemfree=$(free ${humanreadable} | awk '/Mem:/ {print $4}') physmemfree=$(free ${humanreadable} | awk '/Mem:/ {print $4}')
physmemavailable=$(free ${humanreadable} | awk '/Mem:/ {print $7}')
physmemcached=$(free ${humanreadable} | awk '/cache:/ {print $4}') physmemcached=$(free ${humanreadable} | awk '/cache:/ {print $4}')
if [ -z "${physmemcached}" ]; then if [ -z "${physmemcached}" ]; then
physmemcached=$(free ${humanreadable} | awk '/Mem:/ {print $5}') physmemcached=$(free ${humanreadable} | awk '/Mem:/ {print $6}')
fi fi
swaptotal=$(free ${humanreadable} | awk '/Swap:/ {print $2}') swaptotal=$(free ${humanreadable} | awk '/Swap:/ {print $2}')
swapused=$(free ${humanreadable} | awk '/Swap:/ {print $3}') swapused=$(free ${humanreadable} | awk '/Swap:/ {print $3}')

4
lgsm/functions/info_messages.sh

@ -71,8 +71,8 @@ fn_info_message_performance(){
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
{ {
echo -e "${blue}Mem:\t${blue}total\t used\t free\t cached${default}" echo -e "${blue}Mem:\t${blue}total\t used\t free\t cached\t available${default}"
echo -e "${blue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}${default}" echo -e "${blue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}\t${physmemavailable}${default}"
echo -e "${blue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}" echo -e "${blue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}"
} | column -s $'\t' -t } | column -s $'\t' -t
} }

Loading…
Cancel
Save