[collectd] problem with importing collectd python module

Nils Steinger nrg_collectd at voidptr.de
Sat Feb 6 16:13:57 CET 2016


Hi Pawel,

are you loading the plugin from collectd's config file as described in
its documentation [1]?
Python scripts importing the collectd module are meant to be run by a
Python interpreter included in collectd (by loading and configuring the
"Python" plugin in collectd.conf) to avoid the overhead of running
multiple Python interpreters. Running those scripts manually from the
commandline won't work.
To add to the confusion, there's also a Python wrapper around collectd's
Unix socket interface, but that one isn't used here.

Regards,
Nils

[1]: https://github.com/sebest/collectd-mongodb#configuration

On 06.02.2016 14:54, Pawel Akonom wrote:
> Hi,
> 
> The problem is with collectd python module - python script can't load it. It can't find it in default python modules path. Is collectd python module included in collectd source code? If so please write with file it is because I couldn't find it. If it's not included in collectd source code from where can I get it? In collectd python plugin documentation there is example with "import collectd" which is loading collectd python module.
> 
> Br,
> Pawel
> ________________________________________
> From: Joshua J. Kugler <joshua at azariah.com>
> Sent: Saturday, February 6, 2016 1:13 AM
> To: collectd at verplant.org
> Cc: Pawel Akonom; Derek Palma
> Subject: Re: [collectd] problem with importing collectd python module
> 
> On Friday, February 05, 2016 19:39:50 Pawel Akonom wrote:
>> The first line of mongodb.py plugin is:
>>
>>
>> "import collectd" and the plugin can't load it. When I run python shell and
>> try to import collectd manually I get:
>>
>>
>> [root at cisco_aci_dev184 ~]# python
>> Python 2.6.6 (r266:84292, Feb 22 2013, 00:00:18)
>> [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>>
>>>>> import collectd
>>
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>> ImportError: No module named collectd
> 
> Can you clarify what you mean by "the plugin can't load it?" Do you can an
> error? Or is the Python plugin not finding the mongodb.py plugin?
> 
> Per the wiki page here: https://collectd.org/wiki/index.php/Plugin:Python you
> will need to provide a path to the module you're trying load.  Can you post
> your collectd config?
> 
> j
> 
> --
> Joshua J. Kugler - Fairbanks, Alaska
> Azariah Enterprises - Programming and Website Design
> joshua at azariah.com - Jabber: pedahzur at gmail.com
> PGP Key: http://pgp.mit.edu/  ID 0x73B13B6A
> 
> _______________________________________________
> collectd mailing list
> collectd at verplant.org
> http://mailman.verplant.org/listinfo/collectd
> 



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20160206/76e86203/attachment.sig>


More information about the collectd mailing list