<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><div>Sorry, but I think you didn't understand my question. For example, I write a plugin use python as follows. I want to verify if my plugin would work,</div><div>then I run it. It cann't run because collectd can't import, the module is not exist.</div><div>I search in google, but every people say how to configure python plugin, not anywhere to say how to install python plugin dependency.</div><div>Below is some python code,error occured at the first line :</div><div><br></div><div>import collectd</div><div>import socket</div><div>from string import maketrans</div><div>from time import time</div><div>from traceback import format_exc</div><div><br></div><div>host = None</div><div>port = None</div><div>differentiate_values = False</div><div>differentiate_values_over_time = False</div><div>lowercase_metric_names = False</div><div>prefix = None</div><div>types = {}</div><div>postfix = None</div><div>host_separator = "_"</div><div>metric_separator = "."</div><div>protocol = "tcp"</div><div><br></div><div><br></div><br><br><br><br><div></div><div id="divNeteaseMailCard"></div><br><pre><br>At 2013-05-17 18:00:01,collectd-request@verplant.org wrote:
>Send collectd mailing list submissions to
> collectd@verplant.org
>
>To subscribe or unsubscribe via the World Wide Web, visit
> http://mailman.verplant.org/listinfo/collectd
>or, via email, send a message with subject or body 'help' to
> collectd-request@verplant.org
>
>You can reach the person managing the list at
> collectd-owner@verplant.org
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of collectd digest..."
>
>
>Today's Topics:
>
> 1. Re: collectd Digest, Vol 92, Issue 9 (Sven Trenkel)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Thu, 16 May 2013 17:23:44 +0200
>From: Sven Trenkel <collectd@semidefinite.de>
>To: collectd@verplant.org
>Subject: Re: [collectd] collectd Digest, Vol 92, Issue 9
>Message-ID: <5194FA00.1070504@semidefinite.de>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>On 2013-05-12 14:20, kangqiang wrote:
>> I'm really appreciate for your replying, it is helpful to me.
>> Yes, I tried to import it in interactive interpreter, the
>>
>> backtrace just say "no module named collectd". I can import time, os,system module, and can print it well.
>> hoping for your reply, thank you.
>
>I'm really confused how this could happen, if there is any kind of error
>while initializing the collectd Python module then the entire Python
>plugin of collectd should refuse to continue and get unloaded by
>collectd so that it could never even launch the interactive interpreter.
>
>So my only idea here would be:
>1. Use the interactive mode in your config, as you have pasted it before.
>2. Log all collectd messages to stdout
>3. Do not load any other modules
>4. Start collectd, try to import the module collectd
>5. Past result here
>
>The very short collectd config do do that looks something like this:
>
>FQDNLookup true
>LoadPlugin logfile
><Plugin logfile>
> LogLevel info
> File STDOUT
> Timestamp true
></Plugin>
><LoadPlugin python>
> Globals true
></LoadPlugin>
><Plugin python>
> ModulePath "/path/to/somewhere/"
> LogTraces true
> Interactive true
></Plugin>
>
>
>
>
>------------------------------
>
>_______________________________________________
>collectd mailing list
>collectd@verplant.org
>http://mailman.verplant.org/listinfo/collectd
>
>
>End of collectd Digest, Vol 92, Issue 14
>****************************************
</pre></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>