Code

Merge branch 'collectd-5.7'
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 19 Feb 2017 12:07:39 +0000 (13:07 +0100)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 19 Feb 2017 12:07:39 +0000 (13:07 +0100)
Conflicts:
contrib/redhat/collectd.spec
src/Makefile.am
src/dpdkstat.c

ChangeLog
contrib/redhat/collectd.spec
src/daemon/plugin.c
src/intel_rdt.c
src/mqtt.c
version-gen.sh

index db0b0621126eeef1ada772da159de68b213ea165..9f1b639fc9f0081de2957664c64b0779edfbd93d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2017-01-23, Version 5.7.1
+       * collectd: Handling of boolean configuration options has been unified.
+         Thanks to Sebastian Harl. #2083, #2098
+       * collectd: Reporting of internal statistics has been fixed. Thanks to
+         Florian Forster. #2108
+       * collectd, various plugins: Bugs and issues reported by scan-build and
+         coverity-scan have been fixed. Thanks to Ruben Kerkhof and Florian
+         Forster.
+       * Build system: Parallel build have been fixed. Thanks to Ruben Kerkhof.
+         #2110
+       * DPDKStat plugin: Portability issues and a double-close bug have been
+         fixed. Thanks to Ruben Kerkhof and Marc Fournier.
+       * Intel RDT plugin: A check for the libpqos library version has been
+         added. Thanks to Serhiy Pshyk.
+       * NetApp plugin: Compilation problems have been corrected. Thanks to
+         Florian Forster. #2120
+       * Write Prometheus plugin: A memory leak has been fixed. Thanks to Ruben
+         Kerkhof.
+
 2016-12-12, Version 5.7.0
        * Documentation: The Turbostat plugin section has been improved. Thanks
          to Florian Forster
index 350c35790e8f44fb1defe6ac6a5a95dbcea83fa2..faf7ced73b3253ea9039a32a4d37d431529066a1 100644 (file)
 
 Summary:       Statistics collection and monitoring daemon
 Name:          collectd
-Version:       5.7.0
-Release:       4%{?dist}
+Version:       5.7.1
+Release:       1%{?dist}
 URL:           https://collectd.org
 Source:                https://collectd.org/files/%{name}-%{version}.tar.bz2
 License:       GPLv2
@@ -2632,6 +2632,9 @@ fi
 %doc contrib/
 
 %changelog
+* Tue Jan 01 2017 Marc Fournier <marc.fournier@camptocamp.com> - 5.7.1-1
+- New upstream version
+
 * Sat Dec 31 2016 Ruben Kerkhof <ruben@rubenkerkhof.com> - 5.7.0-4
 - Add new ovs_events plugin
 
index c8fc15a14866c9982b9ba3b6f9000b959545a2cb..b37e9b325c32e9492e92a3e29caa49a5e78d34e4 100644 (file)
@@ -153,14 +153,13 @@ static const char *plugin_get_dir(void) {
     return (plugindir);
 }
 
-static void plugin_update_internal_statistics(void) { /* {{{ */
-
+static int plugin_update_internal_statistics(void) { /* {{{ */
   gauge_t copy_write_queue_length = (gauge_t)write_queue_length;
 
   /* Initialize `vl' */
   value_list_t vl = VALUE_LIST_INIT;
-  sstrncpy(vl.host, hostname_g, sizeof(vl.host));
   sstrncpy(vl.plugin, "collectd", sizeof(vl.plugin));
+  vl.interval = plugin_get_interval();
 
   /* Write queue */
   sstrncpy(vl.plugin_instance, "write_queue", sizeof(vl.plugin_instance));
@@ -189,8 +188,8 @@ static void plugin_update_internal_statistics(void) { /* {{{ */
   vl.type_instance[0] = 0;
   plugin_dispatch_values(&vl);
 
-  return;
-} /* }}} void plugin_update_internal_statistics */
+  return 0;
+} /* }}} int plugin_update_internal_statistics */
 
 static void destroy_callback(callback_func_t *cf) /* {{{ */
 {
@@ -1558,8 +1557,10 @@ int plugin_init_all(void) {
   /* Init the value cache */
   uc_init();
 
-  if (IS_TRUE(global_option_get("CollectInternalStats")))
+  if (IS_TRUE(global_option_get("CollectInternalStats"))) {
     record_statistics = 1;
+    plugin_register_read("collectd", plugin_update_internal_statistics);
+  }
 
   chain_name = global_option_get("PreCacheChain");
   pre_cache_chain = fc_chain_get_by_name(chain_name);
@@ -1647,9 +1648,6 @@ int plugin_init_all(void) {
 
 /* TODO: Rename this function. */
 void plugin_read_all(void) {
-  if (record_statistics) {
-    plugin_update_internal_statistics();
-  }
   uc_check_timeout();
 
   return;
index 6beac7b42bc6fe02e375bd670103bd9c5e2e542e..e2e2e3940260580bb640dfec4da764f710821e0c 100644 (file)
 #define RDT_MAX_SOCKET_CORES 64
 #define RDT_MAX_CORES (RDT_MAX_SOCKET_CORES * RDT_MAX_SOCKETS)
 
+typedef enum {
+  UNKNOWN = 0,
+  CONFIGURATION_ERROR,
+} rdt_config_status;
+
 struct rdt_core_group_s {
   char *desc;
   size_t num_cores;
@@ -56,6 +61,8 @@ typedef struct rdt_ctx_s rdt_ctx_t;
 
 static rdt_ctx_t *g_rdt = NULL;
 
+static rdt_config_status g_state = UNKNOWN;
+
 static int isdup(const uint64_t *nums, size_t size, uint64_t val) {
   for (size_t i = 0; i < size; i++)
     if (nums[i] == val)
@@ -527,8 +534,14 @@ static int rdt_config(oconfig_item_t *ci) {
   int ret = 0;
 
   ret = rdt_preinit();
-  if (ret != 0)
-    return ret;
+  if (ret != 0) {
+    g_state = CONFIGURATION_ERROR;
+    /* if we return -1 at this point collectd
+      reports a failure in configuration and
+      aborts
+    */
+    goto exit;
+  }
 
   for (int i = 0; i < ci->children_num; i++) {
     oconfig_item_t *child = ci->children + i;
@@ -536,8 +549,14 @@ static int rdt_config(oconfig_item_t *ci) {
     if (strcasecmp("Cores", child->key) == 0) {
 
       ret = rdt_config_cgroups(child);
-      if (ret != 0)
-        return ret;
+      if (ret != 0) {
+        g_state = CONFIGURATION_ERROR;
+        /* if we return -1 at this point collectd
+           reports a failure in configuration and
+           aborts
+         */
+        goto exit;
+      }
 
 #if COLLECT_DEBUG
       rdt_dump_cgroups();
@@ -548,6 +567,7 @@ static int rdt_config(oconfig_item_t *ci) {
     }
   }
 
+exit:
   return (0);
 }
 
@@ -630,6 +650,9 @@ static int rdt_read(__attribute__((unused)) user_data_t *ud) {
 static int rdt_init(void) {
   int ret;
 
+  if(g_state == CONFIGURATION_ERROR)
+    return (-1);
+
   ret = rdt_preinit();
   if (ret != 0)
     return ret;
index 33785c8f9f62eda5ccc6858e249cadd25fb25d7d..a962514ce1b122f93503d9516928de8a3411579a 100644 (file)
@@ -448,6 +448,7 @@ static int publish(mqtt_client_conf_t *conf, char const *topic,
      * measure; we will try to reconnect the next time we have to publish a
      * message */
     conf->connected = 0;
+    mosquitto_disconnect(conf->mosq);
 
     pthread_mutex_unlock(&conf->lock);
     return (-1);
@@ -461,6 +462,7 @@ static int format_topic(char *buf, size_t buf_len, data_set_t const *ds,
                         value_list_t const *vl, mqtt_client_conf_t *conf) {
   char name[MQTT_MAX_TOPIC_SIZE];
   int status;
+  char *c;
 
   if ((conf->topic_prefix == NULL) || (conf->topic_prefix[0] == 0))
     return (FORMAT_VL(buf, buf_len, vl));
@@ -473,6 +475,10 @@ static int format_topic(char *buf, size_t buf_len, data_set_t const *ds,
   if ((status < 0) || (((size_t)status) >= buf_len))
     return (ENOMEM);
 
+  while((c = strchr(buf, '#')) || (c = strchr(buf, '+'))) {
+       *c = '_';
+  }
+
   return (0);
 } /* int format_topic */
 
index 2083ec38d6dd8a5d3bb4cdfe149507b45c670c36..bdbb847a7c79d99da4edc82b33fb61f658660255 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-DEFAULT_VERSION="5.7.0.git"
+DEFAULT_VERSION="5.7.1.git"
 
 if [ -d .git ]; then
        VERSION="`git describe --dirty=+ --abbrev=7 2> /dev/null | grep collectd | sed -e 's/^collectd-//' -e 's/-/./g'`"