phobos182 / collectd-elasticsearch

Collectd ElasticSearch plugin
Apache License 2.0
105 stars 105 forks source link

Module name clashing #17

Open ptbrowne opened 10 years ago

ptbrowne commented 10 years ago

Hi,

I have just run into a very hard to debug problem. After adding elasticsearch.py to my config, I had the error

python plugin: Found a configuration for the "elasticsearch" plugin, but the plugin isn't loaded or didn't register a configuration callback.

It was because I had already installed the ElasticSearch python client globally and so collectd was loading the wrong module. Sure, this is a newbie mistake and I should have used a virtualenv, but I guess maybe renaming elasticsearch.py to elasticsearch_collectd.py could perhaps save some users some headaches ;-)

Thanks !

timbunce commented 9 years ago

+1

pdaukintis commented 9 years ago

+1

johnarnold commented 9 years ago

+1

tedoc2000 commented 9 years ago

This is caused because there is another python module named "elasticsearch" in your default PYTHONPATH. The work around is to rename the collectd plugin's python file from elasticsearch.py -> elasticsearch_collectd.py then edit your config file and change: Import "elasticsearch" -> Import "elasticsearch_collectd" <Module "elasticsearch"> -> <Module "elasticsearch_collectd">

timbunce commented 9 years ago

Thanks for the workaround @tedoc2000. Sure would be nice if the next release of collectd-elasticsearch could avoid the need for the workaround.

ddes commented 9 years ago

Thank you @tedoc2000 & @ptbrowne, was very helpful !

manhdinh commented 8 years ago

Hello, i don't understand. Config Elasticsearch Plugin that make collectd send to Elas or receivce data from Elas? And I want to collect data from collectd by using Graylog, any suggestions for this problem?

rgevaert commented 8 years ago

I had the same issue. I think this because I installed python-elasticsearch from elasticsearch upstream python-elasticsearch: Installed: 2.0.0 Candidate: 2.0.0 Version table: *\ 2.0.0 0 500 http://packages.elastic.co/curator/3/debian/ stable/main amd64 Packages 100 /var/lib/dpkg/status