Bug 1319526 - collectd-openldap fails to start, reporting "read function [...] is already registered"
Summary: collectd-openldap fails to start, reporting "read function [...] is already r...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: collectd
Version: epel7
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Ruben Kerkhof
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-20 22:19 UTC by Jonathon Anderson
Modified: 2016-03-21 19:16 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-21 18:27:18 UTC
Type: Bug


Attachments (Terms of Use)
collectd configuration (10.09 KB, application/x-bzip)
2016-03-21 16:52 UTC, Jonathon Anderson
no flags Details

Description Jonathon Anderson 2016-03-20 22:19:46 UTC
Description of problem:

Configured collectd to use openldap plugin. Metrics are not gathered. Syslog plugin reports:

Mar 20 16:12:39 ldap1 collectd[15663]: The read function "openldap/localhost/localhost" is already registered. Check for duplicate "LoadPlugin" lines in your configuration!

Version-Release number of selected component (if applicable):

# rpm -qa | grep collectd
collectd-openldap-5.5.1-2.el7.x86_64
collectd-5.5.1-2.el7.x86_64


How reproducible:

Always.

Steps to Reproduce:
1. Install collectd and collectd-openldap
2. Configure collectd-openldap
3. Start collectd

Actual results:

No metrics gathered. Error message in syslog.


Expected results:

Metrics gathered. No message in syslog.


Additional info:


Sample configuration:

<LoadPlugin openldap>
  Globals false
</LoadPlugin>

<Plugin "openldap">
  <Instance "localhost">
    URL "ldap://localhost/"
  </Instance>
</Plugin>

Also

# find /etc/collectd.* -type f -exec grep -i ldap {} +
/etc/collectd.d/10-openldap.conf:<LoadPlugin openldap>
/etc/collectd.d/10-openldap.conf:<Plugin "openldap">
/etc/collectd.d/10-openldap.conf:    URL "ldap://localhost/"

Comment 1 Ruben Kerkhof 2016-03-21 14:41:50 UTC
Did you check /etc/collectd.conf as well?

Comment 2 Jonathon Anderson 2016-03-21 15:05:07 UTC
That's why I included the find command at the bottom of my message. The only instances of `ldap` in any of the config files is in /etc/collectd.d/10-openldap.conf.

# find /etc/collectd.* -type f -exec grep -i ldap {} +
/etc/collectd.d/10-openldap.conf:<LoadPlugin openldap>
/etc/collectd.d/10-openldap.conf:<Plugin "openldap">
/etc/collectd.d/10-openldap.conf:    URL "ldap://localhost/"

/etc/collectd.* would match /etc/collectd.conf and /etc/collectd.d. Is there another location where it might be picking up configuration that I'm missing?

Comment 3 Ruben Kerkhof 2016-03-21 16:45:25 UTC
Where collectd looks for its config depends on the Include directive in /etc/collectd.conf. By default this is Include "/etc/collectd.d".

Please share the complete configuration, both /etc/collectd.conf and any include files.

Comment 4 Jonathon Anderson 2016-03-21 16:52:42 UTC
Created attachment 1138689 [details]
collectd configuration

As requested.

# tar -cf collectd-config.tar.bz2 -j -C /etc collectd.conf collectd.d

Comment 5 Ruben Kerkhof 2016-03-21 17:06:24 UTC
Thanks.

Check the last two lines in collectd.conf, there's your issue:

Include "/etc/collectd.d"
Include "/etc/collectd.d/*.conf"

This includes each file twice.

Comment 6 Jonathon Anderson 2016-03-21 17:18:31 UTC
I noticed that just as I was uploading this. I'll check it and try again.

(This config is generated by puppetlabs/collectd; so it will just end up meaning the bug is with them. ;)

Comment 7 Ruben Kerkhof 2016-03-21 18:27:18 UTC
I just checked, and I can indeed reproduce your issue when I put that last line in.

Arguably Collectd itself could handle this a bit better too, since collectd.conf(5) says "It is no problem to have a block like "<Plugin foo>" in more than one file". I'll see if I can do something about that upstream.

Comment 8 Jonathon Anderson 2016-03-21 19:16:29 UTC
I figured out why puppet was duplicating the Include, and this has stopped generating an error; but LDAP metrics are still not visible in RRD or in the remote server (an influxdb instance).

I understand if this is out-of-scope for this bug report; but I'll look into whether this is because of there being no ldap types defined in types.db. That's all I can think of for why this might be happening.


Note You need to log in before you can comment on or make changes to this bug.