Linux
banshee/linux-collection/linux/ssh/
memory
Memory of a Linux by SSH: total, used and available as the kernel counts it (MemAvailable).
par banshee1 installation2 versions
Memory of a Linux, by SSH
Returns the physical memory, the memory available as the kernel counts it, the used memory and its share. Swap is the linux/ssh/swap collector.
How it works
The collector runs cat /proc/meminfo and reads MemTotal and MemAvailable.
MemAvailableis the kernel's estimate of what can be given to a program without swapping: free memory plus the caches and buffers that can be dropped. Used memory isMemTotal − MemAvailable: caches do not count as used.- Portable:
/proc/meminfois written by the kernel the same way on Alpine, Debian and Fedora. Nothing is written on the target. - A kernel older than 3.14, without
MemAvailable, stops the collectormisconfiguredrather than guess.
Prerequisites
- an SSH account for monitoring, without write rights;
- the fingerprint of the server's host key, set in
protocol:ssh:fingerprint(not needed when the Security settings trust the first SSH fingerprint presented).
Outputs
| Output | Unit | Meaning |
|---|---|---|
total | MiB | physical memory |
used | MiB | memory in use, caches excluded |
available | MiB | memory available to programs |
used-percent | % | share of memory in use |
Watches
| Watch | Kind | Defaults | Checked |
|---|---|---|---|
used-percent Memory saturated | above, on used-percent | warning 90, critical 95, for 3 runs | yes |
available Little memory available | below, on available | critical 512 | no |
Limits
- In a container without lxcfs,
/proc/meminfoshows the host's memory, not the container's limit.