Question

I've uncommented LoadPlugin dbi in collectd.conf, but now restarting collectd gives me:

Stopping collectd:                                         [  OK  ]
Starting collectd: Could not find plugin dbi.
                                                           [  OK  ]

How do I enable that plugin? The OS is centos 6.4 and yum list all doesn't show collectd-dbi plugin:

[root@virtualbox ~]# yum list all | grep collectd | grep dbi
[root@virtualbox ~]# 

I've installed libdbi-dbd-mysql which was missing, but that didn't change anything.

Was it helpful?

Solution

I had the same issue on CentOS 6.3. The problem ended up being that there is no collectd-dbi rpm in the EPEL yum repo. You'll have to get the dbi plugin from elsewhere.

Check which version of collectd you have installed

$ yum info collectd

This is what the results were for me

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Installed Packages
Name        : collectd
Arch        : x86_64
Version     : 4.10.7
Release     : 1.el6
Size        : 1.3 M
Repo        : installed
From repo   : epel

You can try searching around the web for an RPM that someone built, but in my case I couldn't find one for my exact version. Because of this, I think the only solution is to compile collectd from source. The following are the steps I took to compile collectd and get the dbi plugin installed

Clone the collectd repo and checkout the version that you already have installed

git clone https://github.com/collectd/collectd.git
cd collectd/
git checkout collectd-4.10.7

Install dependencies to compile collectd. Below is everything I needed to install for compiling this, but there might be more you need to install. Note, libdbi-devel is required. If it doesn't get installed, then when running configure script, the dbi plugin will not enabled and not compiled.

sudo yum install autoconf automake flex ppl cloog-ppl cpp libgomp mpfr glibc-devel glibc-headers kernel-headers gcc libtool libtool-ltdl libtool-ltdl-devel libgcrypt-devel libgpg-error-devel libdbi libdbi-devel bison byacc db4-cxx db4-devel gdbm-devel perl-ExtUtils-MakeMaker perl-ExtUtils-ParseXS perl-Test-Harness perl-devel

Run the following and make sure there are no errors

./build.sh && ./configure && make

Assuming there were no issues compiling, then you should have the dbi plugin compiled. You can find it in src/.libs/dbi.so

Check that you have all the linked libraries installed

$ ldd src/.libs/dbi.so
linux-vdso.so.1 =>  (0x00007fff109ff000)
libdbi.so.0 => /usr/lib64/libdbi.so.0 (0x00007fca4a53c000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fca4a338000)
libc.so.6 => /lib64/libc.so.6 (0x00007fca49fa3000)
libm.so.6 => /lib64/libm.so.6 (0x00007fca49d1f000)
/lib64/ld-linux-x86-64.so.2 (0x00007fca4a95a000)

If that looks good, you can install the dbi.so shared object to the collectd lib directory like so:

sudo install -o root -g root src/.libs/dbi.so /usr/lib64/collectd/

You should now be able to restart collectd and have the dbi library loaded

$ sudo service collectd restart
Stopping collectd:                                         [  OK  ]
Starting collectd:                                         [  OK  ]

Hope that helps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top