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. At 2013-05-12 18:00:02,[email protected] wrote: >Send collectd mailing list submissions to > [email protected] > >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 > [email protected] > >You can reach the person managing the list at > [email protected] > >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 <[email protected]> >To: [email protected] >Subject: Re: [collectd] collectd Digest, Vol 92, Issue 4 >Message-ID: <[email protected]> >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 >[email protected] >http://mailman.verplant.org/listinfo/collectd > > >End of collectd Digest, Vol 92, Issue 9 >***************************************
_______________________________________________ collectd mailing list [email protected] http://mailman.verplant.org/listinfo/collectd
