Fix for OpenBSD 6.2

758d4ba9a7 (diff-d3ca8881345ccaf84b784637f5244eac)
changes the way vmstat prints free memory
This commit is contained in:
Daniel Jakots 2017-11-08 11:45:00 -05:00
parent 4d007c8eb0
commit 019ce03e3a
1 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,7 @@ __EOT
# Total memory size (in MB) # Total memory size (in MB)
tot_mem=$(( `/sbin/sysctl -n hw.physmem` / BYTES_IN_MB)) tot_mem=$(( `/sbin/sysctl -n hw.physmem` / BYTES_IN_MB))
# Free memory size (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 memory size (in percentage)
free_mem_perc=$(( free_mem * 100 / tot_mem )) free_mem_perc=$(( free_mem * 100 / tot_mem ))