Install collectd statistics collecter on CentOS, RHEL, Ubuntu, Debian

Overview

collectd is a daemon which collects system performance statistics periodically and provides mechanisms to store the values in a variety of ways, for example in RRD files.

collectd gathers statistics about the system it is running on and stores this information. Those statistics can then be used to find current performance bottlenecks (i.e. performance analysis) and predict future system load (i.e. capacity planning). Source collectd.org

Note: Depending on the parameters you wish to monitor there may be some additional packages that needs to be installed. For a detailed list of all the parameter dependent packages read the README file under the collectd installer directory.

Download collectd latest tarball, at the time of writing the latest stable build is collectd-5.2.0. Untar it and run configure, make and make install.

Open the collectd configuration file and make sure all basic plugins get loaded. You may see LoadPlugin directive followed by the parameter to monitor, it could have a # or ## sign in front. A single # means that the plugin is not active but is supported, just remove the # sign and it will start working. A double ## means that the plugin is not supported, this may be due to a missing package, in such senario just install the missing package and compile collectd again. You may refer the README file provided in the collectd installer directory to find what packages are required for a parameter to work.

# vi /etc/collectd.conf

Enable basic plugins

LoadPlugin network
LoadPlugin cpu
LoadPlugin memory

Also in a large environment you may consider creating a centralized collectd server and all clients sending data to collectd which then saves it to rrdtool. For clients to send data these additional plugins must be enabled on both client and server. Remove # sign in front of these plugins

Next hop over to the client and install collectd by following the process above. Once done enable the plugins you wish to monitor and the additional required onces to make it send data over the network.

On the server side you should now see a new directory named after the hostname of the client

# cd /var/lib/collectd/

So what we have for now is some data in rrd database but it is of no use unless we visualize this. There are some very nice tools available in market but I personally use Visage. If you are interested then below is a little screenshot of visage using collectd data.