Linux
banshee/linux-collection/linux/snmp/
swap
Swap of a Linux host by SNMP: size, used and free.
par banshee1 installation2 versions
v2Dernière
Publiée le 28 octobre 2026. One naming convention across collections; documentation completed.
Swap of a Linux host, by SNMP
Returns the size of the swap, the swap used and free, and the share used. Two watches are offered, each adjustable on the probe.
Versions
Generic: the memory group of UCD-SNMP-MIB is served the same way by net-snmp on any Linux.
How it works
The collector reads memTotalSwap and memAvailSwap (the free swap), in KiB, from the memory group of UCD-SNMP-MIB.
- A machine without swap says so by a size of zero: the collector returns zero everywhere, a measurement and not a failure, and no watch raises.
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 | Per instance |
|---|---|---|---|
total | Swap size | MiB | no |
used | Used swap | MiB | no |
free | Free swap | MiB | no |
used-percent | Used swap | % | 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 |
free | Little free swap | below a threshold, on free | critical below 512 MiB; no warning | no |
Limits
- Swap in use is not swapping activity: a machine can hold idle pages in swap for weeks without harm. The rate of pages swapped in and out is not served by this MIB.
- These values are 31 bits wide in KiB: beyond 2 TiB of swap, the agent itself miscounts them.