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