Merge branch 'feature/ZOL'
authorMarc Fournier <marc.fournier@camptocamp.com>
Fri, 22 Aug 2014 21:22:34 +0000 (23:22 +0200)
committerMarc Fournier <marc.fournier@camptocamp.com>
Fri, 22 Aug 2014 21:22:34 +0000 (23:22 +0200)
Conflicts:
configure.ac

1  2 
AUTHORS
configure.ac
contrib/redhat/collectd.spec
src/Makefile.am

diff --combined AUTHORS
+++ b/AUTHORS
@@@ -5,7 -5,7 +5,7 @@@ Florian "octo" Forster <octo at verplan
   - Initial author.
  
  Sebastian "tokkee" Harl <sh at tokkee.org>
 - - Bugfixes and enhancments in many places all around the project.
 + - Bugfixes and enhancements in many places all around the project.
   - perl plugin.
   - users plugin.
   - vserver plugin.
@@@ -47,18 -47,12 +47,18 @@@ Aurélien Reynaud <collectd at wattapow
   - LPAR plugin.
   - Various fixes for AIX, HP-UX and Solaris.
  
 +Benjamin Gilbert <bgilbert at cs.cmu.edu>
 + - Improvements to the LVM plugin.
 +
  Bert Vermeulen <bert at biot.com>
   - sigrok plugin
  
 +Brett Hawn <bhawn at llnw.com>
 + - write_tsdb plugin for http://opentsdb.net/
 +
  Bruno Prémont <bonbons at linux-vserver.org>
   - BIND plugin.
 - - Many bugreports and -fixes in various plugins,
 + - Many bug reports and -fixes in various plugins,
     especially a nasty bug in the network plugin.
   - Wireshark dissector.
  
@@@ -115,9 -109,6 +115,9 @@@ J. Javier Maestro <jjmaestro at ieee.or
  Jérôme Renard <jerome.renard at gmail.com>
   - varnish plugin.
  
 +Kevin Bowling <kbowling at llnw.com>
 + - write_tsdb plugin for http://opentsdb.net/
 +
  Kris Nielander <nielander at fox-it.com>
   - tail_csv plugin.
  
@@@ -147,6 -138,7 +147,7 @@@ Marc Fournier <marc.fournier at camptoc
   - Various fixes to the varnish plugin.
   - RPM specfile update.
   - libmnl support in the netlink plugin.
+  - linux support in the zfs_arc plugin.
  
  Marco Chiappero <marco at absence.it>
   - uptime plugin.
@@@ -204,10 -196,6 +205,10 @@@ Phoenix Kayo <kayo.k11.4 at gmail.com
  Pierre-Yves Ritschard <pyr at spootnik.org>
   - Write-Riemann plugin.
   - Write-Graphite plugin: Notification support.
 + - Write-Kafka plugin.
 + - Log-Logstash plugin.
 + - Normalization in the CPU plugin.
 + - Relative values in the Load plugin.
  
  Piotr Hosowicz <the55 at wp.pl>
   - SMF manifest for collectd.
@@@ -244,9 -232,6 +245,9 @@@ Sven Trenkel <collectd at semidefinite.
   - netapp plugin.
   - python plugin.
  
 +Tim Laszlo <tim.laszlo at gmail.com>
 + - drbd plugin
 +
  Thomas Meson <zllak at hycik.org>
   - Graphite support for the AMQP plugin.
  
@@@ -259,6 -244,9 +260,9 @@@ Tommie Gannert <d00-tga at d.kth.se
  Vincent Stehlé <vincent.stehle at free.fr>
   - hddtemp plugin.
  
+ Wilfried Goesgens <dothebart at citadel.org>
+  - linux support in the zfs_arc plugin.
  Xin Li <delphij at freebsd.org>
   - FreeBSD port of the ZFS-ARC plugin.
  
diff --combined configure.ac
@@@ -70,9 -70,11 +70,11 @@@ case $host_os i
        ac_system="Solaris"
        ;;
        *darwin*)
+       AC_DEFINE([KERNEL_DARWIN], 1, [True if program is to be compiled for a Darwin kernel])
        ac_system="Darwin"
        ;;
        *openbsd*)
+       AC_DEFINE([KERNEL_OPENBSD], 1, [True if program is to be compiled for an OpenBSD kernel])
        ac_system="OpenBSD"
        ;;
        *aix*)
  esac
  AC_MSG_RESULT([$ac_system])
  
+ AM_CONDITIONAL([BUILD_LINUX],[test "x$x$ac_system" = "xLinux"])
+ AM_CONDITIONAL([BUILD_SOLARIS],[test "x$x$ac_system" = "xSolaris"])
+ AM_CONDITIONAL([BUILD_DARWIN],[test "x$x$ac_system" = "xDarwin"])
+ AM_CONDITIONAL([BUILD_OPENBSD],[test "x$x$ac_system" = "xOpenBSD"])
+ AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
+ AM_CONDITIONAL([BUILD_FREEBSD],[test "x$x$ac_system" = "xFreeBSD"])
  if test "x$ac_system" = "xLinux"
  then
        AC_ARG_VAR([KERNEL_DIR], [path to Linux kernel sources])
@@@ -404,18 -413,6 +413,18 @@@ AC_CHECK_HEADERS(linux/if.h, [], []
  #  include <sys/socket.h>
  #endif
  ])
 +AC_CHECK_HEADERS(linux/inet_diag.h, [], [],
 +[
 +#if HAVE_SYS_TYPES_H
 +#  include <sys/types.h>
 +#endif
 +#if HAVE_SYS_SOCKET_H
 +#  include <sys/socket.h>
 +#endif
 +#if HAVE_LINUX_INET_DIAG_H
 +# include <linux/inet_diag.h>
 +#endif
 +])
  AC_CHECK_HEADERS(linux/netdevice.h, [], [],
  [
  #if HAVE_SYS_TYPES_H
@@@ -993,7 -990,7 +1002,7 @@@ if test "x$fp_layout_type" = "xunknown"
        uint8_t c[8];
        double d;
  
 -      d = 8.642135e130; 
 +      d = 8.642135e130;
        memcpy ((void *) &i0, (void *) &d, 8);
  
        i1 = i0;
@@@ -1048,7 -1045,7 +1057,7 @@@ if test "x$fp_layout_type" = "xunknown"
        uint8_t c[8];
        double d;
  
 -      d = 8.642135e130; 
 +      d = 8.642135e130;
        memcpy ((void *) &i0, (void *) &d, 8);
  
        i1 = endianflip (i0);
@@@ -1097,7 -1094,7 +1106,7 @@@ if test "x$fp_layout_type" = "xunknown"
        uint8_t c[8];
        double d;
  
 -      d = 8.642135e130; 
 +      d = 8.642135e130;
        memcpy ((void *) &i0, (void *) &d, 8);
  
        i1 = intswap (i0);
@@@ -1230,9 -1227,10 +1239,9 @@@ if test "x$have_getmntent" = "xgen"; th
  fi
  
  # Check for htonll
 -AC_MSG_CHECKING([if have htonll defined])
 -
 -    have_htonll="no"
 -    AC_LINK_IFELSE([AC_LANG_PROGRAM(
 +AC_CACHE_CHECK([if have htonll defined],
 +                  [c_cv_have_htonll],
 +                  AC_LINK_IFELSE([AC_LANG_PROGRAM(
  [[[
  #include <sys/types.h>
  #include <netinet/in.h>
            return htonll(0);
  ]]]
      )],
 -    [
 -      have_htonll="yes"
 -      AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
 -    ])
 - 
 -AC_MSG_RESULT([$have_htonll])
 +    [c_cv_have_htonll="yes"],
 +    [c_cv_have_htonll="no"]
 +  )
 +)
 +if test "x$c_cv_have_htonll" = "xyes"
 +then
 +    AC_DEFINE(HAVE_HTONLL, 1, [Define if the function htonll exists.])
 +fi
  
  # Check for structures
  AC_CHECK_MEMBERS([struct if_data.ifi_ibytes, struct if_data.ifi_opackets, struct if_data.ifi_ierrors],
@@@ -1271,13 -1267,6 +1280,13 @@@ AC_CHECK_MEMBERS([struct net_device_sta
        #include <linux/if.h>
        #include <linux/netdevice.h>
        ])
 +AC_CHECK_MEMBERS([struct inet_diag_req.id, struct inet_diag_req.idiag_states],
 +      [AC_DEFINE(HAVE_STRUCT_LINUX_INET_DIAG_REQ, 1, [Define if struct inet_diag_req exists and is usable.])],
 +      [],
 +      [
 +      #include <linux/inet_diag.h>
 +      ])
 +
  
  AC_CHECK_MEMBERS([struct ip_mreqn.imr_ifindex], [],
        [],
@@@ -1388,8 -1377,8 +1397,8 @@@ AC_CHECK_LIB(hal,libhal_device_property
             [with_libhal="no"])
  if test "x$with_libhal" = "xyes"; then
        if test "x$PKG_CONFIG" != "x"; then
 -              BUILD_WITH_LIBHAL_CFLAGS="`pkg-config --cflags hal`"
 -              BUILD_WITH_LIBHAL_LIBS="`pkg-config --libs hal`"
 +              BUILD_WITH_LIBHAL_CFLAGS="`$PKG_CONFIG --cflags hal`"
 +              BUILD_WITH_LIBHAL_LIBS="`$PKG_CONFIG --libs hal`"
                AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
                AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
        fi
  m4_divert_once([HELP_WITH], [
  collectd additional packages:])
  
- AM_CONDITIONAL([BUILD_FREEBSD],[test "x$x$ac_system" = "xFreeBSD"])
- AM_CONDITIONAL([BUILD_AIX],[test "x$x$ac_system" = "xAIX"])
  if test "x$ac_system" = "xAIX"
  then
        with_perfstat="yes"
@@@ -1730,7 -1715,6 +1735,7 @@@ the
        LDFLAGS="$LDFLAGS $with_libdbi_ldflags"
  
        AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"])
 +      AC_CHECK_LIB(dbi, dbi_driver_open_r, [with_libdbi_r="yes"], [with_libdbi_r="no"])
  
        CPPFLAGS="$SAVE_CPPFLAGS"
        LDFLAGS="$SAVE_LDFLAGS"
        AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS)
        AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS)
        AC_SUBST(BUILD_WITH_LIBDBI_LIBS)
 +
 +  if test "x$with_libdbi_r" = "xyes"
 +  then
 +              AC_DEFINE(HAVE_LIBDBI_R, 1, [Define if reentrant dbi facility is present and usable.])
 +  fi
  fi
  AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes")
  # }}}
@@@ -1966,7 -1945,10 +1971,7 @@@ AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, te
  # --with-libiptc {{{
  AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
  [
 -      if test "x$withval" = "xshipped"
 -      then
 -              with_libiptc="own"
 -      else if test "x$withval" = "xyes"
 +      if test "x$withval" = "xyes"
        then
                with_libiptc="pkgconfig"
        else if test "x$withval" = "xno"
                with_libiptc="yes"
                with_libiptc_cflags="-I$withval/include"
                with_libiptc_libs="-L$withval/lib"
 -      fi; fi; fi
 +      fi; fi
  ],
  [
        if test "x$ac_system" = "xLinux"
  
  CPPFLAGS="$SAVE_CPPFLAGS"
  
 -if test "x$with_libiptc" = "xown"
 -then
 -      with_libiptc_cflags=""
 -      with_libiptc_libs=""
 -fi
 -if test "x$with_libiptc" = "xown"
 -then
 -      AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
 -      [
 -              with_libiptc="no (Linux iptables headers not found)"
 -      ],
 -      [
 -#include "$srcdir/src/owniptc/ipt_kernel_headers.h"
 -      ])
 -fi
 -AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_libiptc" = "xown")
 -if test "x$with_libiptc" = "xown"
 -then
 -      AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
 -      with_libiptc="yes"
 -fi
 -
  AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
  if test "x$with_libiptc" = "xyes"
  then
@@@ -2261,7 -2265,7 +2266,7 @@@ the
          CPPFLAGS="$CPPFLAGS $with_liblvm2app_cppflags"
          LDFLAGS="$LDFLAGS $with_liblvm2app_ldflags"
  
 -        AC_CHECK_LIB(lvm2app, lvm_init, [with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_init' not found)"])
 +        AC_CHECK_LIB(lvm2app, lvm_lv_get_property, [with_liblvm2app="yes"], [with_liblvm2app="no (Symbol 'lvm_lv_get_property' not found)"])
  
          CPPFLAGS="$SAVE_CPPFLAGS"
          LDFLAGS="$SAVE_LDFLAGS"
@@@ -2795,7 -2799,7 +2800,7 @@@ the
        else
                SAVE_CPPFLAGS="$CPPFLAGS"
                CPPFLAGS="$CPPFLAGS $with_snmp_cflags"
 -              
 +
                AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [], [with_libnetsnmp="no (net-snmp/net-snmp-config.h not found)"])
  
                CPPFLAGS="$SAVE_CPPFLAGS"
  if test "x$with_oracle" = "xyes"
  then
        SAVE_CPPFLAGS="$CPPFLAGS"
 -      SAVE_LDFLAGS="$LDFLAGS"
 +      SAVE_LIBS="$LIBS"
        CPPFLAGS="$CPPFLAGS $with_oracle_cppflags"
 -      LDFLAGS="$LDFLAGS $with_oracle_libs"
 +      LIBS="$LIBS $with_oracle_libs"
  
        AC_CHECK_FUNC(OCIEnvCreate, [with_oracle="yes"], [with_oracle="no (Symbol 'OCIEnvCreate' not found)"])
  
        CPPFLAGS="$SAVE_CPPFLAGS"
 -      LDFLAGS="$SAVE_LDFLAGS"
 +      LIBS="$SAVE_LIBS"
  fi
  if test "x$with_oracle" = "xyes"
  then
@@@ -3022,7 -3026,7 +3027,7 @@@ if test "x$with_libowcapi" = "xyes
  then
        SAVE_CPPFLAGS="$CPPFLAGS"
        CPPFLAGS="$with_libowcapi_cppflags"
 -      
 +
        AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
  
        CPPFLAGS="$SAVE_CPPFLAGS"
@@@ -3033,7 -3037,7 +3038,7 @@@ the
        SAVE_CPPFLAGS="$CPPFLAGS"
        LDFLAGS="$with_libowcapi_libs"
        CPPFLAGS="$with_libowcapi_cppflags"
 -      
 +
        AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
  
        LDFLAGS="$SAVE_LDFLAGS"
  CPPFLAGS="$SAVE_CPPFLAGS"
  LDFLAGS="$SAVE_LDFLAGS"
  AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
 +
 +with_amqp_tcp_socket="no"
 +if test "x$with_librabbitmq" = "xyes"
 +then
 +      SAVE_CPPFLAGS="$CPPFLAGS"
 +      SAVE_LDFLAGS="$LDFLAGS"
 +      SAVE_LIBS="$LIBS"
 +      CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
 +      LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
 +      LIBS="-lrabbitmq"
 +
 +      AC_CHECK_HEADERS(amqp_tcp_socket.h amqp_socket.h)
 +      AC_CHECK_FUNC(amqp_tcp_socket_new, [with_amqp_tcp_socket="yes"], [with_amqp_tcp_socket="no"])
 +      if test "x$with_amqp_tcp_socket" = "xyes"
 +      then
 +              AC_DEFINE(HAVE_AMQP_TCP_SOCKET, 1,
 +                              [Define if librabbitmq provides the new TCP socket interface.])
 +      fi
 +
 +      AC_CHECK_DECLS(amqp_socket_close,
 +                              [amqp_socket_close_decl="yes"], [amqp_socket_close_decl="no"],
 +                              [[
 +#include <amqp.h>
 +#ifdef HAVE_AMQP_TCP_SOCKET_H
 +# include <amqp_tcp_socket.h>
 +#endif
 +#ifdef HAVE_AMQP_SOCKET_H
 +# include <amqp_socket.h>
 +#endif
 +                              ]])
 +
 +      CPPFLAGS="$SAVE_CPPFLAGS"
 +      LDFLAGS="$SAVE_LDFLAGS"
 +      LIBS="$SAVE_LIBS"
 +fi
 +# }}}
 +
 +# --with-librdkafka {{{
 +AC_ARG_WITH(librdkafka, [AS_HELP_STRING([--with-librdkafka@<:@=PREFIX@:>@], [Path to librdkafka.])],
 +[
 +  if test "x$withval" = "xno" && test "x$withval" != "xyes"
 +  then
 +    with_librdkafka_cppflags="-I$withval/include"
 +    with_librdkafka_ldflags="-L$withval/lib"
 +    with_librdkafka="yes"
 +  else
 +    with_librdkafka="$withval"
 +  fi
 +],
 +[
 +  with_librdkafka="yes"
 +])
 +SAVE_CPPFLAGS="$CPPFLAGS"
 +SAVE_LDFLAGS="$LDFLAGS"
 +
 +if test "x$with_librdkafka" = "xyes"
 +then
 +      AC_CHECK_HEADERS(librdkafka/rdkafka.h, [with_librdkafka="yes"], [with_librdkafka="no (librdkafka/rdkafka.h not found)"])
 +fi
 +
 +if test "x$with_librdkafka" = "xyes"
 +then
 +      AC_CHECK_LIB(rdkafka, rd_kafka_new, [with_librdkafka="yes"], [with_librdkafka="no (Symbol 'rd_kafka_new' not found)"])
 +  AC_CHECK_LIB(rdkafka, rd_kafka_conf_set_log_cb, [with_librdkafka_log_cb="yes"], [with_librdkafka_log_cb="no"])
 +  AC_CHECK_LIB(rdkafka, rd_kafka_conf_set_logger, [with_librdkafka_logger="yes"], [with_librdkafka_logger="no"])
 +fi
 +if test "x$with_librdkafka" = "xyes"
 +then
 +      BUILD_WITH_LIBRDKAFKA_CPPFLAGS="$with_librdkafka_cppflags"
 +      BUILD_WITH_LIBRDKAFKA_LDFLAGS="$with_librdkafka_ldflags"
 +      BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
 +      AC_SUBST(BUILD_WITH_LIBRDKAFKA_CPPFLAGS)
 +      AC_SUBST(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
 +      AC_SUBST(BUILD_WITH_LIBRDKAFKA_LIBS)
 +      AC_DEFINE(HAVE_LIBRDKAFKA, 1, [Define if librdkafka is present and usable.])
 +  if test "x$with_librdkafka_log_cb" = "xyes"
 +  then
 +        AC_DEFINE(HAVE_LIBRDKAFKA_LOG_CB, 1, [Define if librdkafka log facility is present and usable.])
 +  fi
 +  if test "x$with_librdkafka_logger" = "xyes"
 +  then
 +        AC_DEFINE(HAVE_LIBRDKAFKA_LOGGER, 1, [Define if librdkafka log facility is present and usable.])
 +  fi
 +fi
 +CPPFLAGS="$SAVE_CPPFLAGS"
 +LDFLAGS="$SAVE_LDFLAGS"
 +AM_CONDITIONAL(BUILD_WITH_LIBRDKAFKA, test "x$with_librdkafka" = "xyes")
 +
  # }}}
  
  # --with-librouteros {{{
@@@ -3899,20 -3815,18 +3904,20 @@@ AC_ARG_WITH(libsigrok, [AS_HELP_STRING(
                        with_libsigrok_ldflags="-L$withval/lib"
                fi
        fi
 -],[])
 +],[with_libsigrok="yes"])
  
  # libsigrok has a glib dependency
  if test "x$with_libsigrok" = "xyes"
  then
 -      if test -z "m4_ifdef([AM_PATH_GLIB_2_0], [yes], [])"
 -      then
 -              with_libsigrok="no (glib not available)"
 -      else
 -              AM_PATH_GLIB_2_0([2.28.0],
 -                      [with_libsigrok_cflags="$with_libsigrok_cflags $GLIB_CFLAGS"; with_libsigrok_ldflags="$with_libsigrok_ldflags $GLIB_LIBS"])
 -      fi
 +m4_ifdef([AM_PATH_GLIB_2_0],
 +      [
 +       AM_PATH_GLIB_2_0([2.28.0],
 +              [with_libsigrok_cflags="$with_libsigrok_cflags $GLIB_CFLAGS"; with_libsigrok_ldflags="$with_libsigrok_ldflags $GLIB_LIBS"])
 +      ],
 +      [
 +       with_libsigrok="no (glib not available)"
 +      ]
 +)
  fi
  
  # libsigrok headers
@@@ -4096,8 -4010,8 +4101,8 @@@ the
    if $PKG_CONFIG --exists tokyotyrant
    then
      with_libtokyotyrant_cppflags="$with_libtokyotyrant_cppflags `$PKG_CONFIG --cflags tokyotyrant`"
 -    with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `pkg-config --libs-only-L tokyotyrant`"
 -    with_libtokyotyrant_libs="$with_libtokyotyrant_libs `pkg-config --libs-only-l tokyotyrant`"
 +    with_libtokyotyrant_ldflags="$with_libtokyotyrant_ldflags `$PKG_CONFIG --libs-only-L tokyotyrant`"
 +    with_libtokyotyrant_libs="$with_libtokyotyrant_libs `$PKG_CONFIG --libs-only-l tokyotyrant`"
    fi
  fi
  
@@@ -4130,7 -4044,7 +4135,7 @@@ CPPFLAGS="$SAVE_CPPFLAGS
  LDFLAGS="$SAVE_LDFLAGS"
  
  if test "x$with_libtokyotyrant" = "xyes"
 -then 
 +then
    BUILD_WITH_LIBTOKYOTYRANT_CPPFLAGS="$with_libtokyotyrant_cppflags"
    BUILD_WITH_LIBTOKYOTYRANT_LDFLAGS="$with_libtokyotyrant_ldflags"
    BUILD_WITH_LIBTOKYOTYRANT_LIBS="$with_libtokyotyrant_libs"
  AM_CONDITIONAL(BUILD_WITH_LIBTOKYOTYRANT, test "x$with_libtokyotyrant" = "xyes")
  # }}}
  
 +# --with-libudev {{{
 +with_libudev_cflags=""
 +with_libudev_ldflags=""
 +AC_ARG_WITH(libudev, [AS_HELP_STRING([--with-libudev@<:@=PREFIX@:>@], [Path to libudev.])],
 +[
 +      if test "x$withval" = "xno"
 +      then
 +              with_libudev="no"
 +      else
 +              with_libudev="yes"
 +              if test "x$withval" != "xyes"
 +              then
 +                      with_libudev_cflags="-I$withval/include"
 +                      with_libudev_ldflags="-L$withval/lib"
 +                      with_libudev="yes"
 +              fi
 +      fi
 +],
 +[
 +      if test "x$ac_system" = "xLinux"
 +      then
 +              with_libudev="yes"
 +      else
 +              with_libudev="no (Linux only library)"
 +      fi
 +])
 +if test "x$with_libudev" = "xyes"
 +then
 +      SAVE_CPPFLAGS="$CPPFLAGS"
 +      CPPFLAGS="$CPPFLAGS $with_libudev_cflags"
 +
 +      AC_CHECK_HEADERS(libudev.h, [], [with_libudev="no (libudev.h not found)"])
 +
 +      CPPFLAGS="$SAVE_CPPFLAGS"
 +fi
 +if test "x$with_libudev" = "xyes"
 +then
 +      SAVE_CPPFLAGS="$CPPFLAGS"
 +      SAVE_LDFLAGS="$LDFLAGS"
 +      CPPFLAGS="$CPPFLAGS $with_libudev_cflags"
 +      LDFLAGS="$LDFLAGS $with_libudev_ldflags"
 +
 +      AC_CHECK_LIB(udev, udev_new,
 +      [
 +              AC_DEFINE(HAVE_LIBUDEV, 1, [Define to 1 if you have the udev library (-ludev).])
 +      ],
 +      [with_libudev="no (libudev not found)"])
 +
 +      CPPFLAGS="$SAVE_CPPFLAGS"
 +      LDFLAGS="$SAVE_LDFLAGS"
 +fi
 +if test "x$with_libudev" = "xyes"
 +then
 +      BUILD_WITH_LIBUDEV_CFLAGS="$with_libudev_cflags"
 +      BUILD_WITH_LIBUDEV_LDFLAGS="$with_libudev_ldflags"
 +      AC_SUBST(BUILD_WITH_LIBUDEV_CFLAGS)
 +      AC_SUBST(BUILD_WITH_LIBUDEV_LDFLAGS)
 +fi
 +AM_CONDITIONAL(BUILD_WITH_LIBUDEV, test "x$with_libudev" = "xyes")
 +# }}}
 +
  # --with-libupsclient {{{
  with_libupsclient_config=""
  with_libupsclient_cflags=""
@@@ -4614,7 -4467,7 +4619,7 @@@ with_libvirt_cflags="
  with_libvirt_ldflags=""
  if test "x$PKG_CONFIG" != "x"
  then
 -      pkg-config --exists 'libxml-2.0' 2>/dev/null
 +      $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
        if test "$?" = "0"
        then
                with_libxml2="yes"
                with_libxml2="no (pkg-config doesn't know libxml-2.0)"
        fi
  
 -      pkg-config --exists libvirt 2>/dev/null
 +      $PKG_CONFIG --exists libvirt 2>/dev/null
        if test "$?" = "0"
        then
                with_libvirt="yes"
  fi
  if test "x$with_libxml2" = "xyes"
  then
 -      with_libxml2_cflags="`pkg-config --cflags libxml-2.0`"
 +      with_libxml2_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
        if test $? -ne 0
        then
                with_libxml2="no"
        fi
 -      with_libxml2_ldflags="`pkg-config --libs libxml-2.0`"
 +      with_libxml2_ldflags="`$PKG_CONFIG --libs libxml-2.0`"
        if test $? -ne 0
        then
                with_libxml2="no"
@@@ -4677,12 -4530,12 +4682,12 @@@ if test "x$with_libxml2" = "xyes"; the
  fi
  if test "x$with_libvirt" = "xyes"
  then
 -      with_libvirt_cflags="`pkg-config --cflags libvirt`"
 +      with_libvirt_cflags="`$PKG_CONFIG --cflags libvirt`"
        if test $? -ne 0
        then
                with_libvirt="no"
        fi
 -      with_libvirt_ldflags="`pkg-config --libs libvirt`"
 +      with_libvirt_ldflags="`$PKG_CONFIG --libs libvirt`"
        if test $? -ne 0
        then
                with_libvirt="no"
@@@ -4938,7 -4791,6 +4943,7 @@@ dependency_warning="no
  dependency_error="no"
  
  plugin_ascent="no"
 +plugin_barometer="no"
  plugin_battery="no"
  plugin_bind="no"
  plugin_cgroups="no"
@@@ -4950,7 -4802,6 +4955,7 @@@ plugin_curl_json="no
  plugin_curl_xml="no"
  plugin_df="no"
  plugin_disk="no"
 +plugin_drbd="no"
  plugin_entropy="no"
  plugin_ethstat="no"
  plugin_fscache="no"
@@@ -4960,7 -4811,6 +4965,7 @@@ plugin_ipvs="no
  plugin_irq="no"
  plugin_libvirt="no"
  plugin_load="no"
 +plugin_log_logstash="no"
  plugin_memory="no"
  plugin_multimeter="no"
  plugin_nfs="no"
@@@ -4991,7 -4841,6 +4996,7 @@@ the
        plugin_cpu="yes"
        plugin_cpufreq="yes"
        plugin_disk="yes"
 +      plugin_drbd="yes"
        plugin_entropy="yes"
        plugin_fscache="yes"
        plugin_interface="yes"
        plugin_vmem="yes"
        plugin_vserver="yes"
        plugin_wireless="yes"
+       plugin_zfs_arc="yes"
  
        if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
        then
        plugin_tape="yes"
  fi
  
 +# libi2c-dev
 +with_libi2c="no"
 +if test "x$ac_system" = "xLinux"
 +then
 +AC_CHECK_DECL(i2c_smbus_read_i2c_block_data,
 +      [with_libi2c="yes"],
 +      [with_libi2c="no (symbol i2c_smbus_read_i2c_block_data not found - have you installed libi2c-dev ?)"],
 +      [[#include <stdlib.h>
 +      #include <linux/i2c-dev.h>]])
 +fi
 +
 +if test "x$with_libi2c" = "xyes"
 +then
 +      plugin_barometer="yes"
 +fi
 +
 +
  # libstatgrab
  if test "x$with_libstatgrab" = "xyes"
  then
        plugin_load="yes"
  fi
  
 +if test "x$with_libyajl" = "xyes"
 +then
 +      plugin_log_logstash="yes"
 +fi
 +
  if test "x$c_cv_have_libperl$c_cv_have_perl_ithreads" = "xyesyes"
  then
        plugin_perl="yes"
  
  if test "x$have_termios_h" = "xyes"
  then
 -      plugin_multimeter="yes"
 +      if test "x$ac_system" != "xAIX"
 +      then
 +              plugin_multimeter="yes"
 +      fi
        plugin_ted="yes"
  fi
  
@@@ -5295,7 -5120,6 +5301,7 @@@ AC_PLUGIN([apcups],      [yes]
  AC_PLUGIN([apple_sensors], [$with_libiokit],   [Apple's hardware sensors])
  AC_PLUGIN([aquaero],     [$with_libaquaero5],  [Aquaero's hardware sensors])
  AC_PLUGIN([ascent],      [$plugin_ascent],     [AscentEmu player statistics])
 +AC_PLUGIN([barometer],   [$plugin_barometer],  [Barometer sensor on I2C])
  AC_PLUGIN([battery],     [$plugin_battery],    [Battery statistics])
  AC_PLUGIN([bind],        [$plugin_bind],       [ISC Bind nameserver statistics])
  AC_PLUGIN([conntrack],   [$plugin_conntrack],  [nf_conntrack statistics])
@@@ -5310,7 -5134,6 +5316,7 @@@ AC_PLUGIN([cgroups],     [$plugin_cgrou
  AC_PLUGIN([dbi],         [$with_libdbi],       [General database statistics])
  AC_PLUGIN([df],          [$plugin_df],         [Filesystem usage statistics])
  AC_PLUGIN([disk],        [$plugin_disk],       [Disk usage statistics])
 +AC_PLUGIN([drbd],        [$plugin_drbd],       [DRBD statistics])
  AC_PLUGIN([dns],         [$with_libpcap],      [DNS traffic analysis])
  AC_PLUGIN([email],       [yes],                [EMail statistics])
  AC_PLUGIN([entropy],     [$plugin_entropy],    [Entropy statistics])
@@@ -5329,7 -5152,6 +5335,7 @@@ AC_PLUGIN([java],        [$with_java]
  AC_PLUGIN([libvirt],     [$plugin_libvirt],    [Virtual machine statistics])
  AC_PLUGIN([load],        [$plugin_load],       [System load])
  AC_PLUGIN([logfile],     [yes],                [File logging plugin])
 +AC_PLUGIN([log_logstash], [$plugin_log_logstash], [Logstash json_event compatible logging])
  AC_PLUGIN([lpar],        [$with_perfstat],     [AIX logical partitions statistics])
  AC_PLUGIN([lvm],         [$with_liblvm2app],   [LVM statistics])
  AC_PLUGIN([madwifi],     [$have_linux_wireless_h], [Madwifi wireless statistics])
@@@ -5407,11 -5229,9 +5413,11 @@@ AC_PLUGIN([vserver],     [$plugin_vserv
  AC_PLUGIN([wireless],    [$plugin_wireless],   [Wireless statistics])
  AC_PLUGIN([write_graphite], [yes],             [Graphite / Carbon output plugin])
  AC_PLUGIN([write_http],  [$with_libcurl],      [HTTP output plugin])
 +AC_PLUGIN([write_kafka],  [$with_librdkafka],  [Kafka output plugin])
  AC_PLUGIN([write_mongodb], [$with_libmongoc],  [MongoDB output plugin])
  AC_PLUGIN([write_redis], [$with_libcredis],    [Redis output plugin])
  AC_PLUGIN([write_riemann], [$have_protoc_c],   [Riemann output plugin])
 +AC_PLUGIN([write_tsdb],  [yes],                [TSDB output plugin])
  AC_PLUGIN([xmms],        [$with_libxmms],      [XMMS statistics])
  AC_PLUGIN([zfs_arc],     [$plugin_zfs_arc],    [ZFS ARC statistics])
  
@@@ -5419,7 -5239,6 +5425,7 @@@ dnl Default configuration fil
  # Load either syslog or logfile
  LOAD_PLUGIN_SYSLOG=""
  LOAD_PLUGIN_LOGFILE=""
 +LOAD_PLUGIN_LOG_LOGSTASH=""
  
  AC_MSG_CHECKING([which default log plugin to load])
  default_log_plugin="none"
  else
        LOAD_PLUGIN_LOGFILE="##"
  fi
 +
 +if test "x$enable_log_logstash" = "xyes"
 +then
 +  LOAD_PLUGIN_LOG_LOGSTASH="#"
 +else
 +  LOAD_PLUGIN_LOG_LOGSTASH="##"
 +fi
 +
 +
  AC_MSG_RESULT([$default_log_plugin])
  
  AC_SUBST(LOAD_PLUGIN_SYSLOG)
  AC_SUBST(LOAD_PLUGIN_LOGFILE)
 +AC_SUBST(LOAD_PLUGIN_LOG_LOGSTASH)
  
  DEFAULT_LOG_LEVEL="info"
  if test "x$enable_debug" = "xyes"
@@@ -5603,13 -5412,11 +5609,13 @@@ Configuration
      libesmtp  . . . . . . $with_libesmtp
      libganglia  . . . . . $with_libganglia
      libgcrypt . . . . . . $with_libgcrypt
 +    libi2c-dev  . . . . . $with_libi2c
      libiokit  . . . . . . $with_libiokit
      libiptc . . . . . . . $with_libiptc
      libjvm  . . . . . . . $with_java
      libkstat  . . . . . . $with_kstat
      libkvm  . . . . . . . $with_libkvm
 +    liblvm2app  . . . . . $with_liblvm2app
      libmemcached  . . . . $with_libmemcached
      libmnl  . . . . . . . $with_libmnl
      libmodbus . . . . . . $with_libmodbus
      libpq . . . . . . . . $with_libpq
      libpthread  . . . . . $with_libpthread
      librabbitmq . . . . . $with_librabbitmq
 +    librdkafka  . . . . . $with_librdkafka
      librouteros . . . . . $with_librouteros
      librrd  . . . . . . . $with_librrd
      libsensors  . . . . . $with_libsensors
      libsigrok   . . . . . $with_libsigrok
      libstatgrab . . . . . $with_libstatgrab
      libtokyotyrant  . . . $with_libtokyotyrant
 +    libudev . . . . . . . $with_libudev
      libupsclient  . . . . $with_libupsclient
      libvarnish  . . . . . $with_libvarnish
      libvirt . . . . . . . $with_libvirt
      aquaero . . . . . . . $enable_aquaero
      apple_sensors . . . . $enable_apple_sensors
      ascent  . . . . . . . $enable_ascent
 +    barometer . . . . . . $enable_barometer
      battery . . . . . . . $enable_battery
      bind  . . . . . . . . $enable_bind
      conntrack . . . . . . $enable_conntrack
      df  . . . . . . . . . $enable_df
      disk  . . . . . . . . $enable_disk
      dns . . . . . . . . . $enable_dns
 +    drbd  . . . . . . . . $enable_drbd
      email . . . . . . . . $enable_email
      entropy . . . . . . . $enable_entropy
      ethstat . . . . . . . $enable_ethstat
      load  . . . . . . . . $enable_load
      logfile . . . . . . . $enable_logfile
      lpar  . . . . . . . . $enable_lpar
 +    log_logstash  . . . . $enable_log_logstash
      lvm . . . . . . . . . $enable_lvm
      madwifi . . . . . . . $enable_madwifi
      match_empty_counter . $enable_match_empty_counter
      wireless  . . . . . . $enable_wireless
      write_graphite  . . . $enable_write_graphite
      write_http  . . . . . $enable_write_http
 +    write_kafka . . . . . $enable_write_kafka
      write_mongodb . . . . $enable_write_mongodb
      write_redis . . . . . $enable_write_redis
      write_riemann . . . . $enable_write_riemann
 +    write_tsdb  . . . . . $enable_write_tsdb
      xmms  . . . . . . . . $enable_xmms
      zfs_arc . . . . . . . $enable_zfs_arc
  
@@@ -45,7 -45,6 +45,7 @@@
  %{?el6:%global _has_ip_vs_h 1}
  %{?el6:%global _has_lvm2app_h 1}
  %{?el6:%global _has_perl_extutils_embed 1}
 +%{?el6:%global _has_libmodbus 1}
  
  # plugins enabled by default
  %define with_aggregation 0%{!?_without_aggregation:1}
@@@ -93,7 -92,6 +93,7 @@@
  %define with_memcached 0%{!?_without_memcached:1}
  %define with_memory 0%{!?_without_memory:1}
  %define with_multimeter 0%{!?_without_multimeter:1}
 +%define with_modbus 0%{!?_without_modbus:0%{?_has_libmodbus}}
  %define with_mysql 0%{!?_without_mysql:1}
  %define with_netlink 0%{!?_without_netlink:1}
  %define with_network 0%{!?_without_network:1}
  %define with_write_graphite 0%{!?_without_write_graphite:1}
  %define with_write_http 0%{!?_without_write_http:1}
  %define with_write_riemann 0%{!?_without_write_riemann:1}
+ %define with_zfs_arc 0%{!?_without_zfs_arc:1}
  
  # Plugins not built by default because of dependencies on libraries not
  # available in RHEL or EPEL:
  %define with_write_redis 0%{!?_without_write_redis:0}
  # plugin xmms disabled, requires xmms
  %define with_xmms 0%{!?_without_xmms:0}
- # plugin zfs_arc disabled, requires FreeBSD/Solaris
- %define with_zfs_arc 0%{!?_without_zfs_arc:0}
  
  Summary:      Statistics collection daemon for filling RRD files
  Name:         collectd
@@@ -424,16 -421,6 +423,16 @@@ The mic plugin collects CPU usage, memo
  consumption from Intel Many Integrated Core (MIC) CPUs.
  %endif
  
 +%if %{with_modbus}
 +%package modbus
 +Summary:       modbus plugin for collectd
 +Group:         System Environment/Daemons
 +Requires:      %{name}%{?_isa} = %{version}-%{release}
 +BuildRequires:        libmodbus-devel
 +%description modbus
 +The modbus plugin collects values from Modbus/TCP enabled devices
 +%endif
 +
  %if %{with_mysql}
  %package mysql
  Summary:      MySQL plugin for collectd
@@@ -1009,12 -996,6 +1008,12 @@@ Development files for libcollectdclien
  %define _with_multimeter --disable-multimeter
  %endif
  
 +%if %{with_modbus}
 +%define _with_modbus --enable-modbus
 +%else
 +%define _with_modbus --disable-modbus
 +%endif
 +
  %if %{with_mysql}
  %define _with_mysql --enable-mysql
  %else
  - Enable cgroups, lvm and statsd plugins
  - Enable (but don't build by default) mic, aquaero and sigrok plugins
  
 +* Wed Aug 06 2014 Marc Fournier <marc.fournier@camptocamp.com> 5.3.1-2
 +- Enabled modbus plugin
 +
  * Tue Aug 06 2013 Marc Fournier <marc.fournier@camptocamp.com> 5.3.1-1
  - New upstream version
  - Added RHEL5 support:
  * Sat Nov 17 2012 Ruben Kerkhof <ruben@tilaa.nl> 5.1.0-2
  - Move perl stuff to perl_vendorlib
  - Replace hardcoded paths with macros
 -- Remove unneccesary Requires
 +- Remove unnecessary Requires
  - Removed .a and .la files
  - Some other small cleanups
  
  - New upstream version
  - Changes to support 5.1.0
  - Enabled all buildable plugins based on libraries available on EL6 + EPEL
 -- All plugins requiring external libraries are now shipped in seperate
 +- All plugins requiring external libraries are now shipped in separate
    packages.
  - No longer treat Java plugin as an exception, correctly set $JAVA_HOME during
    the build process + ensure build deps are installed.
diff --combined src/Makefile.am
@@@ -17,8 -17,6 +17,8 @@@ endi
  AM_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"'
  AM_CPPFLAGS += -DPKGDATADIR='"${pkgdatadir}"'
  
 +AUTOMAKE_OPTIONS = subdir-objects
 +
  sbin_PROGRAMS = collectd collectdmon
  bin_PROGRAMS = collectd-nagios collectdctl collectd-tg
  
@@@ -41,9 -39,7 +41,9 @@@ collectd_SOURCES = collectd.c collectd.
                   utils_subst.c utils_subst.h \
                   utils_tail.c utils_tail.h \
                   utils_time.c utils_time.h \
 -                 types_list.c types_list.h
 +                 types_list.c types_list.h \
 +                 utils_threshold.c utils_threshold.h
 +
  
  collectd_CPPFLAGS =  $(AM_CPPFLAGS) $(LTDLINCL)
  collectd_CFLAGS = $(AM_CFLAGS)
@@@ -137,9 -133,9 +137,9 @@@ collectd_tg_LDADD += libcollectdclient/
  collectd_tg_DEPENDENCIES = libcollectdclient/libcollectdclient.la
  
  
 -pkglib_LTLIBRARIES = 
 +pkglib_LTLIBRARIES =
  
 -BUILT_SOURCES = 
 +BUILT_SOURCES =
  CLEANFILES =
  
  if BUILD_PLUGIN_AGGREGATION
@@@ -221,15 -217,6 +221,15 @@@ collectd_LDADD += "-dlopen" ascent.l
  collectd_DEPENDENCIES += ascent.la
  endif
  
 +if BUILD_PLUGIN_BAROMETER
 +pkglib_LTLIBRARIES += barometer.la
 +barometer_la_SOURCES = barometer.c
 +barometer_la_LDFLAGS = -module -avoid-version
 +barometer_la_LIBADD = -lm
 +collectd_LDADD += "-dlopen" barometer.la
 +collectd_DEPENDENCIES += barometer.la
 +endif
 +
  if BUILD_PLUGIN_BATTERY
  pkglib_LTLIBRARIES += battery.la
  battery_la_SOURCES = battery.c
@@@ -286,7 -273,7 +286,7 @@@ pkglib_LTLIBRARIES += cpu.l
  cpu_la_SOURCES = cpu.c
  cpu_la_CFLAGS = $(AM_CFLAGS)
  cpu_la_LDFLAGS = -module -avoid-version
 -cpu_la_LIBADD = 
 +cpu_la_LIBADD =
  if BUILD_WITH_LIBKSTAT
  cpu_la_LIBADD += -lkstat
  endif
@@@ -384,7 -371,7 +384,7 @@@ pkglib_LTLIBRARIES += disk.l
  disk_la_SOURCES = disk.c
  disk_la_CFLAGS = $(AM_CFLAGS)
  disk_la_LDFLAGS = -module -avoid-version
 -disk_la_LIBADD = 
 +disk_la_LIBADD =
  if BUILD_WITH_LIBKSTAT
  disk_la_LIBADD += -lkstat
  endif
@@@ -395,12 -382,9 +395,12 @@@ if BUILD_WITH_LIBIOKI
  disk_la_LDFLAGS += -framework IOKit
  endif
  if BUILD_WITH_LIBSTATGRAB
 -disk_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)  
 +disk_la_CFLAGS += $(BUILD_WITH_LIBSTATGRAB_CFLAGS)
  disk_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
  endif
 +if BUILD_WITH_LIBUDEV
 +disk_la_LIBADD += -ludev
 +endif
  if BUILD_WITH_PERFSTAT
  disk_la_LIBADD += -lperfstat
  endif
@@@ -417,15 -401,6 +417,15 @@@ collectd_LDADD += "-dlopen" dns.l
  collectd_DEPENDENCIES += dns.la
  endif
  
 +if BUILD_PLUGIN_DRBD
 +pkglib_LTLIBRARIES += drbd.la
 +drbd_la_SOURCES = drbd.c
 +drbd_la_LDFLAGS = -module -avoid-version
 +drbd_la_LIBADD = -lpthread
 +collectd_LDADD += "-dlopen" drbd.la
 +collectd_DEPENDENCIES += drbd.la
 +endif
 +
  if BUILD_PLUGIN_EMAIL
  pkglib_LTLIBRARIES += email.la
  email_la_SOURCES = email.c
@@@ -520,8 -495,8 +520,8 @@@ if BUILD_PLUGIN_IPTABLE
  pkglib_LTLIBRARIES += iptables.la
  iptables_la_SOURCES = iptables.c
  iptables_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBIPTC_CPPFLAGS)
 -iptables_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBIPTC_LDFLAGS)
 -iptables_la_LIBADD = -liptc
 +iptables_la_LDFLAGS = -module -avoid-version
 +iptables_la_LIBADD = $(BUILD_WITH_LIBIPTC_LDFLAGS)
  collectd_LDADD += "-dlopen" iptables.la
  collectd_DEPENDENCIES += iptables.la
  endif
@@@ -602,17 -577,6 +602,17 @@@ collectd_LDADD += "-dlopen" logfile.l
  collectd_DEPENDENCIES += logfile.la
  endif
  
 +if BUILD_PLUGIN_LOG_LOGSTASH
 +pkglib_LTLIBRARIES += log_logstash.la
 +log_logstash_la_SOURCES = log_logstash.c
 +log_logstash_la_CFLAGS = $(AM_CFLAGS)
 +log_logstash_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBYAJL_LDFLAGS)
 +log_logstash_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
 +log_logstash_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
 +collectd_LDADD += "-dlopen" log_logstash.la
 +collectd_DEPENDENCIES += log_logstash.la
 +endif
 +
  if BUILD_PLUGIN_LPAR
  pkglib_LTLIBRARIES += lpar.la
  lpar_la_SOURCES = lpar.c
@@@ -898,7 -862,7 +898,7 @@@ if BUILD_PLUGIN_OLSR
  pkglib_LTLIBRARIES += olsrd.la
  olsrd_la_SOURCES = olsrd.c
  olsrd_la_LDFLAGS = -module -avoid-version
 -olsrd_la_LIBADD = 
 +olsrd_la_LIBADD =
  if BUILD_WITH_LIBSOCKET
  olsrd_la_LIBADD += -lsocket
  endif
@@@ -1305,7 -1269,6 +1305,7 @@@ pkglib_LTLIBRARIES += unixsock.l
  unixsock_la_SOURCES = unixsock.c \
                      utils_cmd_flush.h utils_cmd_flush.c \
                      utils_cmd_getval.h utils_cmd_getval.c \
 +                    utils_cmd_getthreshold.h utils_cmd_getthreshold.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
@@@ -1424,19 -1387,6 +1424,19 @@@ endi
  collectd_DEPENDENCIES += write_http.la
  endif
  
 +if BUILD_PLUGIN_WRITE_KAFKA
 +pkglib_LTLIBRARIES += write_kafka.la
 +write_kafka_la_SOURCES = write_kafka.c \
 +                        utils_format_graphite.c utils_format_graphite.h \
 +                        utils_format_json.c utils_format_json.h \
 +                        utils_cmd_putval.c utils_cmd_putval.h \
 +                        utils_crc32.c utils_crc32.h
 +write_kafka_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
 +write_kafka_la_LIBADD = $(BUILD_WITH_LIBRDKAFKA_LIBS)
 +collectd_LDADD += "-dlopen" write_kafka.la
 +collectd_DEPENDENCIES += write_kafka.la
 +endif
 +
  if BUILD_PLUGIN_WRITE_MONGODB
  pkglib_LTLIBRARIES += write_mongodb.la
  write_mongodb_la_SOURCES = write_mongodb.c
@@@ -1459,7 -1409,7 +1459,7 @@@ endi
  
  if BUILD_PLUGIN_WRITE_RIEMANN
  pkglib_LTLIBRARIES += write_riemann.la
 -write_riemann_la_SOURCES = write_riemann.c
 +write_riemann_la_SOURCES = write_riemann.c write_riemann_threshold.c
  nodist_write_riemann_la_SOURCES = riemann.pb-c.c riemann.pb-c.h
  write_riemann_la_LDFLAGS = -module -avoid-version
  write_riemann_la_LIBADD = -lprotobuf-c
@@@ -1467,14 -1417,6 +1467,14 @@@ collectd_LDADD += "-dlopen" write_riema
  collectd_DEPENDENCIES += write_riemann.la
  endif
  
 +if BUILD_PLUGIN_WRITE_TSDB
 +pkglib_LTLIBRARIES += write_tsdb.la
 +write_tsdb_la_SOURCES = write_tsdb.c
 +write_tsdb_la_LDFLAGS = -module -avoid-version
 +collectd_LDADD += "-dlopen" write_tsdb.la
 +collectd_DEPENDENCIES += write_tsdb.la
 +endif
 +
  if BUILD_PLUGIN_XMMS
  pkglib_LTLIBRARIES += xmms.la
  xmms_la_SOURCES = xmms.c
@@@ -1493,8 -1435,13 +1493,13 @@@ zfs_arc_la_LDFLAGS = -module -avoid-ver
  if BUILD_FREEBSD
  zfs_arc_la_LIBADD = -lm
  else
+ if BUILD_LINUX
+ # zfs_arc requires no library on linux
+ else
+ # solaris
  zfs_arc_la_LIBADD = -lkstat
  endif
+ endif
  collectd_LDADD += "-dlopen" zfs_arc.la
  collectd_DEPENDENCIES += zfs_arc.la
  endif
@@@ -1593,48 -1540,15 +1598,48 @@@ uninstall-hook
        rm -f $(DESTDIR)$(sysconfdir)/collectd.conf
        rm -f $(DESTDIR)$(pkgdatadir)/postgresql_default.conf;
  
 -if BUILD_FEATURE_DEBUG
 -bin_PROGRAMS += utils_vl_lookup_test
 -utils_vl_lookup_test_SOURCES = utils_vl_lookup_test.c \
 +check_PROGRAMS = test_common test_utils_avltree test_utils_heap test_utils_mount test_utils_vl_lookup
 +
 +test_common_SOURCES = tests/test_common.c \
 +                      common.h common.c \
 +                      tests/mock/plugin.c \
 +                      tests/mock/utils_cache.c \
 +                      tests/mock/utils_time.c
 +test_common_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
 +test_common_LDFLAGS = -export-dynamic
 +test_common_LDADD =
 +
 +test_utils_avltree_SOURCES = tests/test_utils_avltree.c \
 +                             utils_avltree.c utils_avltree.h
 +test_utils_avltree_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
 +test_utils_avltree_LDFLAGS = -export-dynamic
 +test_utils_avltree_LDADD =
 +
 +test_utils_heap_SOURCES = tests/test_utils_heap.c \
 +                          utils_heap.c utils_heap.h
 +test_utils_heap_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
 +test_utils_heap_LDFLAGS = -export-dynamic
 +test_utils_heap_LDADD =
 +
 +test_utils_mount_SOURCES = tests/test_utils_mount.c \
 +                           utils_mount.c utils_mount.h \
 +                           common.c common.h \
 +                           tests/mock/plugin.c \
 +                           tests/mock/utils_cache.c \
 +                           tests/mock/utils_time.c
 +test_utils_mount_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
 +test_utils_mount_LDFLAGS = -export-dynamic
 +test_utils_mount_LDADD =
 +
 +test_utils_vl_lookup_SOURCES = tests/test_utils_vl_lookup.c \
                                 utils_vl_lookup.h utils_vl_lookup.c \
                                 utils_avltree.c utils_avltree.h \
 -                               common.h
 -
 -utils_vl_lookup_test_CPPFLAGS =  $(AM_CPPFLAGS) $(LTDLINCL) -DBUILD_TEST=1
 -utils_vl_lookup_test_CFLAGS = $(AM_CFLAGS)
 -utils_vl_lookup_test_LDFLAGS = -export-dynamic
 -utils_vl_lookup_test_LDADD =
 -endif
 +                               common.c common.h \
 +                               tests/mock/plugin.c \
 +                               tests/mock/utils_cache.c \
 +                               tests/mock/utils_time.c
 +test_utils_vl_lookup_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
 +test_utils_vl_lookup_LDFLAGS = -export-dynamic
 +test_utils_vl_lookup_LDADD =
 +
 +TESTS = test_common test_utils_avltree test_utils_heap test_utils_mount test_utils_vl_lookup