Merge branch 'er/ted'
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Tue, 31 Mar 2009 07:45:33 +0000 (09:45 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Tue, 31 Mar 2009 07:45:33 +0000 (09:45 +0200)
1  2 
configure.in
src/Makefile.am
src/collectd.conf.pod

diff --combined configure.in
@@@ -409,7 -409,7 +409,7 @@@ AC_CHECK_FUNCS(gettimeofday select strd
  AC_FUNC_STRERROR_R
  
  AC_CACHE_CHECK([for strtok_r],
 -  [have_strtok_r_default],
 +  [c_cv_have_strtok_r_default],
    AC_LINK_IFELSE(
      AC_LANG_PROGRAM(
      [[[[
          printf ("token = %s;\n", token);
        }
      ]]]]),
 -    [have_strtok_r_default="yes"],
 -    [have_strtok_r_default="no"]
 +    [c_cv_have_strtok_r_default="yes"],
 +    [c_cv_have_strtok_r_default="no"]
    )
  )
  
 -if test "x$have_strtok_r_default" = "xno"
 +if test "x$c_cv_have_strtok_r_default" = "xno"
  then
    SAVE_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS -D_REENTRANT=1"
  
    AC_CACHE_CHECK([if strtok_r needs _REENTRANT],
 -    [have_strtok_r_reentrant],
 +    [c_cv_have_strtok_r_reentrant],
      AC_LINK_IFELSE(
        AC_LANG_PROGRAM(
        [[[[
            printf ("token = %s;\n", token);
          }
        ]]]]),
 -      [have_strtok_r_reentrant="yes"],
 +      [c_cv_have_strtok_r_reentrant="yes"],
        [AC_MSG_FAILURE([strtok_r isn't available. Please file a bugreport!])]
      )
    )
@@@ -510,7 -510,7 +510,7 @@@ AC_ARG_WITH(nan-emulation, [AS_HELP_STR
  [nan_type="none"])
  if test "x$nan_type" = "xnone"; then
    AC_CACHE_CHECK([whether NAN is defined by default],
 -    [have_nan_default],
 +    [c_cv_have_nan_default],
      AC_COMPILE_IFELSE(
        AC_LANG_PROGRAM(
        [[
@@@ -524,18 -524,18 +524,18 @@@ static float foo = NAN
         else
        return 1;
        ]]),
 -      [have_nan_default="yes"],
 -      [have_nan_default="no"]
 +      [c_cv_have_nan_default="yes"],
 +      [c_cv_have_nan_default="no"]
      )
    )
 -  if test "x$have_nan_default" = "xyes"
 +  if test "x$c_cv_have_nan_default" = "xyes"
    then
      nan_type="default"
    fi
  fi
  if test "x$nan_type" = "xnone"; then
    AC_CACHE_CHECK([whether NAN is defined by __USE_ISOC99],
 -    [have_nan_isoc],
 +    [c_cv_have_nan_isoc],
      AC_COMPILE_IFELSE(
        AC_LANG_PROGRAM(
        [[
@@@ -550,18 -550,18 +550,18 @@@ static float foo = NAN
         else
        return 1;
        ]]),
 -      [have_nan_isoc="yes"],
 -      [have_nan_isoc="no"]
 +      [c_cv_have_nan_isoc="yes"],
 +      [c_cv_have_nan_isoc="no"]
      )
    )
 -  if test "x$have_nan_isoc" = "xyes"
 +  if test "x$c_cv_have_nan_isoc" = "xyes"
    then
      nan_type="isoc99"
    fi
  fi
  if test "x$nan_type" = "xnone"; then
    AC_CACHE_CHECK([whether NAN can be defined by 0/0],
 -    [have_nan_zero],
 +    [c_cv_have_nan_zero],
      AC_RUN_IFELSE(
        AC_LANG_PROGRAM(
        [[
@@@ -582,11 -582,11 +582,11 @@@ static float foo = NAN
         else
        return 1;
        ]]),
 -      [have_nan_zero="yes"],
 -      [have_nan_zero="no"]
 +      [c_cv_have_nan_zero="yes"],
 +      [c_cv_have_nan_zero="no"]
      )
    )
 -  if test "x$have_nan_zero" = "xyes"
 +  if test "x$c_cv_have_nan_zero" = "xyes"
    then
      nan_type="zero"
    fi
@@@ -621,7 -621,7 +621,7 @@@ fi; fi; f
  
  if test "x$fp_layout_type" = "xunknown"; then
    AC_CACHE_CHECK([if doubles are stored in x86 representation],
 -    [fp_layout_need_nothing],
 +    [c_cv_fp_layout_need_nothing],
      AC_RUN_IFELSE(
        AC_LANG_PROGRAM(
        [[[[
        else
                return (1);
        ]]]]),
 -      [fp_layout_need_nothing="yes"],
 -      [fp_layout_need_nothing="no"]
 +      [c_cv_fp_layout_need_nothing="yes"],
 +      [c_cv_fp_layout_need_nothing="no"]
      )
    )
 -  if test "x$fp_layout_need_nothing" = "xyes"; then
 +  if test "x$c_cv_fp_layout_need_nothing" = "xyes"; then
      fp_layout_type="nothing"
    fi
  fi
  if test "x$fp_layout_type" = "xunknown"; then
    AC_CACHE_CHECK([if endianflip converts to x86 representation],
 -    [fp_layout_need_endianflip],
 +    [c_cv_fp_layout_need_endianflip],
      AC_RUN_IFELSE(
        AC_LANG_PROGRAM(
        [[[[
        else
                return (1);
        ]]]]),
 -      [fp_layout_need_endianflip="yes"],
 -      [fp_layout_need_endianflip="no"]
 +      [c_cv_fp_layout_need_endianflip="yes"],
 +      [c_cv_fp_layout_need_endianflip="no"]
      )
    )
 -  if test "x$fp_layout_need_endianflip" = "xyes"; then
 +  if test "x$c_cv_fp_layout_need_endianflip" = "xyes"; then
      fp_layout_type="endianflip"
    fi
  fi
  if test "x$fp_layout_type" = "xunknown"; then
    AC_CACHE_CHECK([if intswap converts to x86 representation],
 -    [fp_layout_need_intswap],
 +    [c_cv_fp_layout_need_intswap],
      AC_RUN_IFELSE(
        AC_LANG_PROGRAM(
        [[[[
        else
                return (1);
        ]]]]),
 -      [fp_layout_need_intswap="yes"],
 -      [fp_layout_need_intswap="no"]
 +      [c_cv_fp_layout_need_intswap="yes"],
 +      [c_cv_fp_layout_need_intswap="no"]
      )
    )
 -  if test "x$fp_layout_need_intswap" = "xyes"; then
 +  if test "x$c_cv_fp_layout_need_intswap" = "xyes"; then
      fp_layout_type="intswap"
    fi
  fi
@@@ -796,7 -796,7 +796,7 @@@ f
  
  if test "x$have_getmntent" = "xc"; then
        AC_CACHE_CHECK([whether getmntent takes one argument],
 -              [have_one_getmntent],
 +              [c_cv_have_one_getmntent],
                AC_COMPILE_IFELSE(
                        AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
  #include <mntent.h>
                                 me = getmntent (fh);
                                ]]
                        ),
 -                      [have_one_getmntent="yes"],
 -                      [have_one_getmntent="no"]
 +                      [c_cv_have_one_getmntent="yes"],
 +                      [c_cv_have_one_getmntent="no"]
                )
        )
        AC_CACHE_CHECK([whether getmntent takes two arguments],
 -              [have_two_getmntent],
 +              [c_cv_have_two_getmntent],
                AC_COMPILE_IFELSE(
                        AC_LANG_PROGRAM([[AC_INCLUDES_DEFAULT
  #include <sys/mnttab.h>
                                 status = getmntent (fh, &mt);
                                ]]
                        ),
 -                      [have_two_getmntent="yes"],
 -                      [have_two_getmntent="no"]
 +                      [c_cv_have_two_getmntent="yes"],
 +                      [c_cv_have_two_getmntent="no"]
                )
        )
  fi
  # Check for different versions of `getmntent' here..
  
  if test "x$have_getmntent" = "xc"; then
 -      if test "x$have_one_getmntent" = "xyes"; then
 +      if test "x$c_cv_have_one_getmntent" = "xyes"; then
                AC_DEFINE(HAVE_ONE_GETMNTENT, 1,
                          [Define if the function getmntent exists and takes one argument.])
        fi
 -      if test "x$have_two_getmntent" = "xyes"; then
 +      if test "x$c_cv_have_two_getmntent" = "xyes"; then
                AC_DEFINE(HAVE_TWO_GETMNTENT, 1,
                          [Define if the function getmntent exists and takes two arguments.])
        fi
@@@ -1974,7 -1974,7 +1974,7 @@@ the
    LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
  
    AC_CACHE_CHECK([for libperl],
 -    [have_libperl],
 +    [c_cv_have_libperl],
      AC_LINK_IFELSE(
        AC_LANG_PROGRAM(
        [[
                         newSVpv ("Collectd::Plugin::FooBar", 24),
                         Nullsv);
        ]]),
 -      [have_libperl="yes"],
 -      [have_libperl="no"]
 +      [c_cv_have_libperl="yes"],
 +      [c_cv_have_libperl="no"]
      )
    )
  
 -  if test "x$have_libperl" = "xyes"
 +  if test "x$c_cv_have_libperl" = "xyes"
    then
          AC_DEFINE(HAVE_LIBPERL, 1, [Define if libperl is present and usable.])
          AC_SUBST(PERL_CFLAGS)
    LDFLAGS=$SAVE_LDFLAGS
  else if test -z "$perl_interpreter"; then
    with_libperl="no (no perl interpreter found)"
 -  have_libperl="no"
 +  c_cv_have_libperl="no"
  fi; fi
  AM_CONDITIONAL(BUILD_WITH_LIBPERL, test "x$with_libperl" = "xyes")
  
@@@ -2019,7 -2019,7 +2019,7 @@@ the
        LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
  
        AC_CACHE_CHECK([if perl supports ithreads],
 -              [have_perl_ithreads],
 +              [c_cv_have_perl_ithreads],
                AC_LINK_IFELSE(
                        AC_LANG_PROGRAM(
                        [[
  #endif /* !defined(USE_ITHREADS) */
                        ]],
                        [[ ]]),
 -                      [have_perl_ithreads="yes"],
 -                      [have_perl_ithreads="no"]
 +                      [c_cv_have_perl_ithreads="yes"],
 +                      [c_cv_have_perl_ithreads="no"]
                )
        )
  
 -      if test "x$have_perl_ithreads" = "xyes"
 +      if test "x$c_cv_have_perl_ithreads" = "xyes"
        then
                AC_DEFINE(HAVE_PERL_ITHREADS, 1, [Define if Perl supports ithreads.])
        fi
        LDFLAGS=$SAVE_LDFLAGS
  fi
  
 -have_broken_perl_load_module="no"
 +c_cv_have_broken_perl_load_module="no"
  if test "x$with_libperl" = "xyes"
  then
        SAVE_CFLAGS=$CFLAGS
        LDFLAGS="$LDFLAGS $PERL_LDFLAGS"
  
        AC_CACHE_CHECK([for broken Perl_load_module()],
 -              [have_broken_perl_load_module],
 +              [c_cv_have_broken_perl_load_module],
                AC_LINK_IFELSE(
                        AC_LANG_PROGRAM(
                        [[
                             newSVpv ("Collectd::Plugin::FooBar", 24),
                             Nullsv);
                        ]]),
 -                      [have_broken_perl_load_module="no"],
 -                      [have_broken_perl_load_module="yes"]
 +                      [c_cv_have_broken_perl_load_module="no"],
 +                      [c_cv_have_broken_perl_load_module="yes"]
                )
        )
  
        LDFLAGS=$SAVE_LDFLAGS
  fi
  AM_CONDITIONAL(HAVE_BROKEN_PERL_LOAD_MODULE,
 -              test "x$have_broken_perl_load_module" = "xyes")
 +              test "x$c_cv_have_broken_perl_load_module" = "xyes")
  
  if test "x$with_libperl" = "xyes"
  then
@@@ -3028,9 -3028,9 +3028,10 @@@ plugin_serial="no
  plugin_swap="no"
  plugin_tape="no"
  plugin_tcpconns="no"
+ plugin_ted="no"
  plugin_thermal="no"
  plugin_users="no"
 +plugin_uptime="no"
  plugin_vmem="no"
  plugin_vserver="no"
  plugin_wireless="no"
@@@ -3054,7 -3054,6 +3055,7 @@@ the
        plugin_swap="yes"
        plugin_tcpconns="yes"
        plugin_thermal="yes"
 +      plugin_uptime="yes"
        plugin_vmem="yes"
        plugin_vserver="yes"
        plugin_wireless="yes"
  fi
  
  # Solaris
 +if test "x$with_kstat" = "xyes"
 +then
 +      plugin_uptime="yes"
 +fi
 +
  if test "x$with_devinfo$with_kstat" = "xyesyes"
  then
        plugin_cpu="yes"
@@@ -3128,7 -3122,6 +3129,7 @@@ if test "x$have_sysctl" = "xyes
  then
        plugin_cpu="yes"
        plugin_swap="yes"
 +      plugin_uptime="yes"
  fi
  if test "x$have_sysctlbyname" = "xyes"
  then
@@@ -3161,7 -3154,7 +3162,7 @@@ the
        plugin_load="yes"
  fi
  
 -if test "x$have_libperl$have_perl_ithreads" = "xyesyes"
 +if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
  then
        plugin_perl="yes"
  fi
  if test "x$have_termios_h" = "xyes"
  then
        plugin_multimeter="yes"
+       plugin_ted="yes"
  fi
  
  if test "x$have_thread_info" = "xyes"
@@@ -3283,9 -3277,9 +3285,10 @@@ AC_PLUGIN([target_replace], [yes]
  AC_PLUGIN([target_set],  [yes],                [The set target])
  AC_PLUGIN([tcpconns],    [$plugin_tcpconns],   [TCP connection statistics])
  AC_PLUGIN([teamspeak2],  [yes],                [TeamSpeak2 server statistics])
+ AC_PLUGIN([ted],         [$plugin_ted],        [Read The Energy Detective values])
  AC_PLUGIN([thermal],     [$plugin_thermal],    [Linux ACPI thermal zone statistics])
  AC_PLUGIN([unixsock],    [yes],                [Unixsock communication plugin])
 +AC_PLUGIN([uptime],      [$plugin_uptime],     [Uptime statistics])
  AC_PLUGIN([users],       [$plugin_users],      [User statistics])
  AC_PLUGIN([uuid],        [yes],                [UUID as hostname plugin])
  AC_PLUGIN([vmem],        [$plugin_vmem],       [Virtual memory statistics])
@@@ -3568,9 -3562,9 +3571,10 @@@ Configuration
      target_set  . . . . . $enable_target_set
      tcpconns  . . . . . . $enable_tcpconns
      teamspeak2  . . . . . $enable_teamspeak2
+     ted . . . . . . . . . $enable_ted
      thermal . . . . . . . $enable_thermal
      unixsock  . . . . . . $enable_unixsock
 +    uptime  . . . . . . . $enable_uptime
      users . . . . . . . . $enable_users
      uuid  . . . . . . . . $enable_uuid
      vmem  . . . . . . . . $enable_vmem
diff --combined src/Makefile.am
@@@ -35,7 -35,6 +35,7 @@@ collectd_SOURCES = collectd.c collectd.
                   utils_avltree.c utils_avltree.h \
                   utils_cache.c utils_cache.h \
                   utils_complain.c utils_complain.h \
 +                 utils_heap.c utils_heap.h \
                   utils_ignorelist.c utils_ignorelist.h \
                   utils_llist.c utils_llist.h \
                   utils_parse_option.c utils_parse_option.h \
@@@ -91,11 -90,11 +91,11 @@@ collectdmon_SOURCES = collectdmon.
  collectdmon_CPPFLAGS = $(AM_CPPFLAGS)
  
  collectd_nagios_SOURCES = collectd-nagios.c
 -collectd_nagios_LDFLAGS =
 +collectd_nagios_LDADD =
  if BUILD_WITH_LIBSOCKET
 -collectd_nagios_LDFLAGS += -lsocket
 +collectd_nagios_LDADD += -lsocket
  endif
 -collectd_nagios_LDADD = libcollectdclient/libcollectdclient.la
 +collectd_nagios_LDADD += libcollectdclient/libcollectdclient.la
  collectd_nagios_DEPENDENCIES = libcollectdclient/libcollectdclient.la
  
  pkglib_LTLIBRARIES = 
@@@ -118,9 -117,8 +118,9 @@@ if BUILD_PLUGIN_APCUP
  pkglib_LTLIBRARIES += apcups.la
  apcups_la_SOURCES = apcups.c
  apcups_la_LDFLAGS = -module -avoid-version
 +apcups_la_LIBADD =
  if BUILD_WITH_LIBSOCKET
 -apcups_la_LDFLAGS += -lsocket
 +apcups_la_LIBADD += -lsocket
  endif
  collectd_LDADD += "-dlopen" apcups.la
  collectd_DEPENDENCIES += apcups.la
@@@ -129,8 -127,7 +129,8 @@@ endi
  if BUILD_PLUGIN_APPLE_SENSORS
  pkglib_LTLIBRARIES += apple_sensors.la
  apple_sensors_la_SOURCES = apple_sensors.c
 -apple_sensors_la_LDFLAGS = -module -avoid-version -lIOKit
 +apple_sensors_la_LDFLAGS = -module -avoid-version
 +apple_sensors_la_LIBADD = -lIOKit
  collectd_LDADD += "-dlopen" apple_sensors.la
  collectd_DEPENDENCIES += apple_sensors.la
  endif
@@@ -150,9 -147,8 +150,9 @@@ if BUILD_PLUGIN_BATTER
  pkglib_LTLIBRARIES += battery.la
  battery_la_SOURCES = battery.c
  battery_la_LDFLAGS = -module -avoid-version
 +battery_la_LIBADD =
  if BUILD_WITH_LIBIOKIT
 -battery_la_LDFLAGS += -lIOKit
 +battery_la_LIBADD += -lIOKit
  endif
  collectd_LDADD += "-dlopen" battery.la
  collectd_DEPENDENCIES += battery.la
@@@ -176,10 -172,10 +176,10 @@@ cpu_la_CFLAGS = $(AM_CFLAGS
  cpu_la_LDFLAGS = -module -avoid-version
  cpu_la_LIBADD = 
  if BUILD_WITH_LIBKSTAT
 -cpu_la_LDFLAGS += -lkstat
 +cpu_la_LIBADD += -lkstat
  endif
  if BUILD_WITH_LIBDEVINFO
 -cpu_la_LDFLAGS += -ldevinfo
 +cpu_la_LIBADD += -ldevinfo
  endif
  if BUILD_WITH_LIBSTATGRAB
  cpu_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
@@@ -245,13 -241,13 +245,13 @@@ disk_la_CFLAGS = $(AM_CFLAGS
  disk_la_LDFLAGS = -module -avoid-version
  disk_la_LIBADD = 
  if BUILD_WITH_LIBKSTAT
 -disk_la_LDFLAGS += -lkstat
 +disk_la_LIBADD += -lkstat
  endif
  if BUILD_WITH_LIBDEVINFO
 -disk_la_LDFLAGS += -ldevinfo
 +disk_la_LIBADD += -ldevinfo
  endif
  if BUILD_WITH_LIBIOKIT
 -disk_la_LDFLAGS += -lIOKit
 +disk_la_LIBADD += -lIOKit
  endif
  if BUILD_WITH_LIBSTATGRAB
  disk_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)  
@@@ -264,8 -260,7 +264,8 @@@ endi
  if BUILD_PLUGIN_DNS
  pkglib_LTLIBRARIES += dns.la
  dns_la_SOURCES = dns.c utils_dns.c utils_dns.h
 -dns_la_LDFLAGS = -module -avoid-version -lpcap -lpthread
 +dns_la_LDFLAGS = -module -avoid-version
 +dns_la_LIBADD = -lpcap -lpthread
  collectd_LDADD += "-dlopen" dns.la
  collectd_DEPENDENCIES += dns.la
  endif
@@@ -274,7 -269,9 +274,7 @@@ if BUILD_PLUGIN_EMAI
  pkglib_LTLIBRARIES += email.la
  email_la_SOURCES = email.c
  email_la_LDFLAGS = -module -avoid-version
 -if BUILD_WITH_LIBPTHREAD
 -email_la_LDFLAGS += -lpthread
 -endif
 +email_la_LIBADD = -lpthread
  collectd_LDADD += "-dlopen" email.la
  collectd_DEPENDENCIES += email.la
  endif
@@@ -293,7 -290,9 +293,7 @@@ exec_la_SOURCES = exec.c 
                  utils_cmd_putnotif.c utils_cmd_putnotif.h \
                  utils_cmd_putval.c utils_cmd_putval.h
  exec_la_LDFLAGS = -module -avoid-version
 -if BUILD_WITH_LIBPTHREAD
 -exec_la_LDFLAGS += -lpthread
 -endif
 +exec_la_LIBADD = -lpthread
  collectd_LDADD += "-dlopen" exec.la
  collectd_DEPENDENCIES += exec.la
  endif
@@@ -320,9 -319,8 +320,9 @@@ if BUILD_PLUGIN_HDDTEM
  pkglib_LTLIBRARIES += hddtemp.la
  hddtemp_la_SOURCES = hddtemp.c
  hddtemp_la_LDFLAGS = -module -avoid-version
 +hddtemp_la_LIBADD =
  if BUILD_WITH_LIBSOCKET
 -hddtemp_la_LDFLAGS += -lsocket
 +hddtemp_la_LIBADD += -lsocket
  endif
  collectd_LDADD += "-dlopen" hddtemp.la
  collectd_DEPENDENCIES += hddtemp.la
@@@ -341,10 -339,10 +341,10 @@@ interface_la_CFLAGS += $(BUILD_WITH_LIB
  interface_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
  else
  if BUILD_WITH_LIBKSTAT
 -interface_la_LDFLAGS += -lkstat
 +interface_la_LIBADD += -lkstat
  endif
  if BUILD_WITH_LIBDEVINFO
 -interface_la_LDFLAGS += -ldevinfo
 +interface_la_LIBADD += -ldevinfo
  endif # BUILD_WITH_LIBDEVINFO
  endif # !BUILD_WITH_LIBSTATGRAB
  endif # BUILD_PLUGIN_INTERFACE
@@@ -357,7 -355,7 +357,7 @@@ if BUILD_WITH_OWN_LIBIPT
  iptables_la_LIBADD  = libiptc/libiptc.la
  iptables_la_DEPENDENCIES = libiptc/libiptc.la
  else
 -iptables_la_LDFLAGS += -liptc
 +iptables_la_LIBADD = -liptc
  endif
  collectd_LDADD += "-dlopen" iptables.la
  collectd_DEPENDENCIES += iptables.la
@@@ -462,9 -460,8 +462,9 @@@ if BUILD_PLUGIN_MBMO
  pkglib_LTLIBRARIES += mbmon.la
  mbmon_la_SOURCES = mbmon.c
  mbmon_la_LDFLAGS = -module -avoid-version
 +mbmon_la_LIBADD =
  if BUILD_WITH_LIBSOCKET
 -mbmon_la_LDFLAGS += -lsocket
 +mbmon_la_LIBADD += -lsocket
  endif
  collectd_LDADD += "-dlopen" mbmon.la
  collectd_DEPENDENCIES += mbmon.la
@@@ -476,7 -473,7 +476,7 @@@ memcached_la_SOURCES = memcached.
  memcached_la_LDFLAGS = -module -avoid-version
  memcached_la_LIBADD =
  if BUILD_WITH_LIBSOCKET
 -memcached_la_LDFLAGS += -lsocket
 +memcached_la_LIBADD += -lsocket
  endif
  collectd_LDADD += "-dlopen" memcached.la
  collectd_DEPENDENCIES += memcached.la
@@@ -538,9 -535,11 +538,9 @@@ if BUILD_PLUGIN_NETWOR
  pkglib_LTLIBRARIES += network.la
  network_la_SOURCES = network.c network.h
  network_la_LDFLAGS = -module -avoid-version
 +network_la_LIBADD = -lpthread
  if BUILD_WITH_LIBSOCKET
 -network_la_LDFLAGS += -lsocket
 -endif
 -if BUILD_WITH_LIBPTHREAD
 -network_la_LDFLAGS += -lpthread
 +network_la_LIBADD += -lsocket
  endif
  collectd_LDADD += "-dlopen" network.la
  collectd_DEPENDENCIES += network.la
@@@ -572,8 -571,7 +572,8 @@@ if BUILD_PLUGIN_NOTIFY_DESKTO
  pkglib_LTLIBRARIES += notify_desktop.la
  notify_desktop_la_SOURCES = notify_desktop.c
  notify_desktop_la_CFLAGS = $(AM_CFLAGS) $(LIBNOTIFY_CFLAGS)
 -notify_desktop_la_LDFLAGS = -module -avoid-version $(LIBNOTIFY_LIBS)
 +notify_desktop_la_LDFLAGS = -module -avoid-version
 +notify_desktop_la_LIBADD = $(LIBNOTIFY_LIBS)
  collectd_LDADD += "-dlopen" notify_desktop.la
  collectd_DEPENDENCIES += notify_desktop.la
  endif
  if BUILD_PLUGIN_NOTIFY_EMAIL
  pkglib_LTLIBRARIES += notify_email.la
  notify_email_la_SOURCES = notify_email.c
 -notify_email_la_LDFLAGS = -L/usr/local/lib -lesmtp -lssl -lcrypto -pthread -module -avoid-version
 +notify_email_la_LDFLAGS = -module -avoid-version
 +notify_email_la_LIBADD = -lesmtp -lssl -lcrypto -lpthread -ldl
  collectd_LDADD += "-dlopen" notify_email.la
  collectd_DEPENDENCIES += notify_email.la
  endif
@@@ -591,9 -588,8 +591,9 @@@ if BUILD_PLUGIN_NTP
  pkglib_LTLIBRARIES += ntpd.la
  ntpd_la_SOURCES = ntpd.c
  ntpd_la_LDFLAGS = -module -avoid-version
 +ntpd_la_LIBADD =
  if BUILD_WITH_LIBSOCKET
 -ntpd_la_LDFLAGS += -lsocket
 +ntpd_la_LIBADD += -lsocket
  endif
  collectd_LDADD += "-dlopen" ntpd.la
  collectd_DEPENDENCIES += ntpd.la
@@@ -603,8 -599,7 +603,8 @@@ if BUILD_PLUGIN_NU
  pkglib_LTLIBRARIES += nut.la
  nut_la_SOURCES = nut.c
  nut_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
 -nut_la_LDFLAGS = -module -avoid-version -lpthread $(BUILD_WITH_LIBUPSCLIENT_LIBS)
 +nut_la_LDFLAGS = -module -avoid-version
 +nut_la_LIBADD = -lpthread $(BUILD_WITH_LIBUPSCLIENT_LIBS)
  collectd_LDADD += "-dlopen" nut.la
  collectd_DEPENDENCIES += nut.la
  endif
@@@ -666,10 -661,10 +666,10 @@@ pkglib_LTLIBRARIES += ping.l
  ping_la_SOURCES = ping.c
  ping_la_LDFLAGS = -module -avoid-version
  if BUILD_WITH_OWN_LIBOPING
 -ping_la_LIBADD  = liboping/liboping.la
 +ping_la_LIBADD = liboping/liboping.la
  ping_la_DEPENDENCIES = liboping/liboping.la
  else
 -ping_la_LDFLAGS += -loping
 +ping_la_LIBADD = -loping
  endif
  collectd_LDADD += "-dlopen" ping.la
  collectd_DEPENDENCIES += ping.la
@@@ -681,8 -676,7 +681,8 @@@ postgresql_la_SOURCES = postgresql.c 
                 utils_db_query.c utils_db_query.h
  postgresql_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBPQ_CPPFLAGS)
  postgresql_la_LDFLAGS = -module -avoid-version \
 -              $(BUILD_WITH_LIBPQ_LDFLAGS) -lpq
 +              $(BUILD_WITH_LIBPQ_LDFLAGS)
 +postgresql_la_LIBADD = -lpq
  collectd_LDADD += "-dlopen" postgresql.la
  collectd_DEPENDENCIES += postgresql.la
  endif
@@@ -739,8 -733,8 +739,8 @@@ if BUILD_PLUGIN_SENSOR
  pkglib_LTLIBRARIES += sensors.la
  sensors_la_SOURCES = sensors.c
  sensors_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBSENSORS_CFLAGS)
 -sensors_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBSENSORS_LDFLAGS)
 -sensors_la_LIBADD = -lsensors
 +sensors_la_LDFLAGS = -module -avoid-version
 +sensors_la_LIBADD = $(BUILD_WITH_LIBSENSORS_LDFLAGS)
  collectd_LDADD += "-dlopen" sensors.la
  collectd_DEPENDENCIES += sensors.la
  endif
@@@ -820,8 -814,7 +820,8 @@@ endi
  if BUILD_PLUGIN_TAPE
  pkglib_LTLIBRARIES += tape.la
  tape_la_SOURCES = tape.c
 -tape_la_LDFLAGS = -module -avoid-version -lkstat -ldevinfo
 +tape_la_LDFLAGS = -module -avoid-version
 +tape_la_LIBADD = -lkstat -ldevinfo
  collectd_LDADD += "-dlopen" tape.la
  collectd_DEPENDENCIES += tape.la
  endif
@@@ -870,6 -863,14 +870,14 @@@ collectd_LDADD += "-dlopen" teamspeak2.
  collectd_DEPENDENCIES += teamspeak2.la
  endif
  
+ if BUILD_PLUGIN_TED
+ pkglib_LTLIBRARIES += ted.la
+ ted_la_SOURCES = ted.c
+ ted_la_LDFLAGS = -module -avoid-version
+ collectd_LDADD += "-dlopen" ted.la
+ collectd_DEPENDENCIES += ted.la
+ endif
  if BUILD_PLUGIN_THERMAL
  pkglib_LTLIBRARIES += thermal.la
  thermal_la_SOURCES = thermal.c
@@@ -886,25 -887,11 +894,25 @@@ unixsock_la_SOURCES = unixsock.c 
                      utils_cmd_listval.h utils_cmd_listval.c \
                      utils_cmd_putval.h utils_cmd_putval.c \
                      utils_cmd_putnotif.h utils_cmd_putnotif.c
 -unixsock_la_LDFLAGS = -module -avoid-version -lpthread
 +unixsock_la_LDFLAGS = -module -avoid-version
 +unixsock_la_LIBADD = -lpthread
  collectd_LDADD += "-dlopen" unixsock.la
  collectd_DEPENDENCIES += unixsock.la
  endif
  
 +if BUILD_PLUGIN_UPTIME
 +pkglib_LTLIBRARIES += uptime.la
 +uptime_la_SOURCES = uptime.c
 +uptime_la_CFLAGS = $(AM_CFLAGS)
 +uptime_la_LDFLAGS = -module -avoid-version
 +uptime_la_LIBADD =
 +if BUILD_WITH_LIBKSTAT
 +uptime_la_LIBADD += -lkstat
 +endif
 +collectd_LDADD += "-dlopen" uptime.la
 +collectd_DEPENDENCIES += uptime.la
 +endif
 +
  if BUILD_PLUGIN_USERS
  pkglib_LTLIBRARIES += users.la
  users_la_SOURCES = users.c
@@@ -957,8 -944,7 +965,8 @@@ if BUILD_PLUGIN_XMM
  pkglib_LTLIBRARIES += xmms.la
  xmms_la_SOURCES = xmms.c
  xmms_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBXMMS_CFLAGS)
 -xmms_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBXMMS_LIBS)
 +xmms_la_LDFLAGS = -module -avoid-version
 +xmms_la_LIBADD = $(BUILD_WITH_LIBXMMS_LIBS)
  collectd_LDADD += "-dlopen" xmms.la
  collectd_DEPENDENCIES += xmms.la
  endif
diff --combined src/collectd.conf.pod
@@@ -1375,50 -1375,19 +1375,50 @@@ TCP-Port to connect to. Defaults to B<1
  
  =head2 Plugin C<mysql>
  
 -The C<mysql plugin> requires B<mysqlclient> to be installed. It connects to the
 -database when started and keeps the connection up as long as possible. When the
 -connection is interrupted for whatever reason it will try to re-connect. The
 -plugin will complaint loudly in case anything goes wrong.
 +The C<mysql plugin> requires B<mysqlclient> to be installed. It connects to
 +one or more databases when started and keeps the connection up as long as
 +possible. When the connection is interrupted for whatever reason it will try
 +to re-connect. The plugin will complaint loudly in case anything goes wrong.
 +
 +This plugin issues the MySQL C<SHOW STATUS> / C<SHOW GLOBAL STATUS> command
 +and collects information about MySQL network traffic, executed statements,
 +requests, the query cache and threads by evaluating the
 +C<Bytes_{received,sent}>, C<Com_*>, C<Handler_*>, C<Qcache_*> and C<Threads_*>
 +return values. Please refer to the B<MySQL reference manual>, I<5.1.6. Server
 +Status Variables> for an explanation of these values.
 +
 +Optionally, master and slave statistics may be collected in a MySQL
 +replication setup. In that case, information about the synchronization state
 +of the nodes are collected by evaluating the C<Position> return value of the
 +C<SHOW MASTER STATUS> command and the C<Seconds_Behind_Master>,
 +C<Read_Master_Log_Pos> and C<Exec_Master_Log_Pos> return values of the
 +C<SHOW SLAVE STATUS> command. See the B<MySQL reference manual>,
 +I<12.5.5.21 SHOW MASTER STATUS Syntax> and
 +I<12.5.5.31 SHOW SLAVE STATUS Syntax> for details.
  
 -This plugin issues the MySQL C<SHOW STATUS> command and collects information
 -about MySQL network traffic, executed statements, requests, the query cache
 -and threads by evaluating the C<Bytes_{received,sent}>, C<Com_*>,
 -C<Handler_*>, C<Qcache_*> and C<Threads_*> return values. Please refer to the
 -B<MySQL reference manual>, I<5.1.6. Server Status Variables> for an
 -explanation of these values.
 +Synopsis:
  
 -Use the following options to configure the plugin:
 +  <Plugin mysql>
 +    <Database foo>
 +      Host "hostname"
 +      User "username"
 +      Password "password"
 +      Port "3306"
 +      MasterStats true
 +    </Database>
 +
 +    <Database bar>
 +      Host "localhost"
 +      Socket "/var/run/mysql/mysqld.sock"
 +      SlaveStats true
 +      SlaveNotifications true
 +    </Database>
 +  </Plugin>
 +
 +A B<Database> block defines one connection to a MySQL database. It accepts a
 +single argument which specifies the name of the database. None of the other
 +options are required. MySQL will use default values as documented in the
 +section "mysql_real_connect()" in the B<MySQL reference manual>.
  
  =over 4
  
@@@ -1458,17 -1427,6 +1458,17 @@@ only has any effect, if B<Host> is set 
  Otherwise, use the B<Port> option above. See the documentation for the
  C<mysql_real_connect> function for details.
  
 +=item B<MasterStats> I<true|false>
 +
 +=item B<SlaveStats> I<true|false>
 +
 +Enable the collection of master / slave statistics in a replication setup.
 +
 +=item B<SlaveNotifications> I<true|false>
 +
 +If enabled, the plugin sends a notification if the replication slave I/O and /
 +or SQL threads are not running.
 +
  =back
  
  =head2 Plugin C<netlink>
@@@ -1813,11 -1771,6 +1813,11 @@@ enables you to do that: By setting B<Ig
  B<Sensor> is inverted: All selected interfaces are ignored and all other
  interfaces are collected.
  
 +=item B<Interval> I<Seconds>
 +
 +Sets the interval in which all sensors should be read. If not specified, the
 +global B<Interval> setting is used.
 +
  =back
  
  B<EXPERIMENTAL!> The C<onewire> plugin is experimental, because it doesn't yet
@@@ -2923,6 -2876,37 +2923,37 @@@ will be collected
  
  =back
  
+ =head2 Plugin C<ted>
+ The I<TED> plugin connects to a device of "The Energy Detective", a device to
+ measure power consumption. These devices are usually connected to a serial
+ (RS232) or USB port. The plugin opens a configured device and tries to read the
+ current energy readings. For more information on TED, visit
+ L<http://www.theenergydetective.com/>.
+ Available configuration options:
+ =over 4
+ =item B<Device> I<Path>
+ Path to the device on which TED is connected. collectd will need read and write
+ permissions on that file.
+ Default: B</dev/ttyUSB0>
+ =item B<Retries> I<Num>
+ Apparently reading from TED is not that reliable. You can therefore configure a
+ number of retries here. You only configure the I<retries> here, to if you
+ specify zero, one reading will be performed (but no retries if that fails); if
+ you specify three, a maximum of four readings are performed. Negative values
+ are illegal.
+ Default: B<0>
+ =back
  =head2 Plugin C<tcpconns>
  
  The C<tcpconns plugin> counts the number of currently established TCP