phobos182/collectd-elasticsearch

Module name clashing

Opened this issue · 8 comments

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 !

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">

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

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

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?

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