[collectd] collectd Digest, Vol 92, Issue 4

Sven Trenkel collectd at semidefinite.de
Sat May 11 23:34:52 CEST 2013


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).



More information about the collectd mailing list