Fix for OpenBSD 6.2
758d4ba9a7 (diff-d3ca8881345ccaf84b784637f5244eac)
changes the way vmstat prints free memory
This commit is contained in:
parent
4d007c8eb0
commit
019ce03e3a
|
@ -64,7 +64,7 @@ __EOT
|
|||
# Total memory size (in MB)
|
||||
tot_mem=$(( `/sbin/sysctl -n hw.physmem` / BYTES_IN_MB))
|
||||
# Free memory size (in MB)
|
||||
free_mem=$(( `/usr/bin/vmstat | /usr/bin/tail -1 | /usr/bin/awk '{ print $5 }'` / KB_IN_MB ))
|
||||
free_mem=$(/usr/bin/vmstat | /usr/bin/tail -1 | /usr/bin/awk '{ print $4 }' | tr -d 'M')
|
||||
# Free memory size (in percentage)
|
||||
free_mem_perc=$(( free_mem * 100 / tot_mem ))
|
||||
|
||||
|
|
Loading…
Reference in New Issue