LinuxCommandLibrary

collectd

Collect system performance metrics

TLDR

Test the configuration file and then exit

$ collectd -t
copy

Test plugin data collection functionality and then exit
$ collectd -T
copy

Start collectd
$ collectd
copy

Specify a custom configuration file location
$ collectd -C [path/to/file]
copy

Specify a custom PID file location
$ collectd -P [path/to/file]
copy

Don't fork into the background
$ collectd -f
copy

Display help and version
$ collectd -h
copy

SYNOPSIS

collectd [-C conffile] [-c conffile] [-t] [-T] [-D level] [-P pidfile] [-f] [-h]

PARAMETERS

-C conffile
    Load global symbols from conffile without loading plugins.

-c conffile
    Load main configuration from conffile.

-t
    Test and dump parsed configuration to stdout, then exit.

-T
    Dump plain-text configuration to stdout and exit (implies -t)

-D level
    Enable debugging to stderr; level 0-5 (5 most verbose).

-P pidfile
    Write process ID to specified pidfile.

-f
    Run in foreground; do not daemonize.

-h
    Print usage help and exit.

DESCRIPTION

collectd is an open-source daemon that periodically collects system and application performance statistics on Linux and other Unix-like systems.

It features a modular, plugin-based architecture allowing data collection from various sources such as CPU usage, memory consumption, disk I/O, network traffic, Apache/Nginx web server stats, PostgreSQL/MySQL databases, and many more via input plugins. Collected data is processed by filter plugins and written to storage or dispatched via output plugins to backends like RRD files, Graphite, InfluxDB, or log files.

Designed for scalability, it supports thousands of metrics per second with low resource usage. Ideal for monitoring servers, clusters, or cloud environments. Configuration is done via a single text file, typically /etc/collectd/collectd.conf, enabling fine-grained control over what to monitor and how to store data.

collectd is widely used in production for long-term metrics storage and alerting integration.

CAVEATS

Requires root privileges for many plugins; configuration file must be valid or daemon fails to start. High plugin load may increase CPU/memory usage. Not for real-time monitoring.

CONFIGURATION

Edit /etc/collectd/collectd.conf to enable plugins like <Plugin cpu> or <Plugin network> for sending data.

PLUGINS

Over 100 input/output plugins available; list with collectd -h or online docs. Examples: cpu, memory, disk, interface, apache.

HISTORY

Developed by Florian Forster starting in 2005 as a lightweight alternative to heavier monitoring tools. Initial release focused on RRD storage. Evolved with plugin ecosystem; version 5.0 (2010) introduced major rewrite for better performance. Now at version 5.12+, actively maintained with contributions from many developers.

SEE ALSO

collectdmon(1), collectdctl(1), rrdcached(1)

Copied to clipboard