Merge branch 'master' of octo@verplant.org:/var/lib/git/collectd
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Thu, 5 Feb 2009 21:54:40 +0000 (22:54 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Thu, 5 Feb 2009 21:54:40 +0000 (22:54 +0100)
69 files changed:
.gitignore
configure.in
src/Makefile.am
src/apache.c
src/apcups.c
src/apple_sensors.c
src/ascent.c
src/battery.c
src/bind.c
src/collectd-exec.pod
src/collectd.c
src/collectd.conf.pod
src/common.c
src/common.h
src/cpu.c
src/cpufreq.c
src/dbi.c
src/df.c
src/disk.c
src/dns.c
src/email.c
src/entropy.c
src/filecount.c
src/hddtemp.c
src/interface.c
src/ipmi.c
src/iptables.c
src/ipvs.c
src/irq.c
src/load.c
src/mbmon.c
src/memcached.c
src/memory.c
src/multimeter.c
src/mysql.c
src/netlink.c
src/nfs.c
src/nginx.c
src/ntpd.c
src/nut.c
src/onewire.c
src/openvpn.c
src/oracle.c
src/perl.c
src/ping.c
src/plugin.c
src/plugin.h
src/postgresql.c
src/powerdns.c
src/processes.c
src/rrdcached.c
src/rrdtool.c
src/sensors.c
src/serial.c
src/snmp.c
src/swap.c
src/tape.c
src/tcpconns.c
src/teamspeak2.c
src/thermal.c
src/users.c
src/utils_cmd_putval.c
src/utils_db_query.c
src/utils_db_query.h
src/utils_tail_match.c
src/vmem.c
src/vserver.c
src/wireless.c
src/xmms.c

index 05c0aca..1f491f3 100644 (file)
@@ -31,11 +31,9 @@ config.log
 config.status
 libtool
 src/.deps
-src/Makefile
 src/collectd.conf
 src/config.h
-src/libconfig/Makefile
-src/liboping/Makefile
+src/libcollectdclient/libcollectdclient.pc
 src/stamp-h1
 
 # make stuff:
index c86b711..d423985 100644 (file)
@@ -1949,6 +1949,43 @@ then
        CFLAGS=$SAVE_CFLAGS
        LDFLAGS=$SAVE_LDFLAGS
 fi
+
+have_broken_perl_load_module="no"
+if test "x$with_libperl" = "xyes"
+then
+       SAVE_CFLAGS=$CFLAGS
+       SAVE_LDFLAGS=$LDFLAGS
+       # trigger an error if Perl_load_module*() uses __attribute__nonnull__(3)
+       # (see issues #41 and #42)
+       CFLAGS="$CFLAGS $PERL_CFLAGS -Wall -Werror"
+       LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
+
+       AC_CACHE_CHECK([for broken Perl_load_module()],
+               [have_broken_perl_load_module],
+               AC_LINK_IFELSE(
+                       AC_LANG_PROGRAM(
+                       [[
+#define PERL_NO_GET_CONTEXT
+#include <EXTERN.h>
+#include <perl.h>
+#include <XSUB.h>
+                       ]],
+                       [[
+                        dTHX;
+                        load_module (PERL_LOADMOD_NOIMPORT,
+                            newSVpv ("Collectd::Plugin::FooBar", 24),
+                            Nullsv);
+                       ]]),
+                       [have_broken_perl_load_module="no"],
+                       [have_broken_perl_load_module="yes"]
+               )
+       )
+
+       CFLAGS=$SAVE_CFLAGS
+       LDFLAGS=$SAVE_LDFLAGS
+fi
+AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
+               test "x$have_broken_perl_load_module" = "xyes")
 # }}}
 
 # --with-libpq {{{
index 26db76d..935ed7b 100644 (file)
@@ -604,6 +604,11 @@ perl_la_CPPFLAGS = $(AM_CPPFLAGS) -DHAS_BOOL=1
 perl_la_CFLAGS  = $(AM_CFLAGS) \
                $(PERL_CFLAGS) \
                -DXS_VERSION=\"$(VERSION)\" -DVERSION=\"$(VERSION)\"
+# Work-around for issues #41 and #42 - Perl 5.10 incorrectly introduced
+# __attribute__nonnull__(3) for Perl_load_module().
+if HAVE_BROKEN_PERL_LOAD_MODULE
+perl_la_CFLAGS += -Wno-nonnull
+endif
 perl_la_LDFLAGS = -module -avoid-version \
                $(PERL_LDFLAGS)
 collectd_LDADD += "-dlopen" perl.la
index c6bf8ad..7dc34f5 100644 (file)
@@ -197,7 +197,6 @@ static void submit_counter (const char *type, const char *type_instance,
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "apache", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
@@ -220,7 +219,6 @@ static void submit_gauge (const char *type, const char *type_instance,
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "apache", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
index ca026b9..4564917 100644 (file)
@@ -364,7 +364,6 @@ static void apc_submit_generic (char *type, char *type_inst, double value)
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "apcups", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
index d312027..bdba0ff 100644 (file)
@@ -87,7 +87,6 @@ static void as_submit (const char *type, const char *type_instance,
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "apple_sensors", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
index 6285176..bf1e9f4 100644 (file)
@@ -126,7 +126,6 @@ static int ascent_submit_gauge (const char *plugin_instance, /* {{{ */
 
   vl.values = values;
   vl.values_len = 1;
-  vl.time = time (NULL);
   sstrncpy (vl.host, hostname_g, sizeof (vl.host));
   sstrncpy (vl.plugin, "ascent", sizeof (vl.plugin));
 
index 416f339..d142982 100644 (file)
@@ -98,7 +98,6 @@ static void battery_submit (const char *plugin_instance, const char *type, doubl
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "battery", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
index e09da19..f9de8e6 100644 (file)
@@ -263,7 +263,7 @@ static void submit_counter(time_t ts, const char *plugin_instance, const char *t
 
   vl.values = values;
   vl.values_len = 1;
-  vl.time = (ts == 0) ? time (NULL) : ts;
+  vl.time = ts;
   sstrncpy(vl.host, hostname_g, sizeof(vl.host));
   sstrncpy(vl.plugin, "bind", sizeof(vl.plugin));
   if (plugin_instance) {
index d935c70..b95779d 100644 (file)
@@ -83,7 +83,7 @@ plugin within collectd. I<type> identifies the type and number of values
 data-sets is available in the B<types.db> file. See L<types.db(5)> for a
 description of the format of this file.
 
-The I<OptionList> is an optional list of I<Options>, where each option if a
+The I<OptionList> is an optional list of I<Options>, where each option is a
 key-value-pair. A list of currently understood options can be found below, all
 other options will be ignored. Values that contain spaces must be quoted with
 double quotes.
index 548a8fd..17905c7 100644 (file)
@@ -301,6 +301,7 @@ static int do_loop (void)
 {
        struct timeval tv_now;
        struct timeval tv_next;
+       struct timeval tv_wait;
        struct timespec ts_wait;
 
        while (loop == 0)
@@ -331,14 +332,17 @@ static int do_loop (void)
                        return (-1);
                }
 
-               if (timeval_sub_timespec (&tv_next, &tv_now, &ts_wait) != 0)
+               if (timeval_cmp (tv_next, tv_now, &tv_wait) <= 0)
                {
-                       WARNING ("Not sleeping because "
-                                       "`timeval_sub_timespec' returned "
-                                       "non-zero!");
+                       WARNING ("Not sleeping because the next interval is "
+                                       "%i.%06i seconds in the past!",
+                                       (int) tv_wait.tv_sec, (int) tv_wait.tv_usec);
                        continue;
                }
 
+               ts_wait.tv_sec  = tv_wait.tv_sec;
+               ts_wait.tv_nsec = (long) (1000 * tv_wait.tv_usec);
+
                while ((loop == 0) && (nanosleep (&ts_wait, &ts_wait) == -1))
                {
                        if (errno != EINTR)
index d6b5e8b..1f93673 100644 (file)
@@ -1109,6 +1109,10 @@ Prefix all lines printed by the current time. Defaults to B<true>.
 
 =back
 
+B<Note>: There is no need to notify the daemon after moving or removing the
+log file (e.E<nbsp>g. when rotating the logs). The plugin reopens the file
+for each line it writes.
+
 =head2 Plugin C<mbmon>
 
 The C<mbmon plugin> uses mbmon to retrieve temperature, voltage, etc.
@@ -2594,6 +2598,12 @@ the F</proc/virtual> filesystem that is required by this plugin.
 
 The B<VServer> homepage can be found at L<http://linux-vserver.org/>.
 
+B<Note>: The traffic collected by this plugin accounts for the amount of
+traffic passing a socket which might be a lot less than the actual on-wire
+traffic (e.E<nbsp>g. due to headers and retransmission). If you want to
+collect on-wire traffic you could, for example, use the logging facilities of
+iptables to feed data for the guest IPs into the iptables plugin.
+
 =head1 THRESHOLD CONFIGURATION
 
 Starting with version C<4.3.0> collectd has support for B<monitoring>. By that
index aeea28d..7cc1d9d 100644 (file)
@@ -347,28 +347,56 @@ int escape_slashes (char *buf, int buf_len)
        return (0);
 } /* int escape_slashes */
 
-int timeval_sub_timespec (struct timeval *tv0, struct timeval *tv1, struct timespec *ret)
+int timeval_cmp (struct timeval tv0, struct timeval tv1, struct timeval *delta)
 {
-       if ((tv0 == NULL) || (tv1 == NULL) || (ret == NULL))
-               return (-2);
+       struct timeval *larger;
+       struct timeval *smaller;
 
-       if ((tv0->tv_sec < tv1->tv_sec)
-                       || ((tv0->tv_sec == tv1->tv_sec) && (tv0->tv_usec < tv1->tv_usec)))
-               return (-1);
+       int status;
 
-       ret->tv_sec  = tv0->tv_sec - tv1->tv_sec;
-       ret->tv_nsec = 1000 * ((long) (tv0->tv_usec - tv1->tv_usec));
+       NORMALIZE_TIMEVAL (tv0);
+       NORMALIZE_TIMEVAL (tv1);
 
-       if (ret->tv_nsec < 0)
+       if ((tv0.tv_sec == tv1.tv_sec) && (tv0.tv_usec == tv1.tv_usec))
        {
-               assert (ret->tv_sec > 0);
+               if (delta != NULL) {
+                       delta->tv_sec  = 0;
+                       delta->tv_usec = 0;
+               }
+               return (0);
+       }
 
-               ret->tv_nsec += 1000000000;
-               ret->tv_sec  -= 1;
+       if ((tv0.tv_sec < tv1.tv_sec)
+                       || ((tv0.tv_sec == tv1.tv_sec) && (tv0.tv_usec < tv1.tv_usec)))
+       {
+               larger  = &tv1;
+               smaller = &tv0;
+               status  = -1;
+       }
+       else
+       {
+               larger  = &tv0;
+               smaller = &tv1;
+               status  = 1;
        }
 
-       return (0);
-}
+       if (delta != NULL) {
+               delta->tv_sec = larger->tv_sec - smaller->tv_sec;
+
+               if (smaller->tv_usec <= larger->tv_usec)
+                       delta->tv_usec = larger->tv_usec - smaller->tv_usec;
+               else
+               {
+                       --delta->tv_sec;
+                       delta->tv_usec = 1000000 + larger->tv_usec - smaller->tv_usec;
+               }
+       }
+
+       assert ((delta == NULL)
+                       || ((0 <= delta->tv_usec) && (delta->tv_usec < 1000000)));
+
+       return (status);
+} /* int timeval_cmp */
 
 int check_create_dir (const char *file_orig)
 {
index d372872..85db3ad 100644 (file)
@@ -160,8 +160,27 @@ int escape_slashes (char *buf, int buf_len);
 
 int strsubstitute (char *str, char c_from, char c_to);
 
-/* FIXME: `timeval_sub_timespec' needs a description */
-int timeval_sub_timespec (struct timeval *tv0, struct timeval *tv1, struct timespec *ret);
+/*
+ * NAME
+ *   timeval_cmp
+ *
+ * DESCRIPTION
+ *   Compare the two time values `tv0' and `tv1' and store the absolut value
+ *   of the difference in the time value pointed to by `delta' if it does not
+ *   equal NULL.
+ *
+ * RETURN VALUE
+ *   Returns an integer less than, equal to, or greater than zero if `tv0' is
+ *   less than, equal to, or greater than `tv1' respectively.
+ */
+int timeval_cmp (struct timeval tv0, struct timeval tv1, struct timeval *delta);
+
+/* make sure tv_usec stores less than a second */
+#define NORMALIZE_TIMEVAL(tv) \
+       do { \
+               (tv).tv_sec += (tv).tv_usec / 1000000; \
+               (tv).tv_usec = (tv).tv_usec % 1000000; \
+       } while (0)
 
 int check_create_dir (const char *file_orig);
 
index e9ab783..9a565c5 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -179,7 +179,6 @@ static void submit (int cpu_num, const char *type_instance, counter_t value)
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "cpu", sizeof (vl.plugin));
        ssnprintf (vl.plugin_instance, sizeof (vl.type_instance),
index 3738b54..b92b1d0 100644 (file)
@@ -67,7 +67,6 @@ static void cpufreq_submit (int cpu_num, double value)
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "cpufreq", sizeof (vl.plugin));
        sstrncpy (vl.type, "cpufreq", sizeof (vl.type));
index a542df3..d970938 100644 (file)
--- a/src/dbi.c
+++ b/src/dbi.c
@@ -356,7 +356,8 @@ static int cdbi_config (oconfig_item_t *ci) /* {{{ */
   {
     oconfig_item_t *child = ci->children + i;
     if (strcasecmp ("Query", child->key) == 0)
-      udb_query_create (&queries, &queries_num, child);
+      udb_query_create (&queries, &queries_num, child,
+          /* callback = */ NULL);
     else if (strcasecmp ("Database", child->key) == 0)
       cdbi_config_add_database (child);
     else
index 26d2382..38079d8 100644 (file)
--- a/src/df.c
+++ b/src/df.c
@@ -124,7 +124,6 @@ static void df_submit (char *df_name,
 
        vl.values = values;
        vl.values_len = 2;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "df", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
index 29aa979..489770c 100644 (file)
@@ -212,7 +212,6 @@ static void disk_submit (const char *plugin_instance,
 
        vl.values = values;
        vl.values_len = 2;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "disk", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, plugin_instance,
index c04169f..d82cbd8 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -298,7 +298,6 @@ static void submit_counter (const char *type, const char *type_instance,
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "dns", sizeof (vl.plugin));
        sstrncpy (vl.type, type, sizeof (vl.type));
@@ -317,7 +316,6 @@ static void submit_octets (counter_t queries, counter_t responses)
 
        vl.values = values;
        vl.values_len = 2;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "dns", sizeof (vl.plugin));
        sstrncpy (vl.type, "dns_octets", sizeof (vl.type));
index 5e103ed..ff9d439 100644 (file)
@@ -656,7 +656,6 @@ static void email_submit (const char *type, const char *type_instance, gauge_t v
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "email", sizeof (vl.plugin));
        sstrncpy (vl.type, type, sizeof (vl.type));
index 2e20a67..d56be6d 100644 (file)
@@ -38,7 +38,6 @@ static void entropy_submit (double entropy)
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "entropy", sizeof (vl.plugin));
        sstrncpy (vl.type, "entropy", sizeof (vl.type));
index e2b0020..05bb4b3 100644 (file)
@@ -66,7 +66,6 @@ static void fc_submit_dir (const fc_directory_conf_t *dir)
 
   vl.values = values;
   vl.values_len = STATIC_ARRAY_SIZE (values);
-  vl.time = time (NULL);
   sstrncpy (vl.host, hostname_g, sizeof (vl.host));
   sstrncpy (vl.plugin, "filecount", sizeof (vl.plugin));
   sstrncpy (vl.plugin_instance, dir->instance, sizeof (vl.plugin_instance));
index 9f4a725..cc67c63 100644 (file)
@@ -447,7 +447,6 @@ static void hddtemp_submit (char *type_instance, double value)
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "hddtemp", sizeof (vl.plugin));
        sstrncpy (vl.type, "temperature", sizeof (vl.type));
index 7512c4e..520f4c8 100644 (file)
@@ -158,7 +158,6 @@ static void if_submit (const char *dev, const char *type,
 
        vl.values = values;
        vl.values_len = 2;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "interface", sizeof (vl.plugin));
        sstrncpy (vl.type, type, sizeof (vl.type));
index b5e2744..1059070 100644 (file)
@@ -219,7 +219,6 @@ static void sensor_read_handler (ipmi_sensor_t *sensor,
 
   vl.values = values;
   vl.values_len = 1;
-  vl.time = time (NULL);
 
   sstrncpy (vl.host, hostname_g, sizeof (vl.host));
   sstrncpy (vl.plugin, "ipmi", sizeof (vl.plugin));
index e1694af..9abee36 100644 (file)
@@ -218,7 +218,6 @@ static int submit_match (const struct ipt_entry_match *match,
 
     vl.values = values;
     vl.values_len = 1;
-    vl.time = time (NULL);
     sstrncpy (vl.host, hostname_g, sizeof (vl.host));
     sstrncpy (vl.plugin, "iptables", sizeof (vl.plugin));
 
index 85e65d2..87eee10 100644 (file)
@@ -235,7 +235,6 @@ static void cipvs_submit_connections (char *pi, char *ti, counter_t value)
        vl.values     = values;
        vl.values_len = 1;
 
-       vl.time     = time (NULL);
        vl.interval = interval_g;
 
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
@@ -261,7 +260,6 @@ static void cipvs_submit_if (char *pi, char *t, char *ti,
        vl.values     = values;
        vl.values_len = 2;
 
-       vl.time     = time (NULL);
        vl.interval = interval_g;
 
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
index 9b7e618..986efaf 100644 (file)
--- a/src/irq.c
+++ b/src/irq.c
@@ -131,7 +131,6 @@ static void irq_submit (unsigned int irq, counter_t value)
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "irq", sizeof (vl.plugin));
        sstrncpy (vl.type, "irq", sizeof (vl.type));
index 72c7756..9c75ae1 100644 (file)
@@ -50,7 +50,6 @@ static void load_submit (gauge_t snum, gauge_t mnum, gauge_t lnum)
 
        vl.values = values;
        vl.values_len = STATIC_ARRAY_SIZE (values);
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "load", sizeof (vl.plugin));
        sstrncpy (vl.type, "load", sizeof (vl.type));
index 344cadd..859714c 100644 (file)
@@ -227,7 +227,6 @@ static void mbmon_submit (const char *type, const char *type_instance,
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "mbmon", sizeof (vl.plugin));
        sstrncpy (vl.type, type, sizeof (vl.type));
index f139b71..b5a4b20 100644 (file)
@@ -234,7 +234,6 @@ static void submit_counter (const char *type, const char *type_inst,
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "memcached", sizeof (vl.plugin));
        sstrncpy (vl.type, type, sizeof (vl.type));
index c31b30e..ebaa8f2 100644 (file)
@@ -108,7 +108,6 @@ static void memory_submit (const char *type_instance, gauge_t value)
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "memory", sizeof (vl.plugin));
        sstrncpy (vl.type, "memory", sizeof (vl.type));
index 9c9c2c1..775eb57 100644 (file)
 
 static int fd = -1;
 
-static int multimeter_timeval_sub (struct timeval *tv1, struct timeval *tv2,
-                struct timeval *res)
-{
-        if ((tv1->tv_sec < tv2->tv_sec) ||
-           ((tv1->tv_sec == tv2->tv_sec) && (tv1->tv_usec < tv2->tv_usec)))
-               return (-1);
-
-        res->tv_sec  = tv1->tv_sec  - tv2->tv_sec;
-        res->tv_usec = tv1->tv_usec - tv2->tv_usec;
-
-        assert ((res->tv_sec > 0) || ((res->tv_sec == 0) && (res->tv_usec > 0)));
-
-        while (res->tv_usec < 0)
-        {
-               res->tv_usec += 1000000;
-                res->tv_sec--;
-        }
-       return (0);
-}
-
 #define LINE_LENGTH 14
 static int multimeter_read_value(double *value)
 {
@@ -105,7 +85,7 @@ static int multimeter_read_value(double *value)
                                                        sizeof (errbuf)));
                                return (-1);
                        }
-                       if (multimeter_timeval_sub (&time_end, &time_now, &timeout) == -1)
+                       if (timeval_cmp (time_end, time_now, &timeout) < 0)
                                break;
 
                        status = select(fd+1, &rfds, NULL, NULL, &timeout);
@@ -220,7 +200,6 @@ static void multimeter_submit (double value)
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "multimeter", sizeof (vl.plugin));
        sstrncpy (vl.type, "multimeter", sizeof (vl.type));
index 57ad239..1c009a0 100644 (file)
@@ -158,7 +158,6 @@ static void counter_submit (const char *type, const char *type_instance,
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin));
        sstrncpy (vl.type, type, sizeof (vl.type));
@@ -182,7 +181,6 @@ static void qcache_submit (counter_t hits, counter_t inserts,
 
        vl.values = values;
        vl.values_len = 5;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin));
        sstrncpy (vl.type, "mysql_qcache", sizeof (vl.type));
@@ -203,7 +201,6 @@ static void threads_submit (gauge_t running, gauge_t connected, gauge_t cached,
 
        vl.values = values;
        vl.values_len = 4;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin));
        sstrncpy (vl.type, "mysql_threads", sizeof (vl.type));
@@ -221,7 +218,6 @@ static void traffic_submit (counter_t rx, counter_t tx)
 
        vl.values = values;
        vl.values_len = 2;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "mysql", sizeof (vl.plugin));
        sstrncpy (vl.type, "mysql_octets", sizeof (vl.type));
index d14e510..d7d1a26 100644 (file)
@@ -170,7 +170,6 @@ static void submit_one (const char *dev, const char *type,
 
   vl.values = values;
   vl.values_len = 1;
-  vl.time = time (NULL);
   sstrncpy (vl.host, hostname_g, sizeof (vl.host));
   sstrncpy (vl.plugin, "netlink", sizeof (vl.plugin));
   sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
@@ -194,7 +193,6 @@ static void submit_two (const char *dev, const char *type,
 
   vl.values = values;
   vl.values_len = 2;
-  vl.time = time (NULL);
   sstrncpy (vl.host, hostname_g, sizeof (vl.host));
   sstrncpy (vl.plugin, "netlink", sizeof (vl.plugin));
   sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
index f2db895..e4d12e3 100644 (file)
--- a/src/nfs.c
+++ b/src/nfs.c
@@ -187,7 +187,6 @@ static void nfs_procedures_submit (const char *plugin_instance,
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "nfs", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, plugin_instance,
index 91bcf75..8cb7628 100644 (file)
@@ -177,7 +177,6 @@ static void submit (char *type, char *inst, long long value)
 
   vl.values = values;
   vl.values_len = 1;
-  vl.time = time (NULL);
   sstrncpy (vl.host, hostname_g, sizeof (vl.host));
   sstrncpy (vl.plugin, "nginx", sizeof (vl.plugin));
   sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
index 44964bb..64e1bce 100644 (file)
@@ -300,7 +300,6 @@ static void ntpd_submit (char *type, char *type_inst, double value)
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "ntpd", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
@@ -310,31 +309,6 @@ static void ntpd_submit (char *type, char *type_inst, double value)
        plugin_dispatch_values (&vl);
 }
 
-/* returns `tv0 - tv1' in milliseconds or 0 if `tv1 > tv0' */
-static int timeval_sub (const struct timeval *tv0, const struct timeval *tv1)
-{
-       int sec;
-       int usec;
-
-       if ((tv0->tv_sec < tv1->tv_sec)
-                       || ((tv0->tv_sec == tv1->tv_sec) && (tv0->tv_usec < tv1->tv_usec)))
-               return (0);
-
-       sec  = tv0->tv_sec  - tv1->tv_sec;
-       usec = tv0->tv_usec - tv1->tv_usec;
-
-       while (usec < 0)
-       {
-               usec += 1000000;
-               sec  -= 1;
-       }
-
-       if (sec < 0)
-               return (0);
-
-       return ((sec * 1000) + ((usec + 500) / 1000));
-}
-
 static int ntpd_connect (void)
 {
        char *host;
@@ -459,6 +433,8 @@ static int ntpd_receive_response (int *res_items, int *res_size,
        done = 0;
        while (done == 0)
        {
+               struct timeval time_left;
+
                if (gettimeofday (&time_now, NULL) < 0)
                {
                        char errbuf[1024];
@@ -467,8 +443,14 @@ static int ntpd_receive_response (int *res_items, int *res_size,
                        return (-1);
                }
 
+               if (timeval_cmp (time_end, time_now, &time_left) <= 0)
+                       timeout = 0;
+               else
+                       timeout = 1000 * time_left.tv_sec
+                               + ((time_left.tv_usec + 500) / 1000);
+
                /* timeout reached */
-               if ((timeout = timeval_sub (&time_end, &time_now)) == 0)
+               if (timeout <= 0)
                        break;
 
                poll_s.fd      = sd;
index 8796d58..edc48c6 100644 (file)
--- a/src/nut.c
+++ b/src/nut.c
@@ -123,7 +123,6 @@ static void nut_submit (nut_ups_t *ups, const char *type,
 
   vl.values = values;
   vl.values_len = STATIC_ARRAY_SIZE (values);
-  vl.time = time (NULL);
   sstrncpy (vl.host,
       (strcasecmp (ups->hostname, "localhost") == 0)
       ? hostname_g
index dd7f527..c40d5ad 100644 (file)
@@ -149,7 +149,6 @@ static int cow_read_values (const char *path, const char *name,
 
   vl.values = values;
   vl.values_len = 1;
-  vl.time = time (NULL);
 
   sstrncpy (vl.host, hostname_g, sizeof (vl.host));
   sstrncpy (vl.plugin, "onewire", sizeof (vl.plugin));
index a2f4823..083e2e3 100644 (file)
@@ -75,7 +75,6 @@ static void openvpn_submit (char *name, counter_t rx, counter_t tx)
 
        vl.values = values;
        vl.values_len = STATIC_ARRAY_SIZE (values);
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "openvpn", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, name, sizeof (vl.plugin_instance));
@@ -93,7 +92,6 @@ static void compression_submit (char *type_instance, gauge_t ratio)
 
        vl.values = values;
        vl.values_len = STATIC_ARRAY_SIZE (values);
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "openvpn", sizeof (vl.plugin));
        sstrncpy (vl.type, "compression_ratio", sizeof (vl.type));
index accaee3..b008e5c 100644 (file)
@@ -294,7 +294,8 @@ static int o_config (oconfig_item_t *ci) /* {{{ */
   {
     oconfig_item_t *child = ci->children + i;
     if (strcasecmp ("Query", child->key) == 0)
-      udb_query_create (&queries, &queries_num, child);
+      udb_query_create (&queries, &queries_num, child,
+          /* callback = */ NULL);
     else if (strcasecmp ("Database", child->key) == 0)
       o_config_add_database (child);
     else
index 4a76c0a..b5965d6 100644 (file)
@@ -640,9 +640,6 @@ static int pplugin_dispatch_values (pTHX_ HV *values)
        if (NULL != (tmp = hv_fetch (values, "time", 4, 0))) {
                list.time = (time_t)SvIV (*tmp);
        }
-       else {
-               list.time = time (NULL);
-       }
 
        if (NULL != (tmp = hv_fetch (values, "host", 4, 0))) {
                sstrncpy (list.host, SvPV_nolen (*tmp), sizeof (list.host));
index ac5b0f8..7ffbfaf 100644 (file)
@@ -185,7 +185,6 @@ static void ping_submit (char *host, double latency)
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "ping", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
index 95b9fa3..4aabebe 100644 (file)
@@ -56,7 +56,6 @@ typedef struct read_func_s read_func_t;
 static llist_t *list_init;
 static llist_t *list_read;
 static llist_t *list_write;
-static llist_t *list_filter;
 static llist_t *list_flush;
 static llist_t *list_shutdown;
 static llist_t *list_log;
@@ -450,12 +449,6 @@ int plugin_register_write (const char *name,
        return (register_callback (&list_write, name, (void *) callback));
 } /* int plugin_register_write */
 
-int plugin_register_filter (const char *name,
-               int (*callback) (const data_set_t *ds, value_list_t *vl))
-{
-       return (register_callback (&list_filter, name, (void *) callback));
-} /* int plugin_register_filter */
-
 int plugin_register_flush (const char *name,
                int (*callback) (const int timeout, const char *identifier))
 {
@@ -556,11 +549,6 @@ int plugin_unregister_write (const char *name)
        return (plugin_unregister (list_write, name));
 }
 
-int plugin_unregister_filter (const char *name)
-{
-       return (plugin_unregister (list_filter, name));
-}
-
 int plugin_unregister_flush (const char *name)
 {
        return (plugin_unregister (list_flush, name));
@@ -874,6 +862,9 @@ int plugin_dispatch_values (value_list_t *vl)
                return (-1);
        }
 
+       if (vl->time == 0)
+               vl->time = time (NULL);
+
        DEBUG ("plugin_dispatch_values: time = %u; interval = %i; "
                        "host = %s; "
                        "plugin = %s; plugin_instance = %s; "
index 4f4a360..f4ca783 100644 (file)
 #define NOTIF_WARNING 2
 #define NOTIF_OKAY    4
 
-#define FILTER_NOWRITE 1
-#define FILTER_NOTHRESHOLD_CHECK 2
-/* FILTER_IGNORE has to equal the bitwise or of all other filter flags */
-#define FILTER_IGNORE (FILTER_NOWRITE | FILTER_NOTHRESHOLD_CHECK)
-
 /*
  * Public data types
  */
@@ -232,8 +227,6 @@ int plugin_register_read (const char *name,
                int (*callback) (void));
 int plugin_register_write (const char *name,
                int (*callback) (const data_set_t *ds, const value_list_t *vl));
-int plugin_register_filter (const char *name,
-               int (*callback) (const data_set_t *ds, value_list_t *vl));
 int plugin_register_flush (const char *name,
                int (*callback) (const int timeout, const char *identifier));
 int plugin_register_shutdown (char *name,
@@ -249,7 +242,6 @@ int plugin_unregister_complex_config (const char *name);
 int plugin_unregister_init (const char *name);
 int plugin_unregister_read (const char *name);
 int plugin_unregister_write (const char *name);
-int plugin_unregister_filter (const char *name);
 int plugin_unregister_flush (const char *name);
 int plugin_unregister_shutdown (const char *name);
 int plugin_unregister_data_set (const char *name);
index 2814cc4..fce3588 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * collectd - src/postgresql.c
- * Copyright (C) 2008  Sebastian Harl
+ * Copyright (C) 2008, 2009  Sebastian Harl
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -392,7 +392,6 @@ static void submit (const c_psql_database_t *db, const c_psql_result_t *res,
 
        vl.values     = values;
        vl.values_len = res->values_num;
-       vl.time       = time (NULL);
 
        if (C_PSQL_IS_UNIX_DOMAIN_SOCKET (db->host)
                        || (0 == strcmp (db->host, "localhost")))
index 189c46f..164137b 100644 (file)
@@ -317,7 +317,6 @@ static void submit (const char *plugin_instance, /* {{{ */
 
   vl.values = values;
   vl.values_len = 1;
-  vl.time = time (NULL);
   sstrncpy (vl.host, hostname_g, sizeof (vl.host));
   sstrncpy (vl.plugin, "powerdns", sizeof (vl.plugin));
   sstrncpy (vl.type, type, sizeof (vl.type));
index 0b82482..553b195 100644 (file)
@@ -553,7 +553,6 @@ static void ps_submit_state (const char *state, double value)
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "processes", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
@@ -571,7 +570,6 @@ static void ps_submit_proc_list (procstat_t *ps)
 
        vl.values = values;
        vl.values_len = 2;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "processes", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, ps->name, sizeof (vl.plugin_instance));
index f9d65ca..31c6352 100644 (file)
@@ -221,7 +221,6 @@ static int rc_read (void)
 
   vl.values = values;
   vl.values_len = 1;
-  vl.time = time (NULL);
 
   if ((strncmp ("unix:", daemon_address, strlen ("unix:")) == 0)
       || (daemon_address[0] == '/'))
index 3265561..95bde69 100644 (file)
@@ -308,10 +308,9 @@ static void *rrd_queue_thread (void *data)
                     break;
 
                   gettimeofday (&tv_now, /* timezone = */ NULL);
-                  status = timeval_sub_timespec (&tv_next_update, &tv_now,
-                      &ts_wait);
+                  status = timeval_cmp (tv_next_update, tv_now, NULL);
                   /* We're good to go */
-                  if (status != 0)
+                  if (status <= 0)
                     break;
 
                   /* We're supposed to wait a bit with this update, so we'll
index 5ed82a8..b600d4c 100644 (file)
@@ -496,7 +496,6 @@ static void sensors_submit (const char *plugin_instance,
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
 
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "sensors", sizeof (vl.plugin));
index 1c874e5..cfa26bb 100644 (file)
@@ -40,7 +40,6 @@ static void serial_submit (const char *type_instance,
 
        vl.values = values;
        vl.values_len = 2;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "serial", sizeof (vl.plugin));
        sstrncpy (vl.type, "serial_octets", sizeof (vl.type));
index 3ba93fe..44fce62 100644 (file)
@@ -963,7 +963,6 @@ static int csnmp_dispatch_table (host_definition_t *host, data_definition_t *dat
   sstrncpy (vl.plugin, "snmp", sizeof (vl.plugin));
 
   vl.interval = host->interval;
-  vl.time = time (NULL);
 
   subid = 0;
   have_more = 1;
@@ -1385,7 +1384,6 @@ static int csnmp_read_value (host_definition_t *host, data_definition_t *data)
     return (-1);
   }
 
-  vl.time = time (NULL);
 
   for (vb = res->variables; vb != NULL; vb = vb->next_variable)
   {
index 8c09e35..b8b5f09 100644 (file)
@@ -123,7 +123,6 @@ static void swap_submit (const char *type_instance, double value)
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "swap", sizeof (vl.plugin));
        sstrncpy (vl.type, "swap", sizeof (vl.type));
index caca537..32b4296 100644 (file)
@@ -68,7 +68,6 @@ static void tape_submit (const char *plugin_instance,
 
        vl.values = values;
        vl.values_len = 2;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "tape", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, plugin_instance,
index aa1fa38..f576b68 100644 (file)
@@ -213,7 +213,6 @@ static void conn_submit_port_entry (port_entry_t *pe)
 
   vl.values = values;
   vl.values_len = 1;
-  vl.time = time (NULL);
   sstrncpy (vl.host, hostname_g, sizeof (vl.host));
   sstrncpy (vl.plugin, "tcpconns", sizeof (vl.plugin));
   sstrncpy (vl.type, "tcp_connections", sizeof (vl.type));
index 5cd427a..e81dbe3 100644 (file)
@@ -129,7 +129,6 @@ static void tss2_submit_gauge (const char *plugin_instance,
 
        vl.values     = values;
        vl.values_len = 1;
-       vl.time       = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "teamspeak2", sizeof (vl.plugin));
 
@@ -160,7 +159,6 @@ static void tss2_submit_io (const char *plugin_instance, const char *type,
 
        vl.values     = values;
        vl.values_len = 2;
-       vl.time       = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "teamspeak2", sizeof (vl.plugin));
 
index b613648..79033b1 100644 (file)
@@ -51,7 +51,6 @@ static void thermal_submit (const char *plugin_instance, enum dev_type dt,
        vt.gauge = value;
 
        vl.values = &vt;
-       vl.time = time (NULL);
        sstrncpy (vl.plugin, "thermal", sizeof(vl.plugin));
        sstrncpy (vl.plugin_instance, plugin_instance,
                        sizeof(vl.plugin_instance));
index 1231075..b605ff8 100644 (file)
@@ -48,7 +48,6 @@ static void users_submit (gauge_t value)
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "users", sizeof (vl.plugin));
        sstrncpy (vl.type, "users", sizeof (vl.plugin));
index 91b7016..5bd6ec7 100644 (file)
@@ -51,8 +51,6 @@ static int parse_value (const data_set_t *ds, value_list_t *vl,
        *value_str = '\0'; value_str++;
 
        vl->time = (time_t) atoi (time_str);
-       if (vl->time == 0)
-               vl->time = time (NULL);
 
        i = 0;
        dummy = value_str;
index 868b53b..eb001de 100644 (file)
@@ -217,7 +217,6 @@ static void udb_result_submit (udb_result_t *r, udb_query_t *q) /* {{{ */
     }
   }
 
-  vl.time = time (NULL);
   sstrncpy (vl.host, q->host, sizeof (vl.host));
   sstrncpy (vl.plugin, q->plugin, sizeof (vl.plugin));
   sstrncpy (vl.plugin_instance, q->db_name, sizeof (vl.type_instance));
@@ -540,7 +539,8 @@ void udb_query_free_one (udb_query_t *q) /* {{{ */
  * Query public functions
  */
 int udb_query_create (udb_query_t ***ret_query_list, /* {{{ */
-    size_t *ret_query_list_len, oconfig_item_t *ci)
+    size_t *ret_query_list_len, oconfig_item_t *ci,
+    udb_query_create_callback_t cb)
 {
   udb_query_t **query_list;
   size_t        query_list_len;
@@ -607,6 +607,15 @@ int udb_query_create (udb_query_t ***ret_query_list, /* {{{ */
           q->name);
       status = udb_config_set_uint (&q->max_version, child);
     }
+    else if (cb != NULL)
+    {
+      status = (*cb) (q, child);
+      if (status != 0)
+      {
+        WARNING ("db query utils: The configuration callback failed "
+            "to handle `%s'.", child->key);
+      }
+    }
     else
     {
       WARNING ("db query utils: Query `%s': Option `%s' not allowed here.",
index 4e12ced..3959e88 100644 (file)
 struct udb_query_s;
 typedef struct udb_query_s udb_query_t;
 
+typedef int (*udb_query_create_callback_t) (udb_query_t *q,
+    oconfig_item_t *ci);
+
 /* 
  * Public functions
  */
 int udb_query_create (udb_query_t ***ret_query_list,
-    size_t *ret_query_list_len, oconfig_item_t *ci);
+    size_t *ret_query_list_len, oconfig_item_t *ci,
+    udb_query_create_callback_t cb);
 void udb_query_free (udb_query_t **query_list, size_t query_list_len);
 
 int udb_query_pick_from_list (oconfig_item_t *ci,
index f518b1c..26e9531 100644 (file)
@@ -80,7 +80,6 @@ static int simple_submit_match (cu_match_t *match, void *user_data)
 
   vl.values = values;
   vl.values_len = 1;
-  vl.time = time (NULL);
   sstrncpy (vl.host, hostname_g, sizeof (vl.host));
   sstrncpy (vl.plugin, data->plugin, sizeof (vl.plugin));
   sstrncpy (vl.plugin_instance, data->plugin_instance,
index 25f7c70..6775d20 100644 (file)
@@ -45,7 +45,6 @@ static void submit (const char *plugin_instance, const char *type,
   vl.values = values;
   vl.values_len = values_len;
 
-  vl.time = time (NULL);
   sstrncpy (vl.host, hostname_g, sizeof (vl.host));
   sstrncpy (vl.plugin, "vmem", sizeof (vl.plugin));
   if (plugin_instance != NULL)
index dac4392..8747d9b 100644 (file)
@@ -56,7 +56,6 @@ static void traffic_submit (const char *plugin_instance,
 
        vl.values = values;
        vl.values_len = STATIC_ARRAY_SIZE (values);
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "vserver", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
@@ -78,7 +77,6 @@ static void load_submit (const char *plugin_instance,
 
        vl.values = values;
        vl.values_len = STATIC_ARRAY_SIZE (values);
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "vserver", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
@@ -98,7 +96,6 @@ static void submit_gauge (const char *plugin_instance, const char *type,
 
        vl.values = values;
        vl.values_len = STATIC_ARRAY_SIZE (values);
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "vserver", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
index 21bbcb4..f7ba735 100644 (file)
@@ -55,7 +55,6 @@ static void wireless_submit (const char *plugin_instance, const char *type,
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "wireless", sizeof (vl.plugin));
        sstrncpy (vl.plugin_instance, plugin_instance,
index 09786fc..52beb65 100644 (file)
@@ -36,7 +36,6 @@ static void cxmms_submit (const char *type, gauge_t value)
 
        vl.values = values;
        vl.values_len = 1;
-       vl.time = time (NULL);
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));
        sstrncpy (vl.plugin, "xmms", sizeof (vl.plugin));
        sstrncpy (vl.type, type, sizeof (vl.type));