Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Values in config are ignored #23

Open
benh57 opened this issue Oct 3, 2014 · 2 comments
Open

Values in config are ignored #23

benh57 opened this issue Oct 3, 2014 · 2 comments

Comments

@benh57
Copy link

benh57 commented Oct 3, 2014

I'm running collectd 5.4.1 on CentOS 6.5, running with the CentOS scl python27 embedded into collectd (since this plugin requires python 2.7 due to its use of subprocess.check_output)

I noticed any values i set in the config are ignored

14:13:53 root@sm-sensu /usr/lib/collectd/plugins/ceph-git/plugins $ cat /etc/collectd.d/ceph_latency.conf
<LoadPlugin "python">
Globals true

Interval 10
Debug True

<Plugin "python">
ModulePath "/usr/lib/collectd/plugins/ceph-git/plugins"

Import "ceph_latency_plugin"

<Module "ceph_latency_plugin">
            Verbose "true"
            Cluster ceph
            Interval 10
            TestPool test
</Module>

I believe this is because the register_read happens before the configure_callback is called.

config key: Cluster - ceph
config key: Interval - 10
config key: TestPool - test
Stopping collectd: [ OK ]
Starting collectd: latency plugin registering with interval: 60.0

To fix this, i moved the register_read inside the callback, and now it works:
def configure_callback(conf):
"""Received configuration information"""
plugin.config_callback(conf)
collectd.error("latency plugin registering with interval: %s" % plugin.interval)
collectd.register_read(read_callback, plugin.interval)

Stopping collectd: [ OK ]
Starting collectd: config key: Verbose - true
config key: Cluster - ceph
config key: Interval - 10.0
config key: TestPool - test
latency plugin registering with interval: 10.0

@rochaporto
Copy link
Owner

Thanks for this. I can't check this right now, but will in a couple days. Want to send a pull request in the meantime? I'm happy to have a look.

Can you give a bit more details on the subprocess.check_output and python 2.7 requirement? I've been using it with python 3.4.

Thanks!

@ghost
Copy link

ghost commented Feb 16, 2016

What's the status on this? We are seeing the same issue! I could trace it to the configure_callback function in base.py and could verify that the Interval value makes it there. Still, I am getting values into InfluxDB in other intervals than the 10s I configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants