collectd(8)
collectd is a daemon that collects system and application performance metrics and can store or forward them to various backends.
Synopsis
collectd [OPTION]...Description
collectd is a small daemon which collects system and application performance metrics periodically and provides mechanisms to store the values in a variety of ways, for example in RRD files, external SQL databases, or send them over the network to other instances of collectd. Since the daemon doesn't need to startup every time it wants to update the values it's very fast and easy on the system. Also, the RRD files are updated only once in a configurable interval, so reducing I/O operations.
collectd features a modular design with plugins for data collection (e.g., CPU, memory, disk I/O, network traffic), data processing, and output backends (RRD, Graphite, InfluxDB, Prometheus). Configuration is done through a single config file where you specify which plugins to load and their parameters.
Common options
| Flag | What it does |
|---|---|
-C | Specify an alternative configuration file; default is /etc/collectd/collectd.conf |
-P | Specify an alternative PID file; default is /var/run/collectd.pid |
-f | Run in foreground mode instead of daemonizing; useful for debugging and running under process supervisors |
-h | Print help text and exit |
-T | Test the configuration file and exit; does not start the daemon |
-v | Increase verbosity; can be used multiple times to further increase logging output |
Examples
Start collectd using the default (or specified) configuration file
collectd -C /etc/collectd/collectd.confTest the configuration file for syntax errors without starting the daemon
collectd -T -C /etc/collectd/collectd.confRun collectd in foreground mode with verbose logging, useful for debugging configuration
collectd -f -v -C /etc/collectd/collectd.confStart collectd as a system service (typical usage on systemd systems)
systemctl start collectdStart collectd with a custom PID file location
collectd -P /var/run/collectd.pidCheck if collectd daemon is running
ps aux | grep collectdMonitor collectd log file in real-time for metrics and errors
tail -f /var/log/collectd.log