Collectl is a light-weight performance monitoring tool capable of reporting interactively as well as logging to disk. It reports statistics on CPU, disk, infiniband, lustre, memory, network, nfs, process, quadrics, slabs and more in easy to read format. Unlike most monitoring tools that either focus on a small set of statistics, format their output in only one way, run either interactively or as a daemon but not both, collectl can monitor different parameters at the same time and report them in a suitable manner.
This guide will show you how to install and use collectl on CentOS.
How to Install Collectl
You can always download the latest version from the Collectl webpage or using wget.
# wget http://sourceforge.net/projects/collectl/files/collectl/collectl-3.7.3/collectl-3.7.3.src.tar.gz
Next you will have to untar the file and install using the INSTALL script provided:
# tar -xvzf collectl-3.7.3.src.tar.gz
# cd collectl-3.7.3
The service collectl can manage using /etc/init.d/collectl script.
Different types of system resources that can be measured are called subsystems. Like cpu, memory, network bandwidth and so on. If you just run the command without any parameters, it will show the cpu, disk and network subsystems in a batch mode output.
Using the tool without any option will give the following output:
These are the brief categories that can be measured using the -s flag:
Monitor CPU usage
You can use the c option to get a summary of CPU usage like this:
# collectl -sc
You can monitor each cpu individually using the C option like this:
# collectl -sC
Monitor Memory usage
The m option will give you the summary for memory usage:
# collectl -sm
Using the M option you will get even more details like memory node data, which is also known as numa data:
# collectl -sM
Monitor Disk usage
To see disk usage we will use the d option:
# collectl -sd
The D option will show you even more details about the Disk usage.
# collectl -sD
You can also monitor all these resources together and get a mixed report like this:
# collectl -scmd
To display the time in each line along with the measurements, use the T option. And over that, to specify options, you need to use the "-o" switch.
# collectl -scmd -oT
To use collectl as “top” command.
# collectl --top
This tool functionality can be extended by using the collectl-utilities. You can find it on the collect-utils webpage. Part of these utilities is Colplot, a simple and easy tool to present its output in a web page.
You can use the noarch (collectl-utils-4.7.1-1.noarch.rpm) RPM from the collectl-utilities URL or you can install it easily from source. Before that, be sure that you have Apache installed, as well as gnuplot (both can be installed using yum). Colplot rpm installation will install everything in the right place. After the installation restart apache service. If the installation is completed successfully, you can see a default page like this while accessing http://localhost/colplot (or a valid IP address of your server).
How to generate plots
First of all, make sure collectl service is running by using “/etc/init.d/collectl status”, then create plots using “collectl -P -f /usr/share/collectl/plotfiles/” command. This will create plots in /usr/share/collectl/plotfiles. Plots will be in zip format. To view the plots in a web page change directory to above location in top of the web page and select any of the plot or all plots and then click on Generate plot button. This will give you detailed graphical view of resource usage.