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 committed 2009-01-09 14:38:42 +00:00
1 parent 8044615406
commit 78bdb978bb
1 file changed
+2 -2
+2 -2
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
}
@@ -50,6 +48,8 @@ top_text.split(/\n/).each{|line|
}
end
}
$free_memory=`free -k|grep "buffers\/cache"|awk '{print $4}'`
net_text=`cat /proc/net/dev`