Skip to content

swap plugin

Plugin name swap
Type read
Callbacks init, read
Status supported
Since 2.1
Copyright 2005–2009 Florian octo Forster, 2009 Stefan Völkel, 2009 Manuel Sanmartin
License GPLv2
Configuration collectd.conf(5)

The Swap plugin collects the amount of memory currently written onto hard disk or whatever the system calls “swap”.

Example graph

Plugin-swap.png

Dependencies

  • Linux
    • /proc-file system
  • Solaris
    • swapctl(2) (Solaris version)
  • OpenBSD (possibly other *BSDs, too)
    • swapctl(2) (BSD version)
  • Mac OS X
    • sysctl(3) and VM_SWAPUSAGE
  • FreeBSD
    • kvm_getswapinfo(3)
  • AIX
    • libperfstat(3)
  • Other

Configuration

Configuration options · from collectd.conf(5)

See this section in the full configuration reference

The Swap plugin collects information about used and available swap space. On Linux and Solaris, the following options are available:

ReportByDevice false|true

Configures how to report physical swap devices. If set to false (the default), the summary over all swap devices is reported only, i.e. the globally used and available space over all devices. If true is configured, the used and available space of each device will be reported separately.

This option is only available if the Swap plugin can read /proc/swaps (under Linux) or use the swapctl(2) mechanism (under Solaris).

ReportBytes false|true
When enabled, the swap I/O is reported in bytes. When disabled, the default, swap I/O is reported in pages. This option is available under Linux only.
ValuesAbsolute true|false
Enables or disables reporting of absolute swap metrics, i.e. number of bytes available and used. Defaults to true.
ValuesPercentage false|true

Enables or disables reporting of relative swap metrics, i.e. percent available and free. Defaults to false.

This is useful for deploying collectd in a heterogeneous environment, where swap sizes differ and you want to specify generic thresholds or similar.

ReportIO true|false

Enables or disables reporting swap IO. Defaults to true.

This is useful for the cases when swap IO is not neccessary, is not available, or is not reliable.