Merge branch 'collectd-5.7'
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 17 Dec 2016 17:56:47 +0000 (18:56 +0100)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 17 Dec 2016 17:56:47 +0000 (18:56 +0100)
ChangeLog
README
src/Makefile.am
src/email.c
src/target_set.c
src/utils_cmd_getthreshold.c
src/write_prometheus.c
version-gen.sh

index e42b231..db0b062 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,73 @@
+2016-12-12, Version 5.7.0
+       * Documentation: The Turbostat plugin section has been improved. Thanks
+         to Florian Forster
+       * Documentation: The semantics of the "TypesDB" option have been
+         improved. Thanks to Florian Forster.
+       * collectd: A generic interface for parsing the text protocol has been
+         added. Thanks to Sebastian Harl. #1749
+       * collectd: Threads now get named, making them easier to track using
+         tools such as top, ps, etc. Thanks to Manuel Luis SanmartĂ­n Rozada
+         and Marc Fournier. #547
+       * AMQP plugin, Write Graphite plugin, Write Kafka plugin: The new
+         "[Graphite]PreserveSeparator" option allows retaining the default dot
+         separator rather than escaping it. Thanks to Florian Forster. #419
+       * Battery plugin: A StateFS backend for gathering statistics has been
+         added. Thanks to Rinigus. #1795
+       * CPU plugin: CPU aggregation on AIX was fixed. Thanks to Chao Yang.
+         #1957
+       * Collectd::Unixsock: Fractional seconds support has been made more
+         robust. Thanks to Matthias Bethke. #2052
+       * DPDKStat plugin: This new plugin collects DPDK interface statistics.
+         Thanks to Maryam Tahhan, Harry van Haaren, Taras Chornyi and Kim
+         Jones. #1649
+       * gRPC plugin: The "DispatchValues" option has been renamed to
+         "PutValues". Thanks to Florian Forster.
+       * HDDTemp plugin: The 32 devices limit has been removed. Thanks to
+         Benjamin Gilbert. #631
+       * Hugepages plugin: This new plugin reports the number of used and free
+         hugepages on Linux. Thanks to Jaroslav Safka, Maryam Tahhan, Kim Jones
+         and Florian Forster. #1799
+       * Intel RDT plugin: This new plugin collects statistics exposed by
+         Intel's Resource Director Technology . Thanks to SerhiyX. #1970
+       * memcached plugin: The new "Address" option allows connecting to a
+         different server than specified by the "Host" option. Thanks to Pavel
+         Rochnyack. #1975
+       * nginx plugin: Support for reporting failed connections has been added.
+         Thanks to Pavel Rochnyack. #1609
+       * Perl plugin: Significant internal reworking has been made. The new
+         "RegisterLegacyFlush" option has been added. Thanks to Pavel
+         Rochnyack. #1731
+       * PostgreSQL plugin: Timestamps are now RFC 3339-formatted local time.
+         Thanks to Igor Peshansky and Dave Cunningham. #1918
+       * Processes plugin: Internal performance improvements have been made.
+         Thanks to Pavel Rochnyack. #1980, #1981
+       * RRDCacheD plugin: The plugin now tries to reconnect upon failed
+         operations. Thanks to Sebastian Harl. #1959
+       * SpamAssassin: The plugin can now run in Perl's "tainted mode" ("-T").
+         Thanks to Akos Vandra. #1962
+       * Tail plugin: Support for calculating latency distribution of matching
+         values has been added. Thanks to Pavel Rochnyack and Florian Forster.
+         #1700
+       * Tail plugin: The new "GaugePersist" option has been added. Thanks to
+         Florian Forster. #2015
+       * Target:Set, Target:Replace, Match:RegEx: MetaData support has been
+         added . Thanks to Igor Peshansky. #1922, #1923, #1930
+       * turbostat plugin: The new "LogicalCoreNames" option allows switching
+         to per-core naming rather than per-CPU. Thanks to Brock Johnson. #2056
+       * virt plugin: The new "BlockDeviceFormat" and
+         "BlockDeviceFormatBasename" options help controlling the names
+         reported for block-device metrics. Thanks to Deyan Chepishev. #2004
+       * Write Graphite plugin: A new "DropDuplicateFields" option has been
+         added. Thanks to Michael Leinartas. #1915
+       * Write Kafka plugin: The "Key Random" setting has been reintroduced.
+         Thanks to Florian Forster. #1977
+       * Write Log plugin: Support for formatting output in JSON has been
+         added, using the new "Format" configuration option. Thanks to Igor
+         Peshansky. #1924
+       * Write Prometheus plugin: This new plugin publishes values using an
+         embedded HTTP server, in a format compatible with Prometheus'
+         collectd_exporter. Thanks to Florian Forster. #1967
+
 2016-11-30, Version 5.6.2
        * collectd: A compile error on AIX has been fixed: "MSG_DONTWAIT" is not
          available on AIX. Thanks to Chao Yang.
diff --git a/README b/README
index 2fa8954..9e6f9bd 100644 (file)
--- a/README
+++ b/README
@@ -500,6 +500,10 @@ Features
     - write_mongodb
       Sends data to MongoDB, a NoSQL database.
 
+    - write_prometheus
+      Publish values using an embedded HTTP server, in a format compatible
+      with Prometheus' collectd_exporter.
+
     - write_redis
       Sends the values to a Redis key-value database server.
 
@@ -776,6 +780,10 @@ Prerequisites
     Used by the `memcachec' plugin to connect to a memcache daemon.
     <http://tangent.org/552/libmemcached.html>
 
+  * libmicrohttpd (optional)
+    Used by the write_prometheus plugin to run an http daemon.
+    <http://www.gnu.org/software/libmicrohttpd/>
+
   * libmnl (optional)
     Used by the `netlink' plugin.
     <http://www.netfilter.org/projects/libmnl/>
index 0fab4b3..9355c78 100644 (file)
@@ -442,7 +442,8 @@ endif
 if BUILD_PLUGIN_EXEC
 pkglib_LTLIBRARIES += exec.la
 exec_la_SOURCES = exec.c
-exec_la_LDFLAGS = $(PLUGIN_LDFLAGS) libcmds.la
+exec_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+exec_la_LIBADD = libcmds.la
 endif
 
 if BUILD_PLUGIN_ETHSTAT
@@ -1211,7 +1212,8 @@ endif
 if BUILD_PLUGIN_UNIXSOCK
 pkglib_LTLIBRARIES += unixsock.la
 unixsock_la_SOURCES = unixsock.c
-unixsock_la_LDFLAGS = $(PLUGIN_LDFLAGS) libcmds.la
+unixsock_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+unixsock_la_LIBADD =  libcmds.la
 endif
 
 if BUILD_PLUGIN_UPTIME
index 08d5729..72a8d6e 100644 (file)
@@ -361,8 +361,6 @@ static void *collect(void *arg) {
 } /* static void *collect (void *) */
 
 static void *open_connection(void __attribute__((unused)) * arg) {
-  struct sockaddr_un addr;
-
   const char *path = (NULL == sock_file) ? SOCK_PATH : sock_file;
   const char *group = (NULL == sock_group) ? COLLECTD_GRP_NAME : sock_group;
 
@@ -375,7 +373,9 @@ static void *open_connection(void __attribute__((unused)) * arg) {
     pthread_exit((void *)1);
   }
 
-  addr.sun_family = AF_UNIX;
+  struct sockaddr_un addr = {
+    .sun_family = AF_UNIX
+  };
   sstrncpy(addr.sun_path, path, (size_t)(UNIX_PATH_MAX - 1));
 
   errno = 0;
index 8b2b556..e9dbc1d 100644 (file)
@@ -183,8 +183,11 @@ static void ts_subst(char *dest, size_t size, const char *string, /* {{{ */
   REPLACE_FIELD("%{type_instance}", vl->type_instance);
 
   if (vl->meta != NULL) {
-    char **meta_toc;
+    char **meta_toc = NULL;
     int meta_entries = meta_data_toc(vl->meta, &meta_toc);
+    if (meta_entries <= 0)
+      return;
+
     for (int i = 0; i < meta_entries; i++) {
       char meta_name[DATA_MAX_NAME_LEN];
       char *value_str;
@@ -358,6 +361,7 @@ static int ts_invoke(const data_set_t *ds, value_list_t *vl, /* {{{ */
         ERROR("Target `set': Unable to get replacement metadata value `%s'.",
               key);
         strarray_free(meta_toc, (size_t)meta_entries);
+        meta_data_destroy(new_meta);
         return (status);
       }
 
@@ -373,6 +377,7 @@ static int ts_invoke(const data_set_t *ds, value_list_t *vl, /* {{{ */
       if (status) {
         ERROR("Target `set': Unable to set metadata value `%s'.", key);
         strarray_free(meta_toc, (size_t)meta_entries);
+        meta_data_destroy(new_meta);
         return (status);
       }
     }
index 491d776..063548b 100644 (file)
@@ -155,46 +155,29 @@ int handle_getthreshold(FILE *fh, char *buffer) {
   print_to_socket(fh, "%zu Threshold found\n", i);
 
   if (threshold.host[0] != 0)
-    print_to_socket(fh, "Host: %s\n", threshold.host) if (
-        threshold.plugin[0] !=
-        0) print_to_socket(fh, "Plugin: %s\n",
-                           threshold.plugin) if (threshold.plugin_instance[0] !=
-                                                 0)
-        print_to_socket(fh, "Plugin Instance: %s\n",
-                        threshold.plugin_instance) if (threshold.type[0] != 0)
-            print_to_socket(fh, "Type: %s\n", threshold.type) if (
-                threshold.type_instance[0] !=
-                0) print_to_socket(fh, "Type Instance: %s\n",
-                                   threshold
-                                       .type_instance) if (threshold.data_source
-                                                               [0] != 0)
-                print_to_socket(
-                    fh, "Data Source: %s\n",
-                    threshold.data_source) if (!isnan(threshold.warning_min))
-                    print_to_socket(
-                        fh, "Warning Min: %g\n",
-                        threshold
-                            .warning_min) if (!isnan(threshold.warning_max))
-                        print_to_socket(
-                            fh, "Warning Max: %g\n",
-                            threshold
-                                .warning_max) if (!isnan(threshold.failure_min))
-                            print_to_socket(
-                                fh, "Failure Min: %g\n",
-                                threshold
-                                    .failure_min) if (!isnan(threshold
-                                                                 .failure_max))
-                                print_to_socket(
-                                    fh, "Failure Max: %g\n",
-                                    threshold.failure_max) if (threshold
-                                                                   .hysteresis >
-                                                               0.0)
-                                    print_to_socket(
-                                        fh, "Hysteresis: %g\n",
-                                        threshold.hysteresis) if (threshold
-                                                                      .hits > 1)
-                                        print_to_socket(fh, "Hits: %i\n",
-                                                        threshold.hits)
-
-                                            return (0);
+    print_to_socket(fh, "Host: %s\n", threshold.host);
+  if (threshold.plugin[0] != 0)
+    print_to_socket(fh, "Plugin: %s\n", threshold.plugin);
+  if (threshold.plugin_instance[0] != 0)
+    print_to_socket(fh, "Plugin Instance: %s\n", threshold.plugin_instance);
+  if (threshold.type[0] != 0)
+    print_to_socket(fh, "Type: %s\n", threshold.type);
+  if (threshold.type_instance[0] != 0)
+    print_to_socket(fh, "Type Instance: %s\n", threshold.type_instance);
+  if (threshold.data_source[0] != 0)
+    print_to_socket(fh, "Data Source: %s\n", threshold.data_source);
+  if (!isnan(threshold.warning_min))
+    print_to_socket(fh, "Warning Min: %g\n", threshold.warning_min);
+  if (!isnan(threshold.warning_max))
+    print_to_socket(fh, "Warning Max: %g\n", threshold.warning_max);
+  if (!isnan(threshold.failure_min))
+    print_to_socket(fh, "Failure Min: %g\n", threshold.failure_min);
+  if (!isnan(threshold.failure_max))
+    print_to_socket(fh, "Failure Max: %g\n", threshold.failure_max);
+  if (threshold.hysteresis > 0.0)
+    print_to_socket(fh, "Hysteresis: %g\n", threshold.hysteresis);
+  if (threshold.hits > 1)
+    print_to_socket(fh, "Hits: %i\n", threshold.hits);
+
+  return (0);
 } /* int handle_getthreshold */
index 6dee98a..61c43fe 100644 (file)
@@ -694,8 +694,10 @@ metric_family_get(data_set_t const *ds, value_list_t const *vl, size_t ds_index,
     return fam;
   }
 
-  if (!allocate)
+  if (!allocate) {
+    sfree(name);
     return NULL;
+  }
 
   fam = metric_family_create(name, ds, vl, ds_index);
   if (fam == NULL) {
index 56daf44..2083ec3 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-DEFAULT_VERSION="5.6.2.git"
+DEFAULT_VERSION="5.7.0.git"
 
 if [ -d .git ]; then
        VERSION="`git describe --dirty=+ --abbrev=7 2> /dev/null | grep collectd | sed -e 's/^collectd-//' -e 's/-/./g'`"