From: Florian Forster Date: Sun, 11 Nov 2012 11:05:17 +0000 (+0100) Subject: Merge branch 'collectd-4.10' into collectd-5.0 X-Git-Tag: collectd-5.0.5~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9e7b3a035836474cb4af253b248de30d5eb97f4d;p=collectd.git Merge branch 'collectd-4.10' into collectd-5.0 Conflicts: ChangeLog src/pyvalues.c version-gen.sh --- 9e7b3a035836474cb4af253b248de30d5eb97f4d diff --cc ChangeLog index 37c72a64,21c046b7..8d478adc --- a/ChangeLog +++ b/ChangeLog @@@ -1,174 -1,45 +1,216 @@@ +2012-04-01, Version 5.0.4 + * Build system: Fix the use of a libltdl macro. Thanks to Clemens Lang + for fixing this. Adresses some issues with building the iptables + plugin under Gentoo. + * libcollectdclient: A memory leak in the lcc_getval() function has + been fixed. Thanks to Jason Schmidlapp for finding and fixing this + issue. + * bind plugin: The use of 'QType" types has been fixed. + * df plugin: Fixed compiler issue under Mac OS X 10.7. + * conntrack plugin: Support zero as legitimate value. Thanks to Louis + Opter for his patch. + * memcached plugin: Increased the size of a static buffer, which was + truncating status messages form memcached. Thanks to Timon for the + patch. + * network plugin: Forwarding of notifications has been disabled. This + was a contition not checked for before, which may retult in an + endless loop. + * processes plugin: Support for process names with spaces has been + added to the Linux implementation. Thanks to Darrell Bishop for his + patch. + * perl plugin: A race condition in several callbacks, including log and + write callbacks, has been fixed. Thanks to "Rrpv" for reporting this + bug. + * snmp plugin: A bug when casting unsigned integers to gauge values has + been fixed: Unsigned integers would be cast to a signed integer and + then to a gauge, possibly resulting in a negative value. + * tcpconns plugin: Compilation with newer versions of the FreeBSD + runtime has been fixed. + +2012-02-19, Version 5.0.3 + * Build system: Fix problems when building the ipvs and iptables + plugins. Thanks to Sebastian Harl for his patch. A bashism in the + version-gen.sh script has been fixed. Thanks to Jo-Philipp Wich for + his patch. + * csv and rrdtool plugins: Print a more helpful error message when the + DataDir is a symlink pointing to a non-existing location. Thanks to + Jonathan Nieder for his patch. + * exec plugin: Fix a problem when using select(2) to read from file + handles. Thanks to Gerrie Roos for his patch. + * network plugin: An incorrect error message in the handling of the + "Interface" configuration option has been fixed. Thanks to Gerrie + Roos for his patch. + * oracle plugin: A potential endless loop in the error handling has + been fixed. + * python plugin: A crash bug in the configuration handling has been + fixed. Thanks to Sven Trenkel for his patch. + * interfaces plugin: The change which was supposed to ignore "bogus" + interfaces has been reverted, since it ignored legit interfaces, such + as bonding pseudo-devices as well. + +2012-01-21, Version 5.0.2 + * curl_xml plugin: Fix handling of file:// and other URLs (which don't + follow HTTP status codes). Thanks to Fabien Wernli for his patch! + * df plugin: Fix handling of negative "available" counts. This can + occur with some file systems, for example UFS. Thanks to Toni Ylenius + for his patch. + * interface plugin: "mac" interfaces are now ignored on Solaris. These + pseudo-interfaces occur multiple times, causing warnings. Also switch + to 64-bit counters on Solaris, improving overflow behavior for + high-speed interfaces. Thanks to Eddy Geez and Fabien Wernli for + their patches. + * memory plugin: Account kernel and unused memory under Solaris. Thanks + to Fabien Wernli for his patch. + * network plugin: A bug in the interaction between the Network plugin + and filter chains has been fixed: When a filter modified a field such + as the hostname, subsequent values in the same network packets could + have ended up using the modified name rather than the original name. + Thanks to Sebastian Harl for identifying the problem. + * oracle plugin: A memory leak has been fixed in the parameter handling. + * python plugin: A memory leak has been fixed. Thanks to Sven Trenkel + for fixing this bug! + +2011-10-07, Version 5.0.1 + * collectd: A mutex leak has been fixed in the meta data code. Thanks + to Rafal Lesniak for his patch. + * collectd: Compatibility fixes for GCC 4.6 have been applied. Thanks + to Peter Green for his patch. + * csv plugin: The line buffer size has been increased. Thanks to Colin + McCabe for the patch. + * curl_json plugin: Don't use the "parent" node to build the type + instance, if it is empty. Compatibility with libyajl 2 has been + added. Thanks to "spupykin" of the Arch Linux project for the initial + code. Formatting of time has been fixed in the JSON module. + * exec plugin: Fix the timestamp value passed to notification scripts. + Thanks to Alexander Kovalenko for fixing this. + * iptables plugin: Fix linking with some versions of libiptc. + * irq plugin: Fix support for interrupts under Linux. The old code + assumed that interrupts have a numeric value -- this is no longer + true for Linux. Thanks to Bostjan Skufca for implementing this. + * notify_desktop plugin: Compatibility with libnotify 0.7 has been + added. Thanks to Samuli Suominen for his patch. + * processes plugin: Fix handling of regular expressions containing + spaces. Thanks for Sebastian Harl for fixing this. + * rrdtool, rrdcached plugins: Improve precision of the XFF parameter. + Previously, values like 0.999 would have been rounded to 1.0. Thanks + to Francois-Xavier Bourlet for fixing this. + * varnish plugin: Fix data type handling of some metrics. Some values + were submitted as gauge even though they were derives. + * Various plugin: Set a multi-threading flag in libcurl. Thanks to Mike + Flisher for the fix. + +2011-03-28, Version 5.0.0 + * collectd: The "FQDNLookup" option is now enabled by default. + * collectd: The internal representation of time has been changed to + allow a higher accuracy than one second. + * collectdcmd: This new command line utility can send various commands + to collectd using the UnixSock plugin. Thanks to Håkon Dugstad + Johnsen and Sebastian Harl for their code. + * collectd-nagios: The "-m" option has been implemented (treat NaNs as + critical). + * collectd-tg: Traffic generator creating bogus network traffic + compatible to the Network plugin. This utility can be used to + stress-test new write plugins and collectd in general. + * libcollectdclient: Creating and sending network packets has been + added to the collectd client library. + * All data sets: The data source name of all data sets with exactly + one data source has been changed to "value". + * All plugins: All "counter" data sources have been converted to + "derive" data sources. All plugins now use "derive" by default, but + plugins such as the network plugin can still handle "counter", of + course. The minimum value of all derive data sources is zero, the + maximum value is unspecified. + * amqp plugin: The new AMQP plugin can send data to and receive data + from an AMQP broker. Thanks to Sebastien Pahl for his code. + * apache plugin: Backwards compatibility code has been removed. + Support for the IBM HTTP Server has been added. Thanks to Manuel + Luis Sanmartín Rozada for his patch. + * contextswitch plugin: Support for sysctlbyname(3) has been added. + Thanks to Kimo Rosenbaum for his patch. + * df plugin: The default behavior has been changed to be equivalent to + the "ReportReserved" behavior of v4. + * dns plugin: Improved RFC 1035 name parsing has been imported from + "dnstop". + * exec plugin: Backwards compatibility code has been removed. + * GenericJMX plugin: The "InstancePrefix" option has been added to + "Connection" blocks. + * hddtemp plugin: The "TranslateDevicename" config option has been + removed. + * interface plugin: Use the "plugin instance" to store the interface + value. + * libvirt plugin: The "InterfaceFormat" option has been added. Thanks + to Ruben Kerkhof for his patch. + * lpar plugin: New plugins for "logical partitions", a virtualization + technique of POWER CPUs. Thanks to Aurélien Reynaud for his code and + patience. + * modbus plugin: Support for libmodbus 2.9.2 has been added and the + license has been changes to LGPLv2.1. + * mysql plugin: Backwards compatibility code has been removed. The + data sets used have been improved. + * network plugin: The default buffer size has been increased to + 1452 bytes. + * perl plugin: Backwards compatibility code has been removed. + * postgresql plugin: Backwards compatibility code has been removed. + * redis plugin: Plugin for collecting statistics from Redis, a key- + value store, has been added. Thanks to Andres J. Diaz for his code. + * swap plugin: Implement collection of physical and virtual memory + statistics under Solaris. The new default is collecting physical + memory. Thanks to Aurélien Reynaud for his patches. + * threshold plugin: The threshold configuration has been moved into + this separate plugin. + * unixsock plugin: The "DeleteSocket" option has been added. + * varnish plugin: The new Varnish plugin reads statistics from + Varnish, a web accelerator. Thanks to Jérôme Renard and Marc + Fournier for their contributions. + * write_redis: New plugin for writing data to Redis, a key-value + store. + * zfs_arc plugin: The data sets have been replaced by more elegant + alternatives. + * v5upgrade target: Target for converting v4 data sets to the v5 + schema. + + 2012-11-11, Version 4.10.8 + * collectd: Create new directories with mode 0777 and let umask remove + unwanted permission bits. + * collectd: Build issues have been fixed. + * collectd: An incorrect assertion has been fixed in some common code + for Solaris. This should resolve pseudo-random assertion failures + under Solaris. Thanks to Jeff Blane for his help debugging this. + * collectd: A couple of memory leaks through PThread thread attributes + have been fixed. Thanks to Gerrie Roos for fixing these. + * apcups plugin: Improve the reconnect behavior. + * df plugin: Ignore "rootfs" devices under Linux to avoid having them + reported twice. Thanks to Brune Prémont for fixing this. + * disk plugin: Fix incorrect computation of read and write latency (the + "disk_time" type). Previously, the numbers reported where too small + by a factor of "interval", e.g. when the interval is set to 10 + seconds, the values were too low by a factor of 10. Thanks to Manuel + Sanmartin for reporting this problem. + * dns plugin: A build issue under Solaris has been fixed. A erroneous + define that could lead to the reporting of bad data has been fixed by + Daniel Sutto. + * memcachec plugin: A bug in the configuration handling has been fixed. + Thanks to Pascal Hofmann for fixing this issue. + * netapp plugin: Correctly close the connection on communication + errors. + * netlink plugin: The function used to query statistics has been + changed to be more in line with iproute2's behavior. Thanks to + "KIvosak" for the patch. + * network plugin: Initialization of libgcrypt has been fixed. Thanks to + Chris Lundquist for his patch. + * oracle plugin: Error messages have been improved. + * ping plugin: Don't enter the exponential back-off mode when + ping_send() fails. This should make recovery after a network failure + much faster. + * python plugin: Memory leaks have been fixed. Thanks to Tommie Gannert + and Sven Trenkel for fixing this. + * rrdtool plugin: Fix an out-of-bounds array access when printing a + warning message. Thanks to Will Hawkins for fixing this bug. + * snmp plugin: Support for the SNMP_ENDOFMIBVIEW return value has been + added. Support for more complex / unusual MIBs / subtrees has been + added. Thanks to Mark Juric to test the changes and point out these + problems. + 2012-04-01, Version 4.10.7 * Build system: Fix the use of a libltdl macro. Thanks to Clemens Lang for fixing this. Adresses some issues with building the iptables diff --cc src/network.c index 3cf22274,d6e0dc01..1f8fe0ad --- a/src/network.c +++ b/src/network.c @@@ -3363,12 -3345,20 +3363,20 @@@ static int network_init (void * nothing more to do (for now, that is). */ if (have_init) return (0); - have_init = true; + have_init = 1; #if HAVE_LIBGCRYPT - gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); - gcry_control (GCRYCTL_INIT_SECMEM, 32768, 0); - gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); + /* http://lists.gnupg.org/pipermail/gcrypt-devel/2003-August/000458.html + * Because you can't know in a library whether another library has + * already initialized the library + */ + if (!gcry_control (GCRYCTL_ANY_INITIALIZATION_P)) + { + gcry_check_version(NULL); /* before calling any other functions */ + gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread); + gcry_control (GCRYCTL_INIT_SECMEM, 32768, 0); + gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); + } #endif if (network_config_stats != 0) diff --cc src/pyvalues.c index 9d8760a5,fd078822..307af175 --- a/src/pyvalues.c +++ b/src/pyvalues.c @@@ -351,9 -362,10 +362,9 @@@ static PyObject *Values_new(PyTypeObjec static int Values_init(PyObject *s, PyObject *args, PyObject *kwds) { Values *self = (Values *) s; - int interval = 0; - double time = 0; + double interval = 0, time = 0; PyObject *values = NULL, *meta = NULL, *tmp; - const char *type = "", *plugin_instance = "", *type_instance = "", *plugin = "", *host = ""; + char *type = NULL, *plugin_instance = NULL, *type_instance = NULL, *plugin = NULL, *host = NULL; static char *kwlist[] = {"type", "values", "plugin_instance", "type_instance", "plugin", "host", "time", "interval", "meta", NULL}; @@@ -489,12 -504,9 +503,8 @@@ static PyObject *Values_dispatch(Value value_t *value; value_list_t value_list = VALUE_LIST_INIT; PyObject *values = self->values, *meta = self->meta; - double time = self->data.time; - int interval = self->interval; + double time = self->data.time, interval = self->interval; - const char *host = self->data.host; - const char *plugin = self->data.plugin; - const char *plugin_instance = self->data.plugin_instance; - const char *type = self->data.type; - const char *type_instance = self->data.type_instance; + char *host = NULL, *plugin = NULL, *plugin_instance = NULL, *type = NULL, *type_instance = NULL; static char *kwlist[] = {"type", "values", "plugin_instance", "type_instance", "plugin", "host", "time", "interval", "meta", NULL}; @@@ -570,13 -589,8 +587,8 @@@ value_list.values = value; value_list.meta = cpy_build_meta(meta); value_list.values_len = size; - value_list.time = time; - value_list.interval = interval; + value_list.time = DOUBLE_TO_CDTIME_T(time); + value_list.interval = DOUBLE_TO_CDTIME_T(interval); - sstrncpy(value_list.host, host, sizeof(value_list.host)); - sstrncpy(value_list.plugin, plugin, sizeof(value_list.plugin)); - sstrncpy(value_list.plugin_instance, plugin_instance, sizeof(value_list.plugin_instance)); - sstrncpy(value_list.type, type, sizeof(value_list.type)); - sstrncpy(value_list.type_instance, type_instance, sizeof(value_list.type_instance)); if (value_list.host[0] == 0) sstrncpy(value_list.host, hostname_g, sizeof(value_list.host)); if (value_list.plugin[0] == 0) @@@ -600,13 -614,9 +612,8 @@@ static PyObject *Values_write(Values *s value_t *value; value_list_t value_list = VALUE_LIST_INIT; PyObject *values = self->values, *meta = self->meta; - double time = self->data.time; - int interval = self->interval; + double time = self->data.time, interval = self->interval; - const char *host = self->data.host; - const char *plugin = self->data.plugin; - const char *plugin_instance = self->data.plugin_instance; - const char *type = self->data.type; - const char *type_instance = self->data.type_instance; - const char *dest = NULL; + char *host = NULL, *plugin = NULL, *plugin_instance = NULL, *type = NULL, *type_instance = NULL, *dest = NULL; static char *kwlist[] = {"destination", "type", "values", "plugin_instance", "type_instance", "plugin", "host", "time", "interval", "meta", NULL}; @@@ -677,13 -693,8 +690,8 @@@ } value_list.values = value; value_list.values_len = size; - value_list.time = time; - value_list.interval = interval; + value_list.time = DOUBLE_TO_CDTIME_T(time); + value_list.interval = DOUBLE_TO_CDTIME_T(interval); - sstrncpy(value_list.host, host, sizeof(value_list.host)); - sstrncpy(value_list.plugin, plugin, sizeof(value_list.plugin)); - sstrncpy(value_list.plugin_instance, plugin_instance, sizeof(value_list.plugin_instance)); - sstrncpy(value_list.type, type, sizeof(value_list.type)); - sstrncpy(value_list.type_instance, type_instance, sizeof(value_list.type_instance)); value_list.meta = cpy_build_meta(meta);; if (value_list.host[0] == 0) sstrncpy(value_list.host, hostname_g, sizeof(value_list.host)); @@@ -874,7 -885,19 +882,19 @@@ static PyObject *Notification_dispatch( NULL, &plugin, NULL, &host, &t, &severity)) return NULL; - if (type[0] == 0) { - notification.time = t; ++ notification.time = DOUBLE_TO_CDTIME_T(t); + notification.severity = severity; + sstrncpy(notification.message, message ? message : self->message, sizeof(notification.message)); + sstrncpy(notification.host, host ? host : self->data.host, sizeof(notification.host)); + sstrncpy(notification.plugin, plugin ? plugin : self->data.plugin, sizeof(notification.plugin)); + sstrncpy(notification.plugin_instance, plugin_instance ? plugin_instance : self->data.plugin_instance, sizeof(notification.plugin_instance)); + sstrncpy(notification.type, type ? type : self->data.type, sizeof(notification.type)); + sstrncpy(notification.type_instance, type_instance ? type_instance : self->data.type_instance, sizeof(notification.type_instance)); + notification.meta = NULL; + FreeAll(); + PyMem_Free(message); + + if (notification.type[0] == 0) { PyErr_SetString(PyExc_RuntimeError, "type not set"); return NULL; } @@@ -884,17 -907,8 +904,8 @@@ return NULL; } - notification.time = DOUBLE_TO_CDTIME_T(t); - notification.severity = severity; - sstrncpy(notification.message, message, sizeof(notification.message)); - sstrncpy(notification.host, host, sizeof(notification.host)); - sstrncpy(notification.plugin, plugin, sizeof(notification.plugin)); - sstrncpy(notification.plugin_instance, plugin_instance, sizeof(notification.plugin_instance)); - sstrncpy(notification.type, type, sizeof(notification.type)); - sstrncpy(notification.type_instance, type_instance, sizeof(notification.type_instance)); - notification.meta = NULL; - if (notification.time < 1) - notification.time = time(0); + if (notification.time == 0) + notification.time = cdtime(); if (notification.host[0] == 0) sstrncpy(notification.host, hostname_g, sizeof(notification.host)); if (notification.plugin[0] == 0)