[collectd] User Plugin of collectd
Dear All, I need small plugin for collectd which counts the number of users logged into the system or (how to find Number of users connected to router using collectd ?) Thamks Maxe ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] Possible memory leak in python plugin?
Hi, In this thread it looks like you may have found a memory leak problem in collectd python, but I'm not sure. I am seeing a memory leak to in a very similar situation (though using the following plugin: https://github.com/mleinart/collectd-haproxy . I'm using the Ubuntu package collectd-core 4.10.1-2. Are you able to confirm if this is an issue you have detected and resolved, and how I may apply that to my systems? Many Thanks Rich [cid:image001.png@01CD18A6.575F6600] Richard Marshall, Operations Director Address: 170-172 Tower Bridge Road, London SE1 3LS Phone:+44 203 465 9259 Email: richard.marsh...@tagman.com Skype: richtagman We're currently hiring in London and New York - http://www.tagman.com/index.php/careers.html inline: image001.png___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] User Plugin of collectd
Hello. There is already a plugin for this called Users http://collectd.org/wiki/index.php/Plugin:Users HTH, Andreas. On 04/27/12 09:39, maxe wifi wrote: Dear All, I need small plugin for collectd which counts the number of users logged into the system or (how to find Number of users connected to router using collectd ?) Thamks Maxe ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd -- Dipl.-Ing. Andreas Maus science+computing ag System Administration Hagellocher Weg 73 tel.: +49 7071 9457 671 72070 Tuebingen, Germany fax: +49 7071 9457 411 www.science-computing.de -- Vorstandsvorsitzender/Chairman of the board of management: Gerd-Lothar Leonhart Vorstand/Board of Management: Dr. Bernd Finkbeiner, Michael Heinrichs, Dr. Arno Steitz, Dr. Ingrid Zech Vorsitzender des Aufsichtsrats/ Chairman of the Supervisory Board: Philippe Miltin Sitz/Registered Office: Tuebingen Registergericht/Registration Court: Stuttgart Registernummer/Commercial Register No.: HRB 382196 ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] Possible memory leak in python plugin?
hello, it's been couple of weeks since I patched, and there is no memory leak anymore.^^ I've used several tools to detect problems, example, valgrind http://valgrind.org/, memwatch( http://www.linkdata.se/sourcecode/memwatch/) for python test, i used guppy and it told me there was no leak. but couldn't find ways to to detect. because valgrind couldn't track child thread, memwatch doesn't understand free statements sometimes. It was my best way that just checking the candidate source codes line by line. specially embeded python and python c-extension, there might be some missing in reference counting of object in c code. please checkout following nice articles that explains the problem. http://edcjones.tripod.com/refcount.html hope you have lucky. ;) 2012/4/12 Richard Marshall richard.marsh...@tagman.com Hi, ** ** In this thread it looks like you may have found a memory leak problem in collectd python, but I’m not sure. I am seeing a memory leak to in a very similar situation (though using the following plugin: https://github.com/mleinart/collectd-haproxy . I’m using the Ubuntu package collectd-core 4.10.1-2. Are you able to confirm if this is an issue you have detected and resolved, and how I may apply that to my systems?*** * ** ** Many Thanks ** ** Rich ** ** ** ** ** ** [image: Description: cid:EBCCB7C5-BE97-454F-95DB-B5CD5BB470CA] Richard Marshall, Operations Director Address: 170-172 Tower Bridge Road, London SE1 3LS Phone:+44 203 465 9259 Email: *richard.marsh...@tagman.com* Skype: richtagman ** ** We're currently hiring in London and New York - * http://www.tagman.com/index.php/careers.html* ** ** ** ** ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd -- James.kim(김민석) 010 3266 8040 image001.png___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd
Re: [collectd] New plugin for collectd : write_mysql
On 05/04/2012 07:07 AM, Cyril Feraudet wrote: Le 04.05.2012 08:52, Cyril Feraudet a écrit : Le 03.05.2012 20:05, Daniel Hilst a écrit : On 05/03/2012 03:46 PM, Daniel Hilst wrote: On 02/14/2012 09:54 AM, Cyril Feraudet wrote: Hi all, Here the write_mysql output plugin patch (from 5.0.2) with modifications suggested by Octo. By the way, notification are handled, all memory used is freed on shutdown (thx Valgrind). Regards, Cyril Le 04.01.2012 10:49, Cyril Feraudet a écrit : Hi Octo, Hi all, Thanks for your time. It will permit to me to improve this plugin and my knowledge of C. Le 22.12.2011 01:06, Florian Forster aécrit : Hi Cyril, thank you very much for your patches! I'm very sorry, but I can't give the plugin the thorough review it deserves right now. But maybe you find the following comments helpful. On Tue, Dec 20, 2011 at 03:03:43PM +0200, Cyril Feraudet wrote: - with_mysql_libs=`$with_mysql_config --libs 2/dev/null` + with_mysql_libs=`$with_mysql_config --libs_r 2/dev/null` This looks like a bug fix. Would it make sense to add this change to the 4.10 branch? If so, would you be willing to send a separate patch for this? You are right, I will submit a patch soon. write_mysql is often called than mysql plugin and non thread safe library make collectd crashing quickly. +CREATE TABLE `data` ( + `id` bigint(20) NOT NULL auto_increment, + `timestamp` double NOT NULL, + `host_id` int(11) NOT NULL, + `plugin_id` int(11) NOT NULL, + `plugin_instance` varchar(255) default NULL, + `type_id` int(11) NOT NULL, + `typeinstance` varchar(255) default NULL, + `dataset_id` int(11) NOT NULL, + `value` double NOT NULL, One of the reasons why I didn't write a write_dbi or write_mysql plugin before is because I was uncertain about the schema to use. Why did you chose to have a separate table for host, plugin, plugin_instance, type, and type_instance? I currently think that just having an identifier table with five columns would be a better trade- off between normalization and complexity. The idea was to save space in `data` table and improve querying in it. For now, I've 800MB `data` table (MEMORY type) just for the last value of each metrics (4207 servers / 462,395 metrics) using REPLACE instead of INSERT statement. I think that SQL join are faster on numeric id than varchar. But all of this things are questionable and dependent of the final use. I think about a customizable SQL statement in plugin configuration. ATE TABLE `dataset` ( Why do you store datasets in the database (in addition to the types.db file)? Having the definition in more than one place is bound to create inconsistencies at some point This table is for readonly purpose and to make SQL query independent of number of metrics in a type. It also contain type added on the way by a plugin. diff --git a/src/write_mysql.c b/src/w /blockquote typedef struct host_s host_t; +struct host_s { + char name[DATA_MAX_NAME_LEN]; + int id; + host_t *next_host; +}; You will be doing a lot of lookups in this cache(es). I think using a binary search tree (an implementation if provided in src/utils_avltree.h) would improve performance here. Thanks for the tips, Il will do that. int port = tatic int write_mysql_config (const char *key, const char *value) { [...] + } else if (strcasecmp (Port, key) == 0) { + port = value; You a char* to an int. This won't produce what you expect. Use the function service_name_to_port_number() from src/common.h. +static int wri
Re: [collectd] New plugin for collectd : write_mysql
On 7 mai 2012, at 19:44, Daniel Hilst wrote: On 05/04/2012 07:07 AM, Cyril Feraudet wrote: Le 04.05.2012 08:52, Cyril Feraudet a écrit : Le 03.05.2012 20:05, Daniel Hilst a écrit : On 05/03/2012 03:46 PM, Daniel Hilst wrote: On 02/14/2012 09:54 AM, Cyril Feraudet wrote: Hi all, Here the write_mysql output plugin patch (from 5.0.2) with modifications suggested by Octo. By the way, notification are handled, all memory used is freed on shutdown (thx Valgrind). Regards, Cyril Le 04.01.2012 10:49, Cyril Feraudet a écrit : Hi Octo, Hi all, Thanks for your time. It will permit to me to improve this plugin and my knowledge of C. Le 22.12.2011 01:06, Florian Forster aécrit : Hi Cyril, thank you very much for your patches! I'm very sorry, but I can't give the plugin the thorough review it deserves right now. But maybe you find the following comments helpful. On Tue, Dec 20, 2011 at 03:03:43PM +0200, Cyril Feraudet wrote: - with_mysql_libs=`$with_mysql_config --libs 2/dev/null` + with_mysql_libs=`$with_mysql_config --libs_r 2/dev/null` This looks like a bug fix. Would it make sense to add this change to the 4.10 branch? If so, would you be willing to send a separate patch for this? You are right, I will submit a patch soon. write_mysql is often called than mysql plugin and non thread safe library make collectd crashing quickly. +CREATE TABLE `data` ( + `id` bigint(20) NOT NULL auto_increment, + `timestamp` double NOT NULL, + `host_id` int(11) NOT NULL, + `plugin_id` int(11) NOT NULL, + `plugin_instance` varchar(255) default NULL, + `type_id` int(11) NOT NULL, + `typeinstance` varchar(255) default NULL, + `dataset_id` int(11) NOT NULL, + `value` double NOT NULL, One of the reasons why I didn't write a write_dbi or write_mysql plugin before is because I was uncertain about the schema to use. Why did you chose to have a separate table for host, plugin, plugin_instance, type, and type_instance? I currently think that just having an identifier table with five columns would be a better trade- off between normalization and complexity. The idea was to save space in `data` table and improve querying in it. For now, I've 800MB `data` table (MEMORY type) just for the last value of each metrics (4207 servers / 462,395 metrics) using REPLACE instead of INSERT statement. I think that SQL join are faster on numeric id than varchar. But all of this things are questionable and dependent of the final use. I think about a customizable SQL statement in plugin configuration. ATE TABLE `dataset` ( Why do you store datasets in the database (in addition to the types.db file)? Having the definition in more than one place is bound to create inconsistencies at some point This table is for readonly purpose and to make SQL query independent of number of metrics in a type. It also contain type added on the way by a plugin. diff --git a/src/write_mysql.c b/src/w /blockquote typedef struct host_s host_t; +struct host_s { + char name[DATA_MAX_NAME_LEN]; + int id; + host_t *next_host; +}; You will be doing a lot of lookups in this cache(es). I think using a binary search tree (an implementation if provided in src/utils_avltree.h) would improve performance here. Thanks for the tips, Il will do that. int port = tatic int write_mysql_config (const char *key, const char *value) { [...] + } else if (strcasecmp (Port, key) == 0) { + port = value; You a char* to an int. This won't produce what you expect. Use the function
Re: [collectd] Trying to understand interval of sent stats
Hi Bruce, Are you looking for the Interval, Timeout, and ReadThreads options in the global section of the config? http://collectd.org/documentation/manpages/collectd.conf.5.shtml#global_options These define how often a data point should be collected. As far as sending collected data points, that varies by write plugin. For example, the network plugin will send a batch of data points. Thanks Kimo From: Bruce Lysik bly...@yahoo.com To: collectd collectd@verplant.org Sent: Friday, May 4, 2012 10:48 AM Subject: [collectd] Trying to understand interval of sent stats Hi, I have collectd setup to send to graphite, and things are generally working great. Now I'm trying to understand how often the various plugins are supposed to be sending data, so I can tune the graphite data store retentions correctly. Can someone clue me in on this? Thanks in advance! -- Bruce Z. Lysik bly...@yahoo.com ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd ___ collectd mailing list collectd@verplant.org http://mailman.verplant.org/listinfo/collectd