Merge branch 'collectd-5.4'
authorMarc Fournier <marc.fournier@camptocamp.com>
Thu, 12 Mar 2015 09:07:27 +0000 (10:07 +0100)
committerMarc Fournier <marc.fournier@camptocamp.com>
Thu, 12 Mar 2015 09:07:27 +0000 (10:07 +0100)
Conflicts:
configure.ac
src/dbi.c
src/utils_latency.c

ChangeLog
configure.ac
src/collectd-exec.pod
src/daemon/plugin.c
src/dbi.c
src/exec.c
src/utils_latency.c
src/write_mongodb.c
version-gen.sh

index 8112afa..28be899 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,93 @@
+2015-02-26, Version 5.4.2
+       * Build system: Numerous fixes. Thanks to Bjørn Nordbø, Jim Radford,
+         KOMEDA Shinji, Lauri Tirkkonen, Manuel Luis Sanmartin Rozada, Marc
+         Fournier, Rainer Müller, Yoga Ramalingam and Yves Mettier. #326,
+         #373, #653, #828
+       * collectd: A use-after-free has been fixed in the "parse_value()"
+         function. Thanks to Matthias Urlichs.
+       * collectd: Fix carriage return sign in types_list Thanks to Marc
+         Fournier and @NsLib.
+       * collectd: Fix programming error in src/configfile.c. Thanks to
+         Wilfried Goesgens.
+       * collectd: An off-by-one error has been fixed in the
+         "strstripnewline()" function. Patch by Florian Forster.
+       * collectd: Use the complain mechanism to report filter chain write
+         failures. Thanks to Sebastian Harl.
+       * collectd: Spelling and grammar of error messages have been fixed.
+         Thanks to Katelyn Perry and Tim Laszlo.
+       * collectdctl: Fixed buffering issues which caused trouble on AIX and
+         Solaris. Thanks to Yoga Ramalingam.
+       * Documentation: Details and example about multi-instance filterchain
+         targets have been added. Thanks to Marc Fournier.
+       * Documentation: The "CollectStatistics" option of the rrdcached has
+         been documented. Thanks to Micha Krause. #907
+       * Documentation: The write_redis has been documented. Thanks to Marc
+         Fournier.
+       * Documentation: The "GraphiteSeparateInstances" and
+         "GraphiteAlwaysAppendDS" options of the amqp have been documented.
+         Thanks to Marc Fournier.
+       * Documentation: Documentation of the "AutoLoadPlugin" option has been
+         improved. Thanks to Florian Forster. #715
+       * aggregation: "utils_vl_lookup": A race when creating user objects
+         has been fixed. Thanks to Sebastian Harl. #535
+       * cpu: Temperature code for Mac&nbsp;OS&nbsp;X has been removed.
+         Thanks to Florian Forster and Marc Fournier. #22
+       * cURL, cURL-JSON, cURL-XML and Write HTTP plugins: Call
+         "curl_global_init()" in the plugins' "init()" callback. Thanks to
+         Jeremy Katz.
+       * cURL and memcachec plugins: Fix calculation of gauge, average,
+         minimum and maximum. Previously, they were calculated from the start
+         of the daemon, which is not the documented behavior. Thanks to
+         Florian Forster. #663
+       * curl-json: A bug, which triggered when two URLs with a long common
+         prefix were configured, was fixed. Thanks to Marc Fournier. #582
+       * dbi: Compatibility with new versions of libdbi has been restored.
+         Thanks to Florian Forster. #950
+       * Exec, UnixSock plugins: Fix parsing of the "time" option of the
+         "PUTNOTIF" command. Thanks to Adrian Miron. #477
+       * ipmi: A conflict with the java over the "SIGUSR2" signal has been
+         fixed. Thanks to Vincent Bernat. #114
+       * java: Conversion from Java's time representation to collectd's
+         representation has been fixed. Thanks to Manuel Luis Sanmartín
+         Rozada.
+       * java: Make sure "cjni_thread_detach()" is called on all paths.
+         Thanks to Florian Forster.
+       * LogFile and SysLog plugins: Avoid total silence in case of a
+         misconfiguration. Thanks to Marc Fournier and Wilfried Goesgens.
+       * network: Support for recent versions of gcrypt has been added.
+         Thanks to Vincent Bernat. #632
+       * network: Robustness of the client connecting behavior has been
+         improved. Thanks to Florian Forster. #627
+       * python: Don't create empty "meta_data_t" objects. Thanks to Florian
+         Forster. #716
+       * python: Fix Py list length check in "cpy_build_meta()". Thanks to
+         Yoga Ramalingam.
+       * python: The "interval" member was fixed to export seconds as a
+         double. Thanks to Justin Burnham.
+       * RRDtool and RRDCacheD plugins: A memory leak when creating RRD files
+         has been fixed. Thanks to Yves Mettier. #661
+       * snmp: Fix a memory leak. Thanks to Marc Fournier and Pierre-Yves
+         Ritschard. #610, #804
+       * statsd: Support for samplerates in timer metrics was added. Thanks
+         to John Leach. #461
+       * swap: Fix behavior under OpenVZ by making "cached" optional. Thanks
+         to Florian Forster. #733
+       * threshold: Population of the "time" field in notifications has been
+         added. Thanks to Manuel Luis Sanmartín Rozada.
+       * libvirt: Only gather stats for running domains. Thanks to Ruben
+         Kerkhof.
+       * lvm: An issue with Volume Groups (VGs) without Logical Volumes (LVs)
+         has been fixed. Thanks to Jan Kundrát.
+       * write_graphite: Escape characters not supported by Graphite. Thanks
+         to Pierre-Yves Ritschard and Marc Fournier.
+       * write_http: Make callback names context-dependent. Thanks to Marc
+         Fournier. #821
+       * write_redis: A formatting bug, which resulted in totally unusable
+         numbers being transmitted to Redis, was fixed. Thanks to Marc
+         Fournier.
+       * write_riemann: Receive acknowledge message when using TCP. Thanks to
+         John-John Tedro.
+
 2014-01-26, Version 5.4.1
        * amqp plugin: Add support for RabbitMQ 0.4.x to avoid compiler
          warnings. Thanks to Sebastian Harl for implementing this.
        * zfs_arc plugin: Support for FreeBSD has been added. Thanks to Xin Li
          for his patch.
 
+2015-02-26, Version 5.3.2
+       * Build system: Numerous fixes. Thanks to Bjørn Nordbø, Jim Radford,
+         KOMEDA Shinji, Lauri Tirkkonen, Manuel Luis Sanmartin Rozada, Marc
+         Fournier, Rainer Müller, Yoga Ramalingam and Yves Mettier. #326,
+         #373, #653, #828
+       * collectd: A use-after-free has been fixed in the "parse_value()"
+         function. Thanks to Matthias Urlichs.
+       * collectd: Fix carriage return sign in types_list Thanks to Marc
+         Fournier and @NsLib.
+       * collectd: Fix programming error in src/configfile.c Thanks to
+         Wilfried Goesgens.
+       * collectd: An off-by-one error has been fixed in the
+         "strstripnewline()" function. Patch by Florian Forster.
+       * collectd: Use the complain mechanism to report filter chain write
+         failures. Thanks to Sebastian Harl.
+       * collectd: Spelling and grammar of error messages have been fixed.
+         Thanks to Katelyn Perry and Tim Laszlo.
+       * collectdctl: Fixed buffering issues which caused trouble on AIX and
+         Solaris. Thanks to Yoga Ramalingam.
+       * Documentation: Details and example about multi-instance filterchain
+         targets have been added. Thanks to Marc Fournier.
+       * Documentation: The "CollectStatistics" option of the rrdcached has
+         been documented. Thanks to Micha Krause. #907
+       * Documentation: The write_redis has been documented. Thanks to Marc
+         Fournier.
+       * Documentation: The synopsis of the threshold has been fixed. Thanks
+         to Fabien Wernli.
+       * Documentation: The "GraphiteSeparateInstances" and
+         "GraphiteAlwaysAppendDS" options of the amqp have been documented.
+         Thanks to Marc Fournier.
+       * aggregation: "utils_vl_lookup": A race when creating user objects
+         has been fixed. Thanks to Sebastian Harl. #535
+       * cpu: Temperature code for Mac&nbsp;OS&nbsp;X has been removed.
+         Thanks to Florian Forster and Marc Fournier. #22
+       * csv: A regression which would lead to the "DataDir" option to be
+         ignored has been fixed. Thanks to Manuel Luis Sanmartin Rozada.
+       * curl, curl-json, curl-xml and write_http plugins: Call
+         "curl_global_init()" in the plugins' "init()" callback. Thanks to
+         Jeremy Katz.
+       * curl and memcachec plugins: Fix calculation of gauge, average,
+         minimum and maximum. Previously, they were calculated from the start
+         of the daemon, which is not the documented behavior. Thanks to
+         Florian Forster. #663
+       * dbi plugin: Compatibility with new versions of libdbi has been
+         restored. Thanks to Florian Forster. #950
+       * exec, unixsock plugins: Fix parsing of the "time" option of the
+         "PUTNOTIF" command. Thanks to Adrian Miron. #477
+       * java: Conversion from Java's time representation to collectd's
+         representation has been fixed. Thanks to Manuel Luis Sanmartín
+         Rozada.
+       * ipmi: A conflict with the java over the "SIGUSR2" signal has been
+         fixed. Thanks to Vincent Bernat. #114
+       * java: Make sure "cjni_thread_detach()" is called on all paths.
+         Thanks to Florian Forster.
+       * logfile and syslog plugins: Avoid total silence in case of a
+         misconfiguration. Thanks to Marc Fournier and Wilfried Goesgens.
+       * memcached: Connecting to a UNIX socket has been fixed. Thanks to Jim
+         Radford.
+       * network: Support for recent versions of gcrypt has been added.
+         Thanks to Vincent Bernat. #632
+       * network: Robustness of the client connecting behavior has been
+         improved. Thanks to Florian Forster. #627
+       * python: Don't create empty "meta_data_t" objects. Thanks to Florian
+         Forster. #716
+       * python: Fix Py list length check in "cpy_build_meta()". Thanks to
+         Yoga Ramalingam.
+       * python: The "interval" member was fixed to export seconds as a
+         double. Thanks to Justin Burnham.
+       * replace and set targets: Fix error message. Thanks to Marc Fournier.
+         #448
+       * rrdtool and rrdcached plugins: Honor the "DataDir" config option;
+         this fixes a regression. Thanks to Florian Forster. #380
+       * rrdtool and rrdcached plugins: A memory leak when creating RRD files
+         has been fixed. Thanks to Yves Mettier. #661
+       * snmp: Fix a memory leak. Thanks to Marc Fournier and Pierre-Yves
+         Ritschard. #610, #804
+       * swap: Fix behavior under OpenVZ by making "cached" optional. Thanks
+         to Florian Forster. #733
+       * threshold: Population of the "time" field in notifications has been
+         added. Thanks to Manuel Luis Sanmartín Rozada.
+       * libvirt: Only gather stats for running domains. Thanks to Ruben
+         Kerkhof.
+       * write_graphite: Escape characters not supported by Graphite. Thanks
+         to Pierre-Yves Ritschard and Marc Fournier.
+       * write_http: Make callback names context-dependent. Thanks to Marc
+         Fournier. #821
+       * write_riemann: Receive acknowledge message when using TCP. Thanks to
+         John-John Tedro.
+
 2013-07-13, Version 5.3.1
        * Documentation: Various fixes.
        * Configuration: Fix error handling: Errors in included files were
index dc61f05..c83805e 100644 (file)
@@ -5775,10 +5775,11 @@ Configuration:
     libatasmart . . . . . $with_libatasmart
     libcurl . . . . . . . $with_libcurl
     libdbi  . . . . . . . $with_libdbi
-    libhiredis  . . . . . $with_libhiredis
     libesmtp  . . . . . . $with_libesmtp
     libganglia  . . . . . $with_libganglia
     libgcrypt . . . . . . $with_libgcrypt
+    libhal  . . . . . . . $with_libhal
+    libhiredis  . . . . . $with_libhiredis
     libi2c-dev  . . . . . $with_libi2c
     libiokit  . . . . . . $with_libiokit
     libiptc . . . . . . . $with_libiptc
@@ -5790,6 +5791,7 @@ Configuration:
     libmemcached  . . . . $with_libmemcached
     libmnl  . . . . . . . $with_libmnl
     libmodbus . . . . . . $with_libmodbus
+    libmongoc . . . . . . $with_libmongoc
     libmysql  . . . . . . $with_libmysql
     libnetapp . . . . . . $with_libnetapp
     libnetsnmp  . . . . . $with_libnetsnmp
@@ -5797,6 +5799,7 @@ Configuration:
     liboconfig  . . . . . $with_liboconfig
     libopenipmi . . . . . $with_libopenipmipthread
     liboping  . . . . . . $with_liboping
+    libowcapi . . . . . . $with_libowcapi
     libpcap . . . . . . . $with_libpcap
     libperfstat . . . . . $with_perfstat
     libperl . . . . . . . $with_libperl
@@ -5817,9 +5820,8 @@ Configuration:
     libxml2 . . . . . . . $with_libxml2
     libxmms . . . . . . . $with_libxmms
     libyajl . . . . . . . $with_libyajl
-    libevent  . . . . . . $with_libevent
-    protobuf-c  . . . . . $have_protoc_c
     oracle  . . . . . . . $with_oracle
+    protobuf-c  . . . . . $have_protoc_c
     python  . . . . . . . $with_python
 
   Features:
@@ -5834,16 +5836,16 @@ Configuration:
     amqp    . . . . . . . $enable_amqp
     apache  . . . . . . . $enable_apache
     apcups  . . . . . . . $enable_apcups
-    aquaero . . . . . . . $enable_aquaero
     apple_sensors . . . . $enable_apple_sensors
+    aquaero . . . . . . . $enable_aquaero
     ascent  . . . . . . . $enable_ascent
     barometer . . . . . . $enable_barometer
     battery . . . . . . . $enable_battery
     bind  . . . . . . . . $enable_bind
     ceph  . . . . . . . . $enable_ceph
+    cgroups . . . . . . . $enable_cgroups
     conntrack . . . . . . $enable_conntrack
     contextswitch . . . . $enable_contextswitch
-    cgroups . . . . . . . $enable_cgroups
     cpu . . . . . . . . . $enable_cpu
     cpufreq . . . . . . . $enable_cpufreq
     csv . . . . . . . . . $enable_csv
@@ -5871,8 +5873,8 @@ Configuration:
     java  . . . . . . . . $enable_java
     load  . . . . . . . . $enable_load
     logfile . . . . . . . $enable_logfile
-    lpar  . . . . . . . . $enable_lpar
     log_logstash  . . . . $enable_log_logstash
+    lpar  . . . . . . . . $enable_lpar
     lvm . . . . . . . . . $enable_lvm
     madwifi . . . . . . . $enable_madwifi
     match_empty_counter . $enable_match_empty_counter
@@ -5926,8 +5928,8 @@ Configuration:
     swap  . . . . . . . . $enable_swap
     syslog  . . . . . . . $enable_syslog
     table . . . . . . . . $enable_table
-    tail  . . . . . . . . $enable_tail
     tail_csv  . . . . . . $enable_tail_csv
+    tail  . . . . . . . . $enable_tail
     tape  . . . . . . . . $enable_tape
     target_notification . $enable_target_notification
     target_replace  . . . $enable_target_replace
index 5f2c687..10f9f61 100644 (file)
@@ -201,13 +201,13 @@ The data is passed to the executables over C<STDIN> in a format very similar to
 HTTP: At first there is a "header" with one line per field. Every line consists
 of a field name, ended by a colon, and the associated value until end-of-line.
 The "header" is ended by two newlines immediately following another,
-i.E<nbsp>e. an empty line. The rest, basically the "body", is the message of
-the notification.
+i.e. an empty line. The rest, basically the "body", is the message of the
+notification.
 
 The following is an example notification passed to a program:
 
   Severity: FAILURE
-  Time: 1200928930
+  Time: 1200928930.515
   Host: myhost.mydomain.org
   \n
   This is a test notification to demonstrate the format
@@ -223,7 +223,9 @@ Severity of the notification. May either be B<FAILURE>, B<WARNING>, or B<OKAY>.
 
 =item B<Time>
 
-The time in epoch, i.E<nbsp>e. as seconds since 1970-01-01 00:00:00 UTC.
+The time in epoch, i.e. as seconds since 1970-01-01 00:00:00 UTC. The value
+currently has millisecond precision (i.e. three decimal places), but scripts
+should accept arbitrary numbers of decimal places, including no decimal places.
 
 =item B<Host>
 
index 3a95f36..25bd37b 100644 (file)
@@ -949,7 +949,6 @@ int plugin_load (char const *plugin_name, uint32_t flags)
        const char *dir;
        char  filename[BUFSIZE] = "";
        char  typename[BUFSIZE];
-       int   typename_len;
        int   ret;
        struct stat    statbuf;
        struct dirent *de;
@@ -989,7 +988,6 @@ int plugin_load (char const *plugin_name, uint32_t flags)
                WARNING ("plugin_load: Filename too long: \"%s.so\"", plugin_name);
                return (-1);
        }
-       typename_len = strlen (typename);
 
        if ((dh = opendir (dir)) == NULL)
        {
@@ -1001,7 +999,7 @@ int plugin_load (char const *plugin_name, uint32_t flags)
 
        while ((de = readdir (dh)) != NULL)
        {
-               if (strncasecmp (de->d_name, typename, typename_len))
+               if (strcasecmp (de->d_name, typename))
                        continue;
 
                status = ssnprintf (filename, sizeof (filename),
index 7fec73c..a7963ea 100644 (file)
--- a/src/dbi.c
+++ b/src/dbi.c
@@ -1,6 +1,6 @@
 /**
  * collectd - src/dbi.c
- * Copyright (C) 2008-2013  Florian octo Forster
+ * Copyright (C) 2008-2015  Florian octo Forster
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
 
 #include <dbi/dbi.h>
 
+/* libdbi 0.9.0 introduced a new thread-safe interface and marked the old
+ * functions "deprecated". These macros convert the new functions to their old
+ * counterparts for backwards compatibility. */
+#if !defined(LIBDBI_VERSION) || (LIBDBI_VERSION < 900)
+# define HAVE_LEGACY_LIBDBI 1
+# define dbi_initialize_r(a,inst) dbi_initialize(a)
+# define dbi_shutdown_r(inst) dbi_shutdown()
+# define dbi_set_verbosity_r(a,inst) dbi_set_verbosity(a)
+# define dbi_driver_list_r(a,inst) dbi_driver_list(a)
+# define dbi_driver_open_r(a,inst) dbi_driver_open(a)
+#endif
+
 /*
  * Data types
  */
@@ -68,6 +80,9 @@ typedef struct cdbi_database_s cdbi_database_t; /* }}} */
 /*
  * Global variables
  */
+#if !defined(HAVE_LEGACY_LIBDBI) || !HAVE_LEGACY_LIBDBI
+static dbi_inst          dbi_instance  = 0;
+#endif
 static udb_query_t     **queries       = NULL;
 static size_t            queries_num   = 0;
 static cdbi_database_t **databases     = NULL;
@@ -451,20 +466,20 @@ static int cdbi_init (void) /* {{{ */
     return (-1);
   }
 
-  status = dbi_initialize (NULL);
+  status = dbi_initialize_r (/* driverdir = */ NULL, &dbi_instance);
   if (status < 0)
   {
-    ERROR ("dbi plugin: cdbi_init: dbi_initialize failed with status %i.",
+    ERROR ("dbi plugin: cdbi_init: dbi_initialize_r failed with status %i.",
         status);
     return (-1);
   }
   else if (status == 0)
   {
-    ERROR ("dbi plugin: `dbi_initialize' could not load any drivers. Please "
+    ERROR ("dbi plugin: `dbi_initialize_r' could not load any drivers. Please "
         "install at least one `DBD' or check your installation.");
     return (-1);
   }
-  DEBUG ("dbi plugin: cdbi_init: dbi_initialize reports %i driver%s.",
+  DEBUG ("dbi plugin: cdbi_init: dbi_initialize_r reports %i driver%s.",
       status, (status == 1) ? "" : "s");
 
   return (0);
@@ -672,16 +687,16 @@ static int cdbi_connect_database (cdbi_database_t *db) /* {{{ */
     db->connection = NULL;
   }
 
-  driver = dbi_driver_open (db->driver);
+  driver = dbi_driver_open_r (db->driver, dbi_instance);
   if (driver == NULL)
   {
-    ERROR ("dbi plugin: cdbi_connect_database: dbi_driver_open (%s) failed.",
+    ERROR ("dbi plugin: cdbi_connect_database: dbi_driver_open_r (%s) failed.",
         db->driver);
     INFO ("dbi plugin: Maybe the driver isn't installed? "
         "Known drivers are:");
-    for (driver = dbi_driver_list (NULL);
+    for (driver = dbi_driver_list_r (NULL, dbi_instance);
         driver != NULL;
-        driver = dbi_driver_list (driver))
+        driver = dbi_driver_list_r (driver, dbi_instance))
     {
       INFO ("dbi plugin: * %s", dbi_driver_get_name (driver));
     }
index a2b0915..3f68e8b 100644 (file)
@@ -745,8 +745,8 @@ static void *exec_notification_one (void *arg) /* {{{ */
 
   fprintf (fh,
       "Severity: %s\n"
-      "Time: %u\n",
-      severity, (unsigned int)CDTIME_T_TO_TIME_T(n->time));
+      "Time: %.3f\n",
+      severity, CDTIME_T_TO_DOUBLE (n->time));
 
   /* Print the optional fields */
   if (strlen (n->host) > 0)
index b0ef359..7f60e11 100644 (file)
@@ -102,7 +102,7 @@ void change_bin_width (latency_counter_t *lc, size_t val) /* {{{ */
       DEBUG("utils_latency: change_bin_width: fixed all bins");
   }
 
-  DEBUG("utils_latency: change_bin_width: val-[%ld], oldBinWidth-[%d], "
+  DEBUG("utils_latency: change_bin_width: val-[%zu], oldBinWidth-[%d], "
           "newBinWidth-[%d], required_bin_width-[%f], "
           "required_bin_width_logbase2-[%f]",
           val, old_bin_width, new_bin_width, required_bin_width,
index 30e261c..24151ce 100644 (file)
 #endif
 #include <mongo.h>
 
+#if (MONGO_MAJOR == 0) && (MONGO_MINOR < 8)
+# define bson_alloc()    bson_create()
+# define bson_dealloc(b) bson_dispose(b)
+#endif
+
 struct wm_node_s
 {
   char name[DATA_MAX_NAME_LEN];
@@ -74,7 +79,7 @@ static bson *wm_create_bson (const data_set_t *ds, /* {{{ */
   gauge_t *rates;
   int i;
 
-  ret = bson_create ();
+  ret = bson_alloc (); /* matched by bson_dealloc() */
   if (ret == NULL)
   {
     ERROR ("write_mongodb plugin: bson_create failed.");
@@ -95,7 +100,7 @@ static bson *wm_create_bson (const data_set_t *ds, /* {{{ */
     rates = NULL;
   }
 
-  bson_init (ret);
+  bson_init (ret); /* matched by bson_destroy() */
   bson_append_date (ret, "time", (bson_date_t) CDTIME_T_TO_MS (vl->time));
   bson_append_string (ret, "host", vl->host);
   bson_append_string (ret, "plugin", vl->plugin);
@@ -243,7 +248,8 @@ static int wm_write (const data_set_t *ds, /* {{{ */
   pthread_mutex_unlock (&node->lock);
 
   /* free our resource as not to leak memory */
-  bson_dispose (bson_record);
+  bson_destroy (bson_record); /* matches bson_init() */
+  bson_dealloc (bson_record); /* matches bson_alloc() */
 
   return (0);
 } /* }}} int wm_write */
index 6b5e40e..e251950 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 
-DEFAULT_VERSION="5.4.1.git"
+DEFAULT_VERSION="5.4.2.git"
 
 VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"