Random Project

RAM free not used

Hi maybe I’m wrong but your script returns not the RAM used it returns the RAM free.

Your script queries two values:

$total_ram with OID .1.3.6.1.4.1.2021.4.5.0
$total_ram_free with OID .1.3.6.1.4.1.2021.4.6.0

but OID .1.3.6.1.4.1.2021.4.6.0 is not the used RAM on my linux boxes it’s the memAvailReal.0

I changed your script a bit and turned “$total_ram_used” to “$total_ram_free” and added a line before “$percentage_ram_used”:

$total_ram_used = $total_ram – $total_ram_free;

cheers chris