This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.
Please visit our production wiki at https://wiki.gentoo.org
collectd
collectd is a daemon that regularly collects, transfers, and stores system information. It is typically used for collecting performance information and other system data like disk, memory, and network usage, and from many other sources using a number of plugins. Other software can then be used to read databases of collected information to plot it and analyze it.
Installation
First, determine which plugins you want on your system. The collectd wiki contains a list of plugins, or check the collectd man page. These plugins are specified as USE flags with a collectd_plugins_
prefix, though these can also be specified with a COLLECTD_PLUGINS
variable in /etc/portage/make.conf:
/etc/portage/make.conf
Define some plugins with COLLECTD_PLUGINSCOLLECTD_PLUGINS="load memory syslog"
Collectd requires a plugin to enable any sort of logging. Make sure you enable the syslog plugin and/or the logfile plugin.
To write data, you need to enable write plugins. The rrdtool plugin is a common plugin. Data can be written to other collectd daemons using the network plugin.
To install:
root #
emerge --ask app-admin/collectd
To start collectd on start-up:
root #
rc-update add collectd default
Configuration
With collectd and some plugins installed, enable them in the configuration file by uncommenting them, for instance, the syslog plugin:
/etc/collectd.conf
Enabling syslogLoadPlugin syslog <Plugin syslog> LogLevel info </Plugin>
rrdtool plugin
Default location for saving the rrd files by collectd is BaseDir but that will mix the rrdtool's files with other plugins. So redefine it.
/etc/collectd.conf
<Plugin rrdtool> DataDir "/var/lib/collectd/rrd" </Plugin>
Troubleshooting
Check the logs for errors after starting up to make sure everything is going smoothly.