banshee/linux-collection/linux/ssh/
swap
Swap of a Linux by SSH: size, usage, and pages swapped in and out per second.
par banshee1 installation2 versions
v2Dernière
Publiée le 28 octobre 2026. One naming convention across collections; documentation completed.
Swap of a Linux, by SSH
Returns the size of the swap, what it holds, and the pages read back from it and written to it per second. Pages read back again and again say the memory is too small, far better than used swap, where the kernel readily stores pages nobody needs any more.
Versions
Generic: /proc/meminfo and /proc/vmstat are written by the kernel the same way on Alpine, Debian and Fedora.
How it works
The collector runs cat /proc/meminfo /proc/vmstat and reads SwapTotal and SwapFree (in KiB) and the counters pswpin and pswpout (pages since boot).
- The pages per second come from the counters over the interval between two runs: the first run is skipped, as is a run where a counter went backwards.
- Nothing is written on the target.
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
| Name | Label | Unit | Per instance |
|---|---|---|---|
total | Swap size | MiB | no |
used | Used swap | MiB | no |
used-percent | Used swap | % | no |
swap-in | Pages read back from swap | pages/s | no |
swap-out | Pages written to swap | pages/s | no |
Watches
| Name | Title | Kind | Defaults | Checked by default |
|---|---|---|---|---|
swap-high | Swap saturated | above a threshold, on used-percent | warning above 80 %, critical above 95 %, for 3 runs | yes |
swapping | Sustained swapping | above a threshold, on swap-in | warning above 100 pages/s, for 5 min; no critical | yes |
Limits
- A machine without swap (
SwapTotalat 0) stops the collectormisconfigured: the probe has nothing to measure, and says so rather than show green. - A page is 4 KiB on most machines, 16 or 64 KiB on some ARM systems:
swap-inandswap-outcount pages, not bytes.