Linux Memory Usage in kB instead of MB

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
cshepherd
Posts: 37
Joined: Thu Jan 05, 2006 10:21 pm
Location: Australia

Linux Memory Usage in kB instead of MB

Post by cshepherd »

I'm running cacti 0.8.6h and trying to graph Memory Usage for localhost which is a gentoo box.

All other graphs are working fine (traffic, load average, processes, users) and Memory Usage is displaying the correct numbers/1000

I ran the memory usage script which return the usage in kilobytes correctly so somewhere along the line it's dividing it by 1000 again?

I've only scratched the surface of cacti so far and haven't used rrdtool before so I'm not too sure where to look to correct this.

I've tried searching the forums to no avail.

Thanks
mbrashear
Posts: 4
Joined: Fri Jan 20, 2006 2:02 pm

Post by mbrashear »

If you are using the default cacti info I belive your numbers are correct. It will go up to MB when you have MB used by swap or MB free on your box. Can you send a quick "vmstat" showing your free memory and used swap?
cshepherd
Posts: 37
Joined: Thu Jan 05, 2006 10:21 pm
Location: Australia

Post by cshepherd »

The linux_memory script uses /proc/meminfo

For example SwapFree is currently 505976k if I cat /proc/meminfo
If I run linux_memory.pl SwapFree then it returns 505976 which Cacti is reading to mean 505.9k when it should be 505.9M

The numbers are correct so I just multiplied the output of the linux_memory script by 1000.

Let me know if there's a better solution as I'd rather keep the scripts stock.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests