Hi All --
Running Net-SNMP 5.4.1 on a wide range of Solaris and Linux boxes /w NPM 9.1 SP5 monitoring a range of params.
The problem is with the "Physical memory" monitoring.
Linux MemFree includes Cached memory. The cache is typically a filesystem cache where the kernel helpfully places recently read/written files for quick retrieval later.
The issue is on all our Linux boxes that over time [as more and more files are read], Physical memory usage always climbs to 99% [with the kernel helpfully not allocating to the cache about 6megs :)] See attachment. Its the same story for all recent Linux kernels.
This isn't a problem in so far as actual memory usage = MemTotal - Cached, however it basically renders default memory monitoring on NPM useless [and from reading many forum postings, I presume most people just turn it off].
The thing is I want to know/alert if real memory usage gets above say 80%, etc.
# cat /proc/meminfo
MemTotal: 3995632 kB
MemFree: 66236 kB
Buffers: 324112 kB
Cached: 2719860 kB
SwapCached: 68 kB
Active: 2466712 kB
Inactive: 1215628 kB
free -m
total used free shared buffers cached
Mem: 3901 3851 50 0 316 2669
-/+ buffers/cache: 865 3036
Swap: 12001 0 12001
HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: Physical memory
HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: Virtual memory
HOST-RESOURCES-MIB::hrStorageDescr.6 = STRING: Memory buffers
HOST-RESOURCES-MIB::hrStorageDescr.7 = STRING: Cached memory
HOST-RESOURCES-MIB::hrStorageDescr.8 = STRING: Shared memory
HOST-RESOURCES-MIB::hrStorageDescr.10 = STRING: Swap space
HOST-RESOURCES-MIB::hrStorageSize.1 = INTEGER: 3995632
HOST-RESOURCES-MIB::hrStorageSize.3 = INTEGER: 16285348
HOST-RESOURCES-MIB::hrStorageSize.6 = INTEGER: 324052
HOST-RESOURCES-MIB::hrStorageSize.7 = INTEGER: 2750756
HOST-RESOURCES-MIB::hrStorageSize.8 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageSize.10 = INTEGER: 12289716
The free shows both views, including and excluding the cache/buffers.
Essentially I would like to graph/monitor the (MemTotal - (MemFree-Buffers)), or in OID talk, (hrStorageSize.1 - hrStorageDescr.7)
So I spose to my question. Can I modify the query to do some maths, and remove the cache from the calculation that will monitor the Free Memory?
Cheers, Johhny.