[CentOS] centos 5.5 check memoray usage too high???

Thu Feb 3 04:41:17 UTC 2011
Cameron Kerr <cameron at humbledown.org>

On 03/02/11 10:58, mcclnx mcc wrote:
> We have DELL R900 server with 128GB RAM (CENTOS 5.5)in it.  This server only have one application running and few people use it.
> 
> Every week I ata least get one or two messages from monitor tool mail to me say:
> 
> Message=Memory Utilization is 92.02%, crossed warning (80) or critical (90) threshold. 

As previously mentioned, Linux operates on a "memory full" model, so
caches and buffers need to accounted for.

Is this monitor tool getting its data via SNMP? If so, you should be
able to get the real amount of memory available using the formula

  memAvailReal + memBuffer + memCache

  (all of these can be found under UCD-SNMP-MIB::memory if you are using
the NetSNMP agent.)

$ snmpget -c public localhost UCD-SNMP-MIB::memCached.0
UCD-SNMP-MIB::memCached.0 = INTEGER: 169280 kB

$ snmpget -c public localhost UCD-SNMP-MIB::memBuffer.0
UCD-SNMP-MIB::memBuffer.0 = INTEGER: 123400 kB

$ snmpget -c public localhost UCD-SNMP-MIB::memAvailReal.0
UCD-SNMP-MIB::memAvailReal.0 = INTEGER: 26904 kB

$ free -tk
             total       used       free     shared    buffers     cached
Mem:        514512     487244      27268          0     123444     169344
-/+ buffers/cache:     194456     320056
Swap:       979956        676     979280
Total:     1494468     487920    1006548

Brief check:
26904 + 123400 + 169280 == 319584, which is near enough to 320056 (given
that I ran the commands above with a bit of a pause in between)

However, as a practical aside, looking at the "amount of memory used" is
not particularly useful for determining if a host has too little. If
that is what is wanted, it would be better to monitor the number of
pages swapped in/out. (ie. what the 'vmstat' tool reports). If
monitoring using SNMP, and the NetSNMP agent is being used, you can get
this in the UCD-SNMP-MIB::ssSwapIn and ssSwapOut variables, which report
amount of memory swapped in/out in the last minute (in SNMP terms, this
is a gauge), or ssRawSwapIn and ssRawSwapOut if you want pages instead
(which is a counter, and thus more useful).

Hope it helps,
Cameron