Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We use WhatsUp Gold to monitor all of our web servers. On our Linux servers (and much to the same degree, our FreeBSD servers) I'm having a little bit of an issue with the memory monitors. We're using SNMP with WUG to grab the data from the servers. The memory counter that the SNMP daemon returns on the servers is the combined value (used, cached, buffers). Right now one of my servers looks like this:

[admin@stgwww snmp]$ free -m
             total       used       free     shared    buffers     cached 
Mem:          7872       1656       6216          0        143      1107
-/+ buffers/cache:        404       7467 
Swap:         4867          0       4867

The Value being returned via SNMP to WUG is 1656. From what I understand, the cached RAM is essentially FREE RAM with the added benefit of hanging on to data that previously occupied it in case it's needed again. So for our purposes of wanting to know how much RAM is actually being actively used, the value we're getting back is misleading. If we go off of what's being graphed by WUG, we're being led to believe that more RAM is being used and less is available than there really is.

So whats that best way to go about monitoring this? WUG allows me to write SSH scripts, which can SSH into the server every 5 minutes or so, execute a script and return the value (as long as it's a single numeric value). With this I've written a script that pulls the "404" number from the example above and divides it by the total amount giving me a percent used value which I return to WUG and graph on a chart that scales from 0 to 100. But this seems like way to much of a hack.

Am I better off monitoring the free+buffers+cached value? Is there a better way to do this in WUG? Thoughts?

share|improve this question
    
Yes, 404/7872*100 is what I'd call the correct number for memory usage. Terminology will really get you with memory, so make sure everyone knows what your number actually means. –  pboin Dec 27 '11 at 18:01
add comment

3 Answers

up vote 4 down vote accepted

Go and take a look at linuxatemyram.com. WUG is telling you what Linux thinks is used (used+buffers+cache). What you have decided to monitor (used/total) seems reasonable to me especially for a graph as it requires no knowledge of the system specifics.

share|improve this answer
    
Looks like I'll stick to the custom script idea. I looked through the MIB to see all the values being passed over and it only has Used+buffers+cache, Virtual, Buffers, Cached, and Swap. I was hoping that WUG would allow me to do some math, with the data, but it won't. It just seems that creating an SSH connection and destroying it every minute to run a script is so inefficient. Plus I'm only polling every 60 seconds. –  Safado Dec 27 '11 at 20:20
add comment

Free ram is free ram and buffers are cached ram which can be reclaimed. Most of the monitoring tools I've used present this difference in an accumulative area graph which presents at least used, cached and inactive memory stacked under the 100% level and swap over these. The only way to have a correct knowledge of how server is performing is to view all of them.

If you only can graph a value I'll recomend to you graph the used memory, and consider 'free' the rest. Oh and i will recomend also switch monitoring tools. Even munin with the default config has a decent memory graph.

share|improve this answer
add comment

I recommend ganglia: http://ganglia.sourceforge.net/

It does memory monitoring and divides it into constituent parts. There is almost zero configuration. You install a daemon on each linux box and then designate one central box to record the RRDs.

Here's an example memory graph:

Graph 1

share|improve this answer
    
We also monitor the server through Munin, which appears to be the exact same as ganglia, but it doesn't give us quite the capability we're after. It does, however, provide us Apache and MySQL monitors that WUG doesn't. –  Safado Dec 27 '11 at 20:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.