From: Florian Forster Date: Mon, 14 Mar 2011 19:06:53 +0000 (+0100) Subject: Merge branch 'collectd-4.9' into collectd-4.10 X-Git-Tag: collectd-4.10.3~2 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=e04cfcb9d1f1eed00bf11768db6d0540babe2e4e;hp=ce0118ae5a67654cce06dddc9998dc494beb4251;p=collectd.git Merge branch 'collectd-4.9' into collectd-4.10 --- diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index bfb73095..187133cd 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -1911,8 +1911,10 @@ Hostname of the database server. Defaults to B. =item B I Username to use when connecting to the database. The user does not have to be -granted any privileges (which is synonym to granting the C privilege). -Any existing MySQL user will do. +granted any privileges (which is synonym to granting the C privilege), +unless you want to collectd replication statistics (see B and +B below). In this case, the user needs the C +(or C) privileges. Else, any existing MySQL user will do. =item B I @@ -1944,7 +1946,9 @@ C function for details. =item B I -Enable the collection of master / slave statistics in a replication setup. +Enable the collection of master / slave statistics in a replication setup. In +order to be able to get access to these statistics, the user needs special +privileges. See the B documentation above. =item B I @@ -2712,7 +2716,8 @@ and are checked by default depends on the distribution you use. This plugin sends a desktop notification to a notification daemon, as defined in the Desktop Notification Specification. To actually display the notifications, B is required and B has to be -able to access the X server. +able to access the X server (i.Ee., the C and C +environment variables have to be set correctly) and the D-Bus message bus. The Desktop Notification Specification can be found at L. diff --git a/src/filter_chain.c b/src/filter_chain.c index 4b164dc3..ed2df61c 100644 --- a/src/filter_chain.c +++ b/src/filter_chain.c @@ -22,6 +22,7 @@ #include "collectd.h" #include "configfile.h" #include "plugin.h" +#include "utils_complain.h" #include "common.h" #include "filter_chain.h" @@ -692,10 +693,15 @@ static int fc_bit_write_invoke (const data_set_t *ds, /* {{{ */ if ((plugin_list == NULL) || (plugin_list[0] == NULL)) { + static c_complain_t enoent_complaint = C_COMPLAIN_INIT_STATIC; + status = plugin_write (/* plugin = */ NULL, ds, vl); if (status == ENOENT) { - INFO ("Filter subsystem: Built-in target `write': Dispatching value to " + /* in most cases this is a permanent error, so use the complain + * mechanism rather than spamming the logs */ + c_complain (LOG_INFO, &enoent_complaint, + "Filter subsystem: Built-in target `write': Dispatching value to " "all write plugins failed with status %i (ENOENT). " "Most likely this means you didn't load any write plugins.", status); @@ -705,6 +711,13 @@ static int fc_bit_write_invoke (const data_set_t *ds, /* {{{ */ INFO ("Filter subsystem: Built-in target `write': Dispatching value to " "all write plugins failed with status %i.", status); } + else + { + assert (status == 0); + c_release (LOG_INFO, &enoent_complaint, "Filter subsystem: " + "Built-in target `write': Some write plugin is back to normal " + "operation. `write' succeeded."); + } } else { diff --git a/src/plugin.c b/src/plugin.c index af894d54..9b7cb211 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -280,8 +280,6 @@ static int plugin_load_file (char *file, uint32_t flags) lt_dlhandle dlh; void (*reg_handle) (void); - DEBUG ("file = %s", file); - lt_dlinit (); lt_dlerror (); /* clear errors */ @@ -297,23 +295,35 @@ static int plugin_load_file (char *file, uint32_t flags) } #else /* if LIBTOOL_VERSION == 1 */ if (flags & PLUGIN_FLAGS_GLOBAL) - ERROR ("plugin_load_file: The global flag is not supported, " + WARNING ("plugin_load_file: The global flag is not supported, " "libtool 2 is required for this."); dlh = lt_dlopen (file); #endif if (dlh == NULL) { - const char *error = lt_dlerror (); + char errbuf[1024] = ""; + + ssnprintf (errbuf, sizeof (errbuf), + "lt_dlopen (\"%s\") failed: %s. " + "The most common cause for this problem are " + "missing dependencies. Use ldd(1) to check " + "the dependencies of the plugin " + "/ shared object.", + file, lt_dlerror ()); + + ERROR ("%s", errbuf); + /* Make sure this is printed to STDERR in any case, but also + * make sure it's printed only once. */ + if (list_log != NULL) + fprintf (stderr, "ERROR: %s\n", errbuf); - ERROR ("lt_dlopen (%s) failed: %s", file, error); - fprintf (stderr, "lt_dlopen (%s) failed: %s\n", file, error); return (1); } if ((reg_handle = (void (*) (void)) lt_dlsym (dlh, "module_register")) == NULL) { - WARNING ("Couldn't find symbol `module_register' in `%s': %s\n", + WARNING ("Couldn't find symbol \"module_register\" in \"%s\": %s\n", file, lt_dlerror ()); lt_dlclose (dlh); return (-1); diff --git a/src/processes.c b/src/processes.c index 30798d42..7a5a9c07 100644 --- a/src/processes.c +++ b/src/processes.c @@ -1594,9 +1594,9 @@ static int ps_read (void) procs = kvm_getprocs(kd, KERN_PROC_ALL, 0, &count); if (procs == NULL) { - kvm_close (kd); ERROR ("processes plugin: Cannot get kvm processes list: %s", kvm_geterr(kd)); + kvm_close (kd); return (0); } diff --git a/src/python.c b/src/python.c index c056b5bf..d5c2d461 100644 --- a/src/python.c +++ b/src/python.c @@ -345,26 +345,26 @@ static int cpy_write_callback(const data_set_t *ds, const value_list_t *value_li CPY_RETURN_FROM_THREADS 0; } for (i = 0; i < value_list->values_len; ++i) { - if (ds->ds->type == DS_TYPE_COUNTER) { + if (ds->ds[i].type == DS_TYPE_COUNTER) { if ((long) value_list->values[i].counter == value_list->values[i].counter) PyList_SetItem(list, i, PyInt_FromLong(value_list->values[i].counter)); else PyList_SetItem(list, i, PyLong_FromUnsignedLongLong(value_list->values[i].counter)); - } else if (ds->ds->type == DS_TYPE_GAUGE) { + } else if (ds->ds[i].type == DS_TYPE_GAUGE) { PyList_SetItem(list, i, PyFloat_FromDouble(value_list->values[i].gauge)); - } else if (ds->ds->type == DS_TYPE_DERIVE) { + } else if (ds->ds[i].type == DS_TYPE_DERIVE) { if ((long) value_list->values[i].derive == value_list->values[i].derive) PyList_SetItem(list, i, PyInt_FromLong(value_list->values[i].derive)); else PyList_SetItem(list, i, PyLong_FromLongLong(value_list->values[i].derive)); - } else if (ds->ds->type == DS_TYPE_ABSOLUTE) { + } else if (ds->ds[i].type == DS_TYPE_ABSOLUTE) { if ((long) value_list->values[i].absolute == value_list->values[i].absolute) PyList_SetItem(list, i, PyInt_FromLong(value_list->values[i].absolute)); else PyList_SetItem(list, i, PyLong_FromUnsignedLongLong(value_list->values[i].absolute)); } else { Py_BEGIN_ALLOW_THREADS - ERROR("cpy_write_callback: Unknown value type %d.", ds->ds->type); + ERROR("cpy_write_callback: Unknown value type %d.", ds->ds[i].type); Py_END_ALLOW_THREADS Py_DECREF(list); CPY_RETURN_FROM_THREADS 0;