Skip to main content
CentOSLPIC-2 Exam 201

Graphing your system performance in Linux with collectd

By May 25, 2014September 12th, 2022No Comments

LPIC-2-201Performance monitoring is new to LPIC2 as from November 2013. The objective 200.2 will expects you to have some knowledge of base-lining the performance of your Linux hosts and being able to see the impacts that added load has to the performance. This we we can effectively predict future resource needs and capacity burnout. Even though sysstat does allow you to collect data over time it really does not have the capability of producing graphs making visual recognition of issues easier. This is where collectd can fit in. It too collects data over time trho9ugh its own daemon service but it has many different plugins to write data. This includes writing to RRD files ( Round-Robin Database), with other plugins graphs can be produced from these files.

To installed collectd on CentOS 6.5 we first need to enable the EPEL repository. The rpm can be downloaded from EPEL to create the correct repo file. This is the link for 64Bit CentOS 6:

wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm

With this setup we have a few packages to add. We will install the Apache HTTPD server to enable a web interface to the PNG files produced by the RRDTOOL. In short will will be able to create simple graphs illustrating the performance.

LPIC2-200-2Collectd

With root privileges we can installed all that we need with:

yum install -y collectd collectd-rrdtool rrdtool collectd-web httpd

We can let the cook away for a little then we can look at the configuration.

  • Ensure that the hostname of your Linux device is resolbale either with DNS or the local /etc/hosts file
  • Configure the BaseDiR to be /var/lib/collectd in /etc/collectd.conf
  • Un-comment the configuration of the rrdtool Plugin in /etc/collectd.conf and set DataDir to /var/lib/collectd/rrd

collectdconf

  • Copy the data from collections3 to the DocumentRoot of httpd:
    rsync -arv /usr/share/collectd/collection3/ /var/www.html
  • configure services
    chkconfig httpd on
    chkconfig collectd on
  • Start services
    service httpd start
    service collectd start
  • browse to to the local host: http://127.0.0.1/collectd/