Linux
banshee/linux-collection/linux/snmp/
memory
Physical memory of a Linux host by SNMP, buffers and cache counted as available.
by banshee1 installation2 versions
Memory of a Linux host, by SNMP
Returns the physical memory, the memory used and available, the buffers and cache, and the share used. Two watches are offered, each adjustable on the probe. Swap is the linux/snmp/swap collector.
How it works
The collector reads the memory group of UCD-SNMP-MIB: memTotalReal, memAvailReal (the free memory), memBuffer, memCached and, when the agent serves it, memSysAvail, in KiB.
- Available memory is the kernel's own estimate,
MemAvailable, which net-snmp 5.9 and later serve asmemSysAvail; thesourceoutput then readsmemavailable. - An older agent does not serve it: available memory is then free memory plus buffers and cache, which the kernel gives back as soon as an application asks, and
sourcereadsfree-buffers-cache. Either way, a machine whose cache fills its memory is not saturated. - Used memory is the total minus the available memory.
- A total of zero stops the collector as misconfigured: it never shows green on nothing.
Prerequisites
snmpd(net-snmp) running on the host, listening on an address the poller reaches (UDP 161), with the firewall open to the poller only.- The view granted to the poller includes the
memorygroup of UCD-SNMP-MIB (.1.3.6.1.4.1.2021.4). - Read-only access, SNMPv2c or SNMPv3, set on the host or one of its folders (
protocol:snmp:*variables).
# /etc/snmp/snmpd.conf
agentaddress udp:161
view banshee included .1.3.6.1.4.1.2021.4
rocommunity <community> 192.0.2.10 -V banshee
# or: rouser <user> priv -V banshee Outputs
| Name | Label | Unit |
|---|---|---|
total | Physical memory | MiB |
used | Used memory | MiB |
available | Available memory | MiB |
cache | Buffers and cache | MiB |
used-percent | Used memory | % |
source | Source of available memory: memavailable or free-buffers-cache |
Watches
| Watch | Kind | Defaults | Checked |
|---|---|---|---|
| Memory saturated | Above a threshold, on used-percent | warning 90 %, critical 95 %, for 3 runs | yes |
| Low available memory | Below a threshold, on available | critical 512 MiB | no |
Limits
- With the fallback (
free-buffers-cache), the part of the cache the kernel cannot give back (shared memory,tmpfs) counts as available: on a machine with a largetmpfs, available memory is overestimated.MemAvailablediscounts it. - Total, free, buffers and cache are 31 bits wide in KiB: beyond 2 TiB of memory, the agent itself miscounts them.