<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">I'm really appreciate for your replying, it is helpful to me.<br>Yes, I tried to import it in interactive interpreter, the <br><pre>backtrace just say "no module named collectd". I can import time, os,system module, and can print it well.<br>hoping for your reply, thank you.<br></pre><br><br><div></div><div id="divNeteaseMailCard"></div><br><pre><br>At 2013-05-12 18:00:02,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 4 (Sven Trenkel)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Sat, 11 May 2013 23:34:52 +0200
>From: Sven Trenkel <collectd@semidefinite.de>
>To: collectd@verplant.org
>Subject: Re: [collectd] collectd Digest, Vol 92, Issue 4
>Message-ID: <518EB97C.7070308@semidefinite.de>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>On 10.05.2013 09:23, kangqiang wrote:
>
>>      it seems it's not about config. When I write python plugin, i first
>> need to import collectd. I tried to import it in ipython, it throws
>> exception.
>>      anyway, my python collectd config as follows:
>> <Plugin python>
>>          ModulePath "/opt/monitor/libvirt_memory.py"
>>          LogTraces true
>>          Interactive true
>> #       Import "spam"
>> #
>> #       <Module spam>
>> #               spam "wonderful" "lovely"
>> #       </Module>
>> </Plugin>
>
>The ModulePath certainly looks wrong (unless you actually have a 
>directory called "libvirl_memory.py"), not sure if that might break 
>imports, but probably not.
>You're not actually importing a script you wrote so I'm assuming that 
>you started "collectd -f" and are trying to write something from the 
>interactive interpreter? In that case, does the failed "import collectd" 
>command show any interesting backtrace? Do other imports work? Please 
>try one normal python module (like "time") and one script you wrote 
>yourself (doesn't have to do anything, just print "Hello world" would be 
>enough to see if it works).
>
>
>
>------------------------------
>
>_______________________________________________
>collectd mailing list
>collectd@verplant.org
>http://mailman.verplant.org/listinfo/collectd
>
>
>End of collectd Digest, Vol 92, Issue 9
>***************************************
</pre></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>