Install and use collectd under CentOS Stream 9 using OpsTools

collectd is a daemon, which collects system data and statistics and it may send them over the network to a back-end data. Under CentOS Stream 9 the collectd package has been removed from the CentOS Stream 9 repositories. Special Interest Groups (SIG), which is a group of CentOS Community, provides and supports multiple small repositories for different Linux utilities and tools. One of the SIG‘s repositories is OpsTools, which provides a package for collectd daemon and multiple collectd modules packed in separate packages.

To use collectd under CentOS Stream 9 a CentOS Community repository should be installed – OpsTools.

Steps to install and use the collectd daemon:

dnf install -y centos-release-opstools
dnf install -y collectd

It’s worth noting that all the Linux distribution, which tries to track and be compatible with Red Hat Enterprise Linux like Rocky Linux will have the same problem with missing collectd package. So the SIG OpsTools repository should be also possible to install under all of these Linux distributions.

Here is the output of installing the above packages under CentOS Stream 9:

[root@srv ~]# dnf install -y centos-release-opstools
Last metadata expiration check: 0:00:23 ago on Wed 22 Jun 2022 02:05:19 PM UTC.
Dependencies resolved.
======================================================================================
 Package                       Architecture Version         Repository           Size
======================================================================================
Installing:
 centos-release-opstools       noarch       1-12.el9s       extras-common       8.4 k

Transaction Summary
======================================================================================
Install  1 Package

Total download size: 8.4 k
Installed size: 1.7 k
Downloading Packages:
centos-release-opstools-1-12.el9s.noarch.rpm           62 kB/s | 8.4 kB     00:00    
--------------------------------------------------------------------------------------
Total                                                  22 kB/s | 8.4 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                              1/1 
  Installing       : centos-release-opstools-1-12.el9s.noarch                     1/1 
  Verifying        : centos-release-opstools-1-12.el9s.noarch                     1/1 

Installed:
  centos-release-opstools-1-12.el9s.noarch                                            

Complete!
[root@srv ~]# dnf install -y collectd
CentOS Stream 9 - OpsTools - collectd                  12 kB/s |  41 kB     00:03    
Dependencies resolved.
======================================================================================
 Package          Architecture   Version                Repository               Size
======================================================================================
Installing:
 collectd         x86_64         5.12.0-7.el9s          centos-opstools         673 k
Installing dependencies:
 yajl             x86_64         2.1.0-20.el9           appstream                38 k

Transaction Summary
======================================================================================
Install  2 Packages

Total download size: 711 k
Installed size: 2.2 M
Downloading Packages:
(1/2): yajl-2.1.0-20.el9.x86_64.rpm                   179 kB/s |  38 kB     00:00    
(2/2): collectd-5.12.0-7.el9s.x86_64.rpm              1.1 MB/s | 673 kB     00:00    
--------------------------------------------------------------------------------------
Total                                                 594 kB/s | 711 kB     00:01     
CentOS Stream 9 - OpsTools - collectd                 1.0 MB/s | 1.0 kB     00:00    
Importing GPG key 0x51BC2A13:
 Userid     : "CentOS OpsTools SIG (https://wiki.centos.org/SpecialInterestGroup/OpsTools) <security@centos.org>"
 Fingerprint: 7872 8176 9AD7 3878 85EE A649 4FD9 5327 51BC 2A13
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-OpsTools
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                              1/1 
  Installing       : yajl-2.1.0-20.el9.x86_64                                     1/2 
  Installing       : collectd-5.12.0-7.el9s.x86_64                                2/2 
  Running scriptlet: collectd-5.12.0-7.el9s.x86_64                                2/2 
  Verifying        : collectd-5.12.0-7.el9s.x86_64                                1/2 
  Verifying        : yajl-2.1.0-20.el9.x86_64                                     2/2 

Installed:
  collectd-5.12.0-7.el9s.x86_64                yajl-2.1.0-20.el9.x86_64               

Complete!

collectd default configuration

The default configuration comments all the lines in /etc/collectd.conf except one, which includes all the files under /etc/collectd.d/. So the logic is to have a separate file for each collectd plugin. By default, there are 5 default configuration files activating 5 plugins:
Keep on reading!