Linux
banshee/linux-collection/linux/snmp/
swap
Swap of a Linux host by SNMP: size, used and free.
par banshee1 installation2 versions
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.
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 |
|---|---|---|
total | Swap | MiB |
used | Used swap | MiB |
free | Free swap | MiB |
used-percent | Used swap | % |
Watches
| Watch | Kind | Defaults | Checked |
|---|---|---|---|
| Swap saturated | Above a threshold, on used-percent | warning 80 %, critical 95 %, for 3 runs | yes |
| Low free swap | Below a threshold, on free | critical 512 MiB | 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.