Merge remote branch 'trenkel/collectd-4.9' into collectd-4.9
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Tue, 16 Nov 2010 11:20:18 +0000 (12:20 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Tue, 16 Nov 2010 11:20:18 +0000 (12:20 +0100)
src/collectd.conf.pod
src/processes.c
src/utils_rrdcreate.c

index be7d99c..5fc75c5 100644 (file)
@@ -129,6 +129,10 @@ Configures the interval in which to query the read plugins. Obviously smaller
 values lead to a higher system load produced by collectd, while higher values
 lead to more coarse statistics.
 
+B<Warning:> You should set this once and then never touch it again. If you do,
+I<you will have to delete all your RRD files> or know some serious RRDtool
+magic! (Assuming you're using the I<RRDtool> or I<RRDCacheD> plugin.)
+
 =item B<ReadThreads> I<Num>
 
 Number of threads to start for reading plugins. The default value is B<5>, but
index 670aa8d..856296c 100644 (file)
@@ -903,13 +903,18 @@ static char *ps_get_cmdline (pid_t pid, char *name, char *buf, size_t buf_len)
        if ((pid < 1) || (NULL == buf) || (buf_len < 2))
                return NULL;
 
-       ssnprintf (file, sizeof (file), "/proc/%u/cmdline", pid);
+       ssnprintf (file, sizeof (file), "/proc/%u/cmdline",
+                       (unsigned int) pid);
 
+       errno = 0;
        fd = open (file, O_RDONLY);
        if (fd < 0) {
                char errbuf[4096];
-               WARNING ("processes plugin: Failed to open `%s': %s.", file,
-                               sstrerror (errno, errbuf, sizeof (errbuf)));
+               /* ENOENT means the process exited while we were handling it.
+                * Don't complain about this, it only fills the logs. */
+               if (errno != ENOENT)
+                       WARNING ("processes plugin: Failed to open `%s': %s.", file,
+                                       sstrerror (errno, errbuf, sizeof (errbuf)));
                return NULL;
        }
 
@@ -924,7 +929,7 @@ static char *ps_get_cmdline (pid_t pid, char *name, char *buf, size_t buf_len)
                status = read (fd, (void *)buf_ptr, len);
 
                if (status < 0) {
-                       char errbuf[4096];
+                       char errbuf[1024];
 
                        if ((EAGAIN == errno) || (EINTR == errno))
                                continue;
index 4ecec59..66bb27e 100644 (file)
@@ -398,10 +398,9 @@ int cu_rrd_create_file (const char *filename, /* {{{ */
   memcpy (argv + ds_num, rra_def, rra_num * sizeof (char *));
   argv[ds_num + rra_num] = NULL;
 
-  assert (vl->time > 10);
   status = srrd_create (filename,
       (cfg->stepsize > 0) ? cfg->stepsize : vl->interval,
-      vl->time - 10,
+      (vl->time > 10) ? (vl->time - 10) : vl->time,
       argc, (const char **) argv);
 
   free (argv);