Merge branch 'collectd-4.0' into collectd-4.1
authorFlorian Forster <octo@huhu.verplant.org>
Wed, 12 Sep 2007 09:15:54 +0000 (11:15 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Wed, 12 Sep 2007 09:15:54 +0000 (11:15 +0200)
Conflicts:

ChangeLog
configure.in

ChangeLog
src/dns.c
src/ntpd.c
src/plugin.c
src/rrdtool.c
src/unixsock.c

index 30564d5..0fad3c8 100644 (file)
--- 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
        * 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
index 2cbd0c3..e9996b9 100644 (file)
--- 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);
        }
index fe3576c..63b037a 100644 (file)
@@ -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.");
        }
 
index 007d094..23ea901 100644 (file)
@@ -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);
index 4d4b87c..56ef581 100644 (file)
@@ -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++)
index ddb3a52..6abbfef 100644 (file)
@@ -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;