rcbops / alamo-builder

3 stars 10 forks source link

status.rb should report free memory as free+buffers+cache #9

Open breu opened 12 years ago

breu commented 12 years ago

status.rb currently shows free memory as just 'free' and not the allocatable memory free+buffers+cache

root@controller:~# free
             total       used       free     shared    buffers     cached
Mem:       4049804    3917140     132664          0      94708    2108096
-/+ buffers/cache:    1714336    2335468
Swap:      4192252       4020    4188232
andrewsben commented 12 years ago

@memfree = cat /proc/meminfo | grep "MemFree" | awk '{ print $2 }'.chomp.to_i + free | grep -v total | grep buffers | tr -s ' ' | cut -d ' ' -f4.chomp.to_i

That should work I do believe. Or does memfree have to be a string?

andrewsben commented 12 years ago

damn github killed my backticks