Merge branch 'collectd-4.10'
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Fri, 9 Jul 2010 10:05:32 +0000 (12:05 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Fri, 9 Jul 2010 10:05:32 +0000 (12:05 +0200)
ChangeLog
bindings/java/Makefile.am
configure.in
contrib/collection3/etc/collection.conf
src/common.h
src/cpython.h
src/df.c
src/plugin.c
src/python.c
src/swap.c
version-gen.sh

index 75f5b19..c50ae2a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2010-07-09, Version 4.10.1
+       * Build system: Checking for "strtok_r" under Solaris has been fixed.
+       * Portability: Fixes for Solaris 8 have been applied. Thanks to
+         Alexander Wuerstlein for his patch.
+       * collectd: The shutdown speed when terminating the read threads has
+         been improved.
+       * libcollectdclient: A format error in the PUTVAL command has been
+         removed. Thanks to Johan Van den Brande for fixing this.
+       * df plugin: An error message shown when "cu_mount_getlist" fails has
+         been added.
+       * processes plugin: Missing initialization code for IO members of a
+         struct has been added. Thanks to Aurélien Reynaud for fixing this.
+       * python plugin: Memory leaks in the write and notification callbacks
+         have been fixed. A possible crash when the plugin was loaded but not
+         configured has been fixed. Thanks to Sven Trenkel for his patches.
+       * snmp plugin: Verbosity with regard to unknown ASN types has been
+         increased. A build problem on PowerPC and ARM processors has been
+         fixed by Aurélien Reynaud; thanks!
+       * powerdns plugin: Compatibility changes for PowerDNS 2.9.22 and above
+         have been applied. Thanks to Luke Heberling for his changes.
+
 2010-05-01, Version 4.10.0
        * collectd: JSON output now includes the "dstypes" and "dsnames"
          fields. This makes it easier for external applications to interpret
        * regex match: The "Invert" option has been added. Thanks to Julien
          Ammous for his patch.
 
+2010-07-09, Version 4.9.3
+       * Build system: Checking for "strtok_r" under Solaris has been fixed.
+       * Portability: Fixes for Solaris 8 have been applied. Thanks to
+         Aurélien Reynaud and Alexander Wuerstlein for their patches.
+       * collectd: The shutdown speed when terminating the read threads has
+         been improved.
+       * collectd-nagios: The format of the performance data has been fixed.
+       * libcollectdclient: A format error in the PUTVAL command has been
+         removed. Thanks to Johan Van den Brande for fixing this.
+       * df plugin: An error message shown when "cu_mount_getlist" fails has
+         been added.
+       * processes plugin: Missing initialization code for IO members of a
+         struct has been added. Thanks to Aurélien Reynaud for fixing this.
+       * python plugin: Memory leaks in the write and notification callbacks
+         have been fixed. A possible crash when the plugin was loaded but not
+         configured has been fixed. Thanks to Sven Trenkel for his patches.
+       * rrdcached plugin: A build issue has been resolved. Thanks to
+         Thorsten von Eicken for the patch.
+       * snmp plugin: Verbosity with regard to unknown ASN types has been
+         increased. A build problem on PowerPC and ARM processors has been
+         fixed by Aurélien Reynaud; thanks!
+       * powerdns plugin: Compatibility changes for PowerDNS 2.9.22 and above
+         have been applied. Thanks to Luke Heberling for his changes.
+
 2010-04-22, Version 4.9.2
        * Build system, various plugins: Fixes for AIX compatibility have been
          added. Thanks to Manuel Sanmartin for his patches.
index fa253f6..f8e936a 100644 (file)
@@ -24,7 +24,7 @@ EXTRA_DIST = org/collectd/api/CollectdConfigInterface.java \
             org/collectd/java/GenericJMX.java \
             org/collectd/java/JMXMemory.java
 
-java-build-stamp: org/collectd/api/*.java
+java-build-stamp: org/collectd/api/*.java org/collectd/java/*.java
        $(JAVAC) -d "." "$(srcdir)/org/collectd/api"/*.java
        $(JAVAC) -d "." "$(srcdir)/org/collectd/java"/*.java
        mkdir -p .libs
index 22910aa..fc12c08 100644 (file)
@@ -4175,7 +4175,7 @@ then
        plugin_vserver="yes"
        plugin_wireless="yes"
 
-       if test "x$have_net_ip_vs_h" = "xyes" -o "x$have_ip_vs_h" = "xyes"
+       if test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
        then
                plugin_ipvs="yes"
        fi
@@ -4647,7 +4647,7 @@ then
        with_librrd="yes (warning: librrd is not thread-safe)"
 fi
 
-if test "x$with_libiptc" = "xyes" -a "x$with_own_libiptc" = "xyes"
+if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
 then
        with_libiptc="yes (shipped version)"
 fi
index e56017e..9c5e3d1 100644 (file)
@@ -93,6 +93,13 @@ GraphWidth 400
   RRDOptions -l 0
   DSName "value Hit ratio"
 </Type>
+<Type bitrate>
+  DataSources value
+  RRDTitle "Bitrate ({instance})"
+  RRDVerticalLabel "Bit/s"
+  RRDFormat "%5.1lf%s"
+  DSName "value Bitrate"
+</Type>
 <Type cache_ratio>
   DataSources value
   DSName value Percent
@@ -143,13 +150,15 @@ GraphWidth 400
   RRDVerticalLabel "Byte"
   RRDFormat "%5.1lf%s"
   DSName "sis_saved         SIS saved         "
+  DSName "reserved          Reserved          "
   DSName "free              Free              "
   DSName "used              Used              "
   DSName "snap_normal_used  Snap used (normal)"
   DSName "snap_reserved     Snap reserved     "
   DSName "snap_reserve_used Snap used (resv)  "
-  Order sis_saved free used snap_normal_used snap_reserved snap_reserve_used
+  Order sis_saved reserved free used snap_normal_used snap_reserved snap_reserve_used
   Color sis_saved 00e0e0
+  Color reserved ffb000
   Color free  00ff00
   Color snap_reverse   ff8000
   Color used  ff0000
@@ -388,13 +397,27 @@ GraphWidth 400
   DSName "buffered Buffered"
   DSName   "locked Locked  "
   DSName     "used Used    "
+  DSName     "available Available    "
+  DSName  "system_cache System Cache "
+  DSName    "pool_paged Paged Pool   "
+  DSName "pool_nonpaged Nonpaged Pool"
+  DSName   "working_set Working Set  "
+  DSName   "system_code System Code  "
+  DSName "system_driver System Driver"
   #Order used buffered cached free
-  Order free cached buffered used
+  Order free cached buffered used available system_cache system_driver system_code pool_paged pool_nonpaged working_set
   Color free      00e000
   Color cached    0000ff
   Color buffered  ffb000
   Color locked    ff00ff
   Color used      ff0000
+  Color available      00e000
+  Color system_cache   0000ff
+  Color system_driver  ff00ff
+  Color system_code    a000a0
+  Color pool_paged     ffb000
+  Color pool_nonpaged  ff8000
+  Color working_set    ff0000
 </Type>
 <Type mysql_commands>
   Module GenericStacked
@@ -571,6 +594,27 @@ GraphWidth 400
   Color blocked  ff00ff
   Color stopped  a000a0
 </Type>
+<Type signal_power>
+  DataSources value
+  RRDTitle "Signal power ({instance})"
+  RRDVerticalLabel "dB"
+  RRDFormat "%5.1lf"
+  DSName "value Signal power"
+</Type>
+<Type signal_quality>
+  DataSources value
+  RRDTitle "Signal quality ({instance})"
+  RRDVerticalLabel "Percent"
+  RRDFormat "%5.1lf%%"
+  DSName "value Signal quality"
+</Type>
+<Type snr>
+  DataSources value
+  RRDTitle "Signal / noise ratio ({instance})"
+  RRDVerticalLabel "dBm"
+  RRDFormat "%5.1lf"
+  DSName "value S/N"
+</Type>
 <Type swap>
   Module GenericStacked
   DataSources value
index c0bea36..229f709 100644 (file)
@@ -291,6 +291,8 @@ counter_t counter_diff (counter_t old_value, counter_t new_value);
  * (in the range [1-65535]). Returns less than zero on error. */
 int service_name_to_port_number (const char *service_name);
 
+/** Parse a string to a derive_t value. Returns zero on success or non-zero on
+ * failure. If failure is returned, ret_value is not touched. */
 int strtoderive (const char *string, derive_t *ret_value);
 
 #endif /* COMMON_H */
index 2a14ce0..46e2301 100644 (file)
@@ -182,6 +182,7 @@ typedef struct {
        char type_instance[DATA_MAX_NAME_LEN];
 } PluginData;
 PyTypeObject PluginDataType;
+#define PluginData_New() PyObject_CallFunctionObjArgs((PyObject *) &PluginDataType, (void *) 0)
 
 typedef struct {
        PluginData data;
@@ -190,6 +191,7 @@ typedef struct {
        int interval;
 } Values;
 PyTypeObject ValuesType;
+#define Values_New() PyObject_CallFunctionObjArgs((PyObject *) &ValuesType, (void *) 0)
 
 typedef struct {
        PluginData data;
@@ -197,9 +199,11 @@ typedef struct {
        char message[NOTIF_MAX_MSG_LEN];
 } Notification;
 PyTypeObject NotificationType;
+#define Notification_New() PyObject_CallFunctionObjArgs((PyObject *) &NotificationType, (void *) 0)
 
 typedef PyLongObject Signed;
 PyTypeObject SignedType;
 
 typedef PyLongObject Unsigned;
 PyTypeObject UnsignedType;
+
index a96b79e..b2be8e5 100644 (file)
--- a/src/df.c
+++ b/src/df.c
@@ -172,7 +172,10 @@ static int df_read (void)
 
        mnt_list = NULL;
        if (cu_mount_getlist (&mnt_list) == NULL)
+       {
+               ERROR ("df plugin: cu_mount_getlist failed.");
                return (-1);
+       }
 
        for (mnt_ptr = mnt_list; mnt_ptr != NULL; mnt_ptr = mnt_ptr->next)
        {
index 3682fa5..4a3c917 100644 (file)
@@ -380,12 +380,15 @@ static void *plugin_read_thread (void __attribute__((unused)) *args)
                 * we need to re-evaluate the condition every time
                 * pthread_cond_timedwait returns. */
                rc = 0;
-               while (!timeout_reached(rf->rf_next_read) && rc == 0) {
+               while ((read_loop != 0)
+                               && !timeout_reached(rf->rf_next_read)
+                               && rc == 0)
+               {
                        rc = pthread_cond_timedwait (&read_cond, &read_lock,
                                &rf->rf_next_read);
                }
 
-               /* Must hold `real_lock' when accessing `rf->rf_type'. */
+               /* Must hold `read_lock' when accessing `rf->rf_type'. */
                rf_type = rf->rf_type;
                pthread_mutex_unlock (&read_lock);
 
index 6be727e..8772cd1 100644 (file)
@@ -335,7 +335,7 @@ static int cpy_read_callback(user_data_t *data) {
 static int cpy_write_callback(const data_set_t *ds, const value_list_t *value_list, user_data_t *data) {
        int i;
        cpy_callback_t *c = data->data;
-       PyObject *ret, *list, *temp, *dict = NULL;
+       PyObject *ret, *list, *temp, *dict = NULL, *val;
        Values *v;
 
        CPY_LOCK_THREADS
@@ -428,7 +428,8 @@ static int cpy_write_callback(const data_set_t *ds, const value_list_t *value_li
                        }
                        free(table);
                }
-               v = PyObject_New(Values, (void *) &ValuesType); /* New reference. */
+               val = Values_New(); /* New reference. */
+               v = (Values *) val; 
                sstrncpy(v->data.host, value_list->host, sizeof(v->data.host));
                sstrncpy(v->data.type, value_list->type, sizeof(v->data.type));
                sstrncpy(v->data.type_instance, value_list->type_instance, sizeof(v->data.type_instance));
@@ -436,10 +437,12 @@ static int cpy_write_callback(const data_set_t *ds, const value_list_t *value_li
                sstrncpy(v->data.plugin_instance, value_list->plugin_instance, sizeof(v->data.plugin_instance));
                v->data.time = value_list->time;
                v->interval = value_list->interval;
+               Py_CLEAR(v->values);
                v->values = list;
+               Py_CLEAR(v->meta);
                v->meta = dict;
                ret = PyObject_CallFunctionObjArgs(c->callback, v, c->data, (void *) 0); /* New reference. */
-               Py_XDECREF(v);
+               Py_XDECREF(val);
                if (ret == NULL) {
                        cpy_log_exception("write callback");
                } else {
@@ -451,11 +454,12 @@ static int cpy_write_callback(const data_set_t *ds, const value_list_t *value_li
 
 static int cpy_notification_callback(const notification_t *notification, user_data_t *data) {
        cpy_callback_t *c = data->data;
-       PyObject *ret;
+       PyObject *ret, *notify;
        Notification *n;
 
        CPY_LOCK_THREADS
-               n = PyObject_New(Notification, (void *) &NotificationType); /* New reference. */
+               notify = Notification_New(); /* New reference. */
+               n = (Notification *) notify;
                sstrncpy(n->data.host, notification->host, sizeof(n->data.host));
                sstrncpy(n->data.type, notification->type, sizeof(n->data.type));
                sstrncpy(n->data.type_instance, notification->type_instance, sizeof(n->data.type_instance));
@@ -465,7 +469,7 @@ static int cpy_notification_callback(const notification_t *notification, user_da
                sstrncpy(n->message, notification->message, sizeof(n->message));
                n->severity = notification->severity;
                ret = PyObject_CallFunctionObjArgs(c->callback, n, c->data, (void *) 0); /* New reference. */
-               Py_XDECREF(n);
+               Py_XDECREF(notify);
                if (ret == NULL) {
                        cpy_log_exception("notification callback");
                } else {
index e5cbf33..f5a0ea2 100644 (file)
@@ -211,25 +211,18 @@ static int swap_read (void)
                return (-1);
        }
 
-       while (fgets (buffer, 1024, fh) != NULL)
+       while (fgets (buffer, sizeof (buffer), fh) != NULL)
        {
-               derive_t *val = NULL;
-
-               if (strncasecmp (buffer, "SwapTotal:", 10) == 0)
-                       val = &swap_total;
-               else if (strncasecmp (buffer, "SwapFree:", 9) == 0)
-                       val = &swap_free;
-               else if (strncasecmp (buffer, "SwapCached:", 11) == 0)
-                       val = &swap_cached;
-               else
-                       continue;
-
-               numfields = strsplit (buffer, fields, 8);
-
+               numfields = strsplit (buffer, fields, STATIC_ARRAY_SIZE (fields));
                if (numfields < 2)
                        continue;
 
-               *val = (derive_t) atoll (fields[1]) * 1024LL;
+               if (strcasecmp (fields[0], "SwapTotal:") == 0)
+                       strtoderive (fields[1], &swap_total);
+               else if (strcasecmp (fields[0], "SwapFree:") == 0)
+                       strtoderive (fields[1], &swap_free);
+               else if (strcasecmp (fields[0], "SwapCached:") == 0)
+                       strtoderive (fields[1], &swap_cached);
        }
 
        if (fclose (fh))
@@ -258,7 +251,7 @@ static int swap_read (void)
                        old_kernel = 1;
        }
 
-       while (fgets (buffer, 1024, fh) != NULL)
+       while (fgets (buffer, sizeof (buffer), fh) != NULL)
        {
                numfields = strsplit (buffer, fields, STATIC_ARRAY_SIZE (fields));
 
@@ -292,10 +285,10 @@ static int swap_read (void)
                                sstrerror (errno, errbuf, sizeof (errbuf)));
        }
 
-       swap_submit ("used", swap_used, DS_TYPE_GAUGE);
-       swap_submit ("free", swap_free, DS_TYPE_GAUGE);
-       swap_submit ("cached", swap_cached, DS_TYPE_GAUGE);
-       swap_submit ("in", swap_in, DS_TYPE_DERIVE);
+       swap_submit ("used",   1024 * swap_used,   DS_TYPE_GAUGE);
+       swap_submit ("free",   1024 * swap_free,   DS_TYPE_GAUGE);
+       swap_submit ("cached", 1024 * swap_cached, DS_TYPE_GAUGE);
+       swap_submit ("in",  swap_in,  DS_TYPE_DERIVE);
        swap_submit ("out", swap_out, DS_TYPE_DERIVE);
 /* #endif KERNEL_LINUX */
 
index 8bb9946..6b3751d 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-DEFAULT_VERSION="4.10.0.git"
+DEFAULT_VERSION="4.10.1.git"
 
 VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`"
 
@@ -10,7 +10,7 @@ fi
 
 VERSION="`echo \"$VERSION\" | sed -e 's/-/./g'`"
 
-if test "x`uname -s`" = "xAIX" ; then 
+if test "x`uname -s`" = "xAIX" || test "x`uname -s`" = "xSunOS" ; then
        echo "$VERSION\c"
 else 
        echo -n "$VERSION"