Re: [collectd] [Libguestfs] collectd leaks SIGCHLD == SIG_IGN into plugins

2018-11-13 Thread Sven Trenkel

On 2018-11-13 12:25, Richard W.M. Jones wrote:

The problem with all of this is that all the different plugins that 
expect different SIGCHLD behaviour are running in the same process and 
you can only have one behaviour for all of them. I encountered that with 
the Python plugin years ago, documented in the collectd-python man page. 
That's why 
https://github.com/collectd/collectd/blob/master/contrib/python/getsigchld.py 
exists. Note the warning about it breaking the exec plugin because it 
has different expectations. I'm not sure if there is any good solution 
for this problem.


___
collectd mailing list
collectd@verplant.org
https://mailman.verplant.org/listinfo/collectd

Re: [collectd] Issues when trying to use the python plugin for mongo

2015-02-13 Thread Sven Trenkel

On 13.02.2015 20:44, Finn, Dan wrote:


Here is the snipet from my collectd.conf file where I enable the plugin:

Plugin python
 ModulePath /etc/collectd.d/


Do you have something like

Include /etc/collectd.d/*

in your collectd config? Because in that case collectd would try to 
parse the python script as a config file, which would not work at all.



___
collectd mailing list
collectd@verplant.org
http://mailman.verplant.org/listinfo/collectd


Re: [collectd] collectd Digest, Vol 92, Issue 9

2013-05-16 Thread Sven Trenkel

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


Re: [collectd] collectd Digest, Vol 92, Issue 4

2013-05-11 Thread Sven Trenkel

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


Re: [collectd] collectd python plugin

2013-05-08 Thread Sven Trenkel

On 2013-05-08 09:25, kangqiang wrote:


hi guys, i am writing a python plugin, when i try to do this:
import collectd
it show me no module named collectd.


Did you load the Python module in collectd? If so, did it print anything 
in the logs? If you can't find anything useful there, paste the Python 
related part of your collectd config here so we can take a look at it.



___
collectd mailing list
collectd@verplant.org
http://mailman.verplant.org/listinfo/collectd


Re: [collectd] Possible memory leak in python plugin?

2012-01-17 Thread Sven Trenkel
As always in life the solution was not as simple as it appeared to be. 
Oh well, I uploaded a patch to github, it should appear in the official 
collectd repository soonish.
If you want to compile a it yourself from source, this patch should work 
on the collectd-5.0 branch:

http://www.semidefinite.de/collectd-python.patch

___
collectd mailing list
collectd@verplant.org
http://mailman.verplant.org/listinfo/collectd


Re: [collectd] Possible memory leak in python plugin?

2012-01-15 Thread Sven Trenkel

What version of collectd are you using?
And until we find the cause of this behavior you might try to pull the 
constant parts of the submitted value out of the for loop. So,


v = collectd.Values()
v.plugin = 'mongostats'
v.type = 'counter'

could be put before the loop as it's just creating and destroying the 
same objects over and over again. This might or might not make the 
memory leak slower.


___
collectd mailing list
collectd@verplant.org
http://mailman.verplant.org/listinfo/collectd


Re: [collectd] Possible memory leak in python plugin?

2012-01-15 Thread Sven Trenkel
Never mind, I think I found the bug. I'll test it tomorrow. If you 
compiled collectd yourself I'll send you a patch if you tell me the 
exact version number you're using.


___
collectd mailing list
collectd@verplant.org
http://mailman.verplant.org/listinfo/collectd


Re: [collectd] NetApp plugin giving NANs

2011-03-17 Thread Sven Trenkel

On 15.03.2011 12:40, Mark Syms wrote:

Hi,


I've been trying to use the NetApp plugin to monitor a NetApp Fas2020
that I'm working with. Collectd is running on Debian, I've built a
modified package of version 4.10.1-1 using the NetApp SDK to allow
enabling the NetApp plugin. The NetApp is running version 7.2.6.1 of the
system software.

rrdtool info for the cpu-system.rrd file gives the following (the other
RRDs are similar).


what interval did you configure for the NetApp plugin? There used to be 
a bug that caused this kind of behavior if the global interval was 
different from the interval used by the netapp plugin. If this error 
condition fits your setup, you might want to update to version 4.10.2. 
After this you have to delete all empty rrd files of the netapp plugin, 
as they have been created with with the wrong interval setting.


If updating is not an option for whatever reason you can adjust the
interval of the netapp plugin to your global interval, which should fix
the problem immediately. Or, if you know a lot more about rrd than I do,
you could edit the already created rrd files and adjust their update
interval, but I have no idea how to do that. But someone else on this 
mailing list might be able to answer this question.



Regards,
Sven

___
collectd mailing list
collectd@verplant.org
http://mailman.verplant.org/listinfo/collectd


Re: [collectd] python memleaks?

2010-07-11 Thread Sven Trenkel
On 2010-07-11 18:48, Krzysiek Szczuka wrote:

Hi..

 I want to make a python based module for pinging multiple devices and 
 store it to db..
 I've compiled collectd-4.10.0 with python plugin.. I've wrote very basic 
 'write do /dev/null' module in python, and memory usage over time grows..
 When I load only the python plugin, with no modules, it's ok, when I 
 load my devnull.py, memory usage grows..

yes, that's a known bug. Every time the write or notification callback
is executed it will leak a few bytes of memory. This bug has been fixed
in the current git repository for both version 4.9 and 4.10. And just as
I was about to point to the relevant patches I noticed that version
4.10.1 was released two days ago. That should fix your problem.


Regards,
Sven

___
collectd mailing list
collectd@verplant.org
http://mailman.verplant.org/listinfo/collectd


Re: [collectd] Python Plugin issues - PyExc_ValueError

2010-05-05 Thread Sven Trenkel
On 2010-05-04 06:06, dartarrow-collectd wrote:

Hi,

 I'm trying out the python plugin but I get this error when i start collectd:

 [2010-05-04 04:03:58] Unhandled python exception in importing
 module: ImportError: /usr/lib/python2.5/lib-dynload/time.so:
 undefined symbol: PyExc_ValueError

 This is on a Debian Lenny with python2.5. I have installed the
 python-dev module.
 It's running Collectd-4.9.2 compiled from source.

this error message means that the time.so was looking for library symbols that
should have been in the collectd process, but didn't find them. There are two
possible reasons for this. Either you imported the the python module with just

   LoadPlugin python

instead of

   LoadPlugin python
 Globals true
   /LoadPlugin

This is important because it tells the module loader to export the python 
symbols
to the main collectd process for all modules to see instead of keeping it 
private.

Another explanation might be that you used libtool1 to compile collectd. 
libtool1
doesn't support exporting symbols, so libtool2 is needed for this to work. 
Debian
has packages for both, so just install libtool2. If you have both installed, 
make
sure that libtool2 is used during the build process.

___
collectd mailing list
collectd@verplant.org
http://mailman.verplant.org/listinfo/collectd