1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-11 05:17:41 +03:00

Getting more accurate free memory from physical hosts. Fixed ticket #62

git-svn-id: http://svn.opennebula.org/one/trunk@300 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
Constantino Vázquez Blanco 2009-01-09 14:38:42 +00:00
parent 8044615406
commit 78bdb978bb

View File

@ -32,8 +32,6 @@ top_text.split(/\n/).each{|line|
temp = elemento.strip.split("k ")
if temp[1] == "used"
$used_memory = temp[0]
elsif temp[1] == "free"
$free_memory = temp[0]
end
}
@ -51,6 +49,8 @@ top_text.split(/\n/).each{|line|
end
}
$free_memory=`free -k|grep "buffers\/cache"|awk '{print $4}'`
net_text=`cat /proc/net/dev`
net_text.split(/\n/).each{|line|