From: Florian Forster Date: Wed, 12 Sep 2007 09:15:54 +0000 (+0200) Subject: Merge branch 'collectd-4.0' into collectd-4.1 X-Git-Tag: collectd-4.1.1~1 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=90ac9957e95378d729bce1c00bb0ef2efadab33e;hp=27f6db4769cac5727888c327dbbf1b88da4f3ca6;p=collectd.git Merge branch 'collectd-4.0' into collectd-4.1 Conflicts: ChangeLog configure.in --- diff --git a/ChangeLog b/ChangeLog index 30564d5f..0fad3c8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,16 @@ -2007-09-10, Version 4.1.1 +2007-09-12, Version 4.1.1 * Build system: The detection of `libnetlink' has been improved. * collectd: The documentation has been fixed in numerous places. * exec plugin: Setting the group under which to run a program has been fixed. + * collectd: The `sstrerror' function was improved to work correctly + with the broken GNU version of `strerror_r'. + * collectd: Write an error message to STDERR when loading of a plugin + fails. + * apcups plugin: Fix the `types' used to submit the values: They still + has an `apcups_' prefix which doesn't work anymore. + * rrdtool plugin: Create new RRD-files with the `begin' time set to + whatever the client thinks is `now'.. 2007-09-01, Version 4.1.0 * Build system: The build system has been changed to automatically @@ -25,11 +33,15 @@ * xmms plugin: The new `xmms' plugin graphs the bitrate and frequency of music played with xmms. -2007-09-10, Version 4.0.8 +2007-09-12, Version 4.0.8 * collectd: The `sstrerror' function was improved to work correctly with the broken GNU version of `strerror_r'. + * collectd: Write an error message to STDERR when loading of a plugin + fails. * apcups plugin: Fix the `types' used to submit the values: They still has an `apcups_' prefix which doesn't work anymore. + * rrdtool plugin: Create new RRD-files with the `begin' time set to + whatever the client thinks is `now'.. 2007-08-26, Version 4.0.7 * documentation: Some typos have been fixed and some information has diff --git a/src/dns.c b/src/dns.c index 2cbd0c37..e9996b99 100644 --- a/src/dns.c +++ b/src/dns.c @@ -229,13 +229,11 @@ static void *dns_child_loop (void *dummy) memset (&fp, 0, sizeof (fp)); if (pcap_compile (pcap_obj, &fp, "udp port 53", 1, 0) < 0) { - DEBUG ("pcap_compile failed"); ERROR ("dns plugin: pcap_compile failed"); return (NULL); } if (pcap_setfilter (pcap_obj, &fp) < 0) { - DEBUG ("pcap_setfilter failed"); ERROR ("dns plugin: pcap_setfilter failed"); return (NULL); } diff --git a/src/ntpd.c b/src/ntpd.c index fe3576c2..63b037a6 100644 --- a/src/ntpd.c +++ b/src/ntpd.c @@ -390,7 +390,6 @@ static int ntpd_connect (void) if (sock_descr < 0) { - DEBUG ("Unable to connect to server."); ERROR ("ntpd plugin: Unable to connect to server."); } diff --git a/src/plugin.c b/src/plugin.c index 007d094a..23ea9017 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -133,6 +133,7 @@ static int plugin_load_file (char *file) const char *error = lt_dlerror (); ERROR ("lt_dlopen failed: %s", error); + fprintf (stderr, "lt_dlopen failed: %s\n", error); return (1); } @@ -355,6 +356,10 @@ int plugin_load (const char *type) ret = 0; break; } + else + { + fprintf (stderr, "Unable to load plugin %s.\n", type); + } } closedir (dh); diff --git a/src/rrdtool.c b/src/rrdtool.c index 4d4b87cb..56ef581e 100644 --- a/src/rrdtool.c +++ b/src/rrdtool.c @@ -337,6 +337,7 @@ static int rrd_create_file (char *filename, const data_set_t *ds, const value_li int ds_num; int i, j; char stepsize_str[16]; + char begin_str[16]; int status = 0; if (check_create_dir (filename)) @@ -354,7 +355,7 @@ static int rrd_create_file (char *filename, const data_set_t *ds, const value_li return (-1); } - argc = ds_num + rra_num + 4; + argc = ds_num + rra_num + 6; if ((argv = (char **) malloc (sizeof (char *) * (argc + 1))) == NULL) { @@ -375,12 +376,23 @@ static int rrd_create_file (char *filename, const data_set_t *ds, const value_li return (-1); } + assert (vl->time > 10); + status = snprintf (begin_str, sizeof (begin_str), + "%llu", (unsigned long long) (vl->time - 10)); + if ((status < 1) || (status >= sizeof (begin_str))) + { + ERROR ("rrdtool plugin: snprintf failed."); + return (-1); + } + argv[0] = "create"; argv[1] = filename; - argv[2] = "-s"; - argv[3] = stepsize_str; + argv[2] = "-b"; + argv[3] = begin_str; + argv[4] = "-s"; + argv[5] = stepsize_str; - j = 4; + j = 6; for (i = 0; i < ds_num; i++) argv[j++] = ds_def[i]; for (i = 0; i < rra_num; i++) diff --git a/src/unixsock.c b/src/unixsock.c index ddb3a52f..6abbfef9 100644 --- a/src/unixsock.c +++ b/src/unixsock.c @@ -352,12 +352,13 @@ static int us_open_socket (void) sizeof (sa.sun_path) - 1); /* unlink (sa.sun_path); */ + DEBUG ("unixsock plugin: socket path = %s", sa.sun_path); + status = bind (sock_fd, (struct sockaddr *) &sa, sizeof (sa)); if (status != 0) { char errbuf[1024]; sstrerror (errno, errbuf, sizeof (errbuf)); - DEBUG ("bind failed: %s; sa.sun_path = %s", errbuf, sa.sun_path); ERROR ("unixsock plugin: bind failed: %s", errbuf); close (sock_fd); sock_fd = -1;