Merge remote-tracking branch 'origin/pr/1346'
authorMarc Fournier <marc.fournier@camptocamp.com>
Tue, 9 Aug 2016 11:14:04 +0000 (13:14 +0200)
committerMarc Fournier <marc.fournier@camptocamp.com>
Tue, 9 Aug 2016 11:14:04 +0000 (13:14 +0200)
 Conflicts:
README
configure.ac
src/Makefile.am
src/collectd.conf.in
src/collectd.conf.pod
src/types.db

1  2 
AUTHORS
README
configure.ac
src/Makefile.am
src/collectd.conf.in
src/collectd.conf.pod
src/gps.c
src/types.db

diff --combined AUTHORS
+++ b/AUTHORS
@@@ -4,31 -4,9 +4,31 @@@ Permanent project member
  Florian "octo" Forster <octo at verplant.org>
   - Initial author.
  
 +Marc Fournier <marc.fournier at camptocamp.com>
 + - Various fixes to the varnish plugin.
 + - RPM specfile maintenance.
 + - libmnl support in the netlink plugin.
 + - linux support in the zfs_arc plugin.
 + - openldap plugin.
 + - continuous integration system.
 +
 +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.
 +
 +Ruben Kerkhof <ruben at rubenkerkhof.com>
 + - Bugfixes and enhancements in many places all around the project.
 + - Fedora and EPEL packages.
 +
  Sebastian "tokkee" Harl <sh at tokkee.org>
   - Bugfixes and enhancements in many places all around the project.
 + - grpc plugin.
   - perl plugin.
 + - postgresql plugin.
   - users plugin.
   - vserver plugin.
   - Debian package.
@@@ -97,15 -75,11 +97,15 @@@ Christophe Kalt <collectd at klb.tarani
   - The version 3 `log' mode.
   - Many Solaris related hints and fixes.
  
 +Claudius Zingerli <gitmail at zeuz.ch>
 + - chrony plugin.
 +
  Cyril Feraudet <cyril at feraudet.com>
   - ethstat plugin.
  
  Dagobert Michelsen <dam at opencsw.org>
   - zone plugin.
 + - Many Solaris related hints and fixes.
  
  Dan Berrange <berrange at redhat.com>
   - uuid plugin.
@@@ -144,9 -118,6 +144,9 @@@ Flavio Stanchina <flavio at stanchina.n
  Franck Lombardi
   - UNIX socket code for the memcached plugin.
  
 +Gergely Nagy <algernon at madhouse-project.org>
 + - Write-Riemann plugin.
 +
  Jason Pepas <cell at ices.utexas.edu>
   - nfs plugin.
  
@@@ -194,6 -165,13 +194,6 @@@ Manuel Sanmarti
     + swap
   - Various AIX-related fixes and hacks.
  
 -Marc Fournier <marc.fournier at camptocamp.com>
 - - Various fixes to the varnish plugin.
 - - RPM specfile update.
 - - libmnl support in the netlink plugin.
 - - linux support in the zfs_arc plugin.
 - - openldap plugin.
 -
  Marco Chiappero <marco at absence.it>
   - uptime plugin.
   - ip6tables support in the iptables plugin.
@@@ -219,6 -197,9 +219,9 @@@ Michał Mirosław <mirq-linux at rere.q
  Mirko Buffoni <briareos at eswat.org>
   - Port/Socket selection in the MySQL plugin.
  
+ Nicolas Jourden <nicolas.jourden at laposte.net>
+  - gps plugin.
  Niki W. Waibel <niki.waibel at newlogic.com>
   - Initial autotools fixes.
   - libltdl code.
@@@ -243,10 -224,6 +246,10 @@@ Paul Sadauskas <psadauskas at gmail.com
   - `ReportByDevice' option of the df plugin.
   - write_http plugin.
  
 +Pavel Rochnyack <pavel2000 at ngs.ru>
 + - xencpu plugin.
 + - Bugfixes and enhancements in many places all around the project.
 +
  Peter Holik <peter at holik.at>
   - cpufreq plugin.
   - multimeter plugin.
  Phoenix Kayo <kayo.k11.4 at gmail.com>
   - pinba plugin.
  
 -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.
  
diff --combined README
--- 1/README
--- 2/README
+++ b/README
@@@ -1,6 -1,6 +1,6 @@@
   collectd - System information collection daemon
  =================================================
 -http://collectd.org/
 +https://collectd.org/
  
  About
  -----
@@@ -51,9 -51,6 +51,9 @@@ Feature
      - cgroups
        CPU accounting information for process groups under Linux.
  
 +    - chrony
 +      Chrony daemon statistics: Local clock drift, offset to peers, etc.
 +
      - conntrack
        Number of nf_conntrack entries.
  
@@@ -67,9 -64,6 +67,9 @@@
      - cpufreq
        CPU frequency (For laptops with speed step or a similar technology)
  
 +    - cpusleep
 +      CPU sleep: Time spent in suspend (For mobile devices which enter suspend automatically)
 +
      - curl
        Parse statistics from websites using regular expressions.
  
      - gmond
        Receive multicast traffic from Ganglia instances.
  
+     - gps
+       Monitor gps related data through gpsd.
 +    - grpc
 +      Receive values over the network using the gRPC framework.
 +
      - hddtemp
        Hard disk temperatures using hddtempd.
  
      - wireless
        Link quality of wireless cards. Linux only.
  
 +    - xencpu
 +      XEN Hypervisor CPU stats.
 +
      - xmms
        Bitrate and frequency of music played with XMMS.
  
        Send an E-mail with the notification message to the configured
        recipients.
  
 +    - notify_nagios
 +      Submit notifications as passive check results to a local nagios instance.
 +
      - exec
        Execute a program or script to handle the notification.
        See collectd-exec(5).
@@@ -691,15 -679,14 +694,19 @@@ Prerequisite
      Used by the `gmond' plugin to process data received from Ganglia.
      <http://ganglia.info/>
  
 +  * libgrpc (optional)
 +    Used by the `grpc' plugin. gRPC requires a C++ compiler supporting the
 +    C++11 standard.
 +    <https://grpc.io/>
 +
    * libgcrypt (optional)
      Used by the `network' plugin for encryption and authentication.
      <http://www.gnupg.org/>
  
+   * libgps (optional)
+     Used by the `gps' plugin.
+     <http://developer.berlios.de/projects/gpsd/>
    * libhal (optional)
      If present, the `uuid' plugin will check for UUID from HAL.
      <http://hal.freedesktop.org/>
      The PostgreSQL C client library used by the `postgresql' plugin.
      <http://www.postgresql.org/>
  
 +  * libprotobuf, protoc 3.0+ (optional)
 +    Used by the `grpc' plugin to generate service stubs and code to handle
 +    network packets of collectd's protobuf-based network protocol.
 +    <https://developers.google.com/protocol-buffers/>
 +
    * libprotobuf-c, protoc-c (optional)
      Used by the `pinba' plugin to generate a parser for the network packets
 -    sent by the Pinba PHP extension, and by the `write_riemann' plugin to
 -    generate events to be sent to a Riemann server.
 +    sent by the Pinba PHP extension.
      <http://code.google.com/p/protobuf-c/>
  
    * libpython (optional)
      `virt' plugins.
      <http://xmlsoft.org/>
  
 +  * libxen (optional)
 +    Used by the `xencpu' plugin.
 +    <http://xenbits.xensource.com/>
 +
    * libxmms (optional)
      <http://www.xmms.org/>
  
       `varnish' plugin.
       <http://varnish-cache.org>
  
 +  * riemann-c-client (optional)
 +     For the `write_riemann' plugin.
 +     <https://github.com/algernon/riemann-c-client>
 +
  Configuring / Compiling / Installing
  ------------------------------------
  
@@@ -928,19 -903,18 +935,19 @@@ Configuring with libjv
    library checks succeed.
  
    If this doesn't work for you, you have the possibility to specify CPP-flags,
 -  C-flags and LD-flags for the ‘Java’ plugin by hand, using the following three
 -  (environment) variables:
 +  C-flags, LD-flags and LIBS for the ‘Java’ plugin by hand, using the
 +  following environment variables:
  
      - JAVA_CPPFLAGS
      - JAVA_CFLAGS
      - JAVA_LDFLAGS
 +    - JAVA_LIBS
  
    For example (shortened for demonstration purposes):
  
      ./configure JAVA_CPPFLAGS="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
  
 -  Adding "-ljvm" to the JAVA_LDFLAGS is done automatically, you don't have to
 +  Adding "-ljvm" to JAVA_LIBS is done automatically, you don't have to
    do that.
  
  Generating the configure script
@@@ -957,7 -931,6 +964,7 @@@ To generate the `configure` script, you
  - bison
  - libtool
  - libtool-ltdl
 +- pkg-config
  
  The `build.sh' script takes no arguments.
  
diff --combined configure.ac
@@@ -1,7 -1,6 +1,7 @@@
  dnl Process this file with autoconf to produce a configure script.
 +AC_PREREQ([2.60])
  AC_INIT([collectd],[m4_esyscmd(./version-gen.sh)])
 -AC_CONFIG_SRCDIR(src/)
 +AC_CONFIG_SRCDIR(src/target_set.c)
  AC_CONFIG_HEADERS(src/config.h)
  AC_CONFIG_AUX_DIR([libltdl/config])
  
@@@ -32,7 -31,7 +32,7 @@@ m4_ifdef([LT_PACKAGE_VERSION]
  
  AM_CONDITIONAL([BUILD_INCLUDED_LTDL], [test "x$LTDLDEPS" != "x"])
  
 -AM_INIT_AUTOMAKE([tar-pax dist-bzip2 foreign])
 +AM_INIT_AUTOMAKE([subdir-objects tar-pax dist-bzip2 no-dist-gzip foreign])
  m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  AC_LANG(C)
  
@@@ -43,12 -42,8 +43,12 @@@ AC_SYS_LARGEFIL
  #
  # Checks for programs.
  #
 -AC_PROG_CC
 +AC_PROG_CC_C99([],
 +  [AC_MSG_ERROR([No compiler found that supports C99])]
 +)
 +AC_PROG_CXX
  AC_PROG_CPP
 +AC_PROG_EGREP
  AC_PROG_INSTALL
  AC_PROG_LN_S
  AC_PROG_MAKE_SET
@@@ -59,53 -54,17 +59,53 @@@ AC_DISABLE_STATI
  AC_PROG_LIBTOOL
  AC_PROG_LEX
  AC_PROG_YACC
 +
 +AC_PATH_PROG([VALGRIND], [valgrind])
 +
 +# Warn when pkg.m4 is missing
 +m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
 +
  PKG_PROG_PKG_CONFIG
  
 -AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
 -AC_CHECK_HEADERS([google/protobuf-c/protobuf-c.h],
 -                 [have_protobuf_c_h="yes"],
 -                 [have_protobuf_c_h="no"])
 -if test "x$have_protoc_c" = "xyes" && test "x$have_protobuf_c_h" != "xyes"
 +AC_CACHE_CHECK([if bison is the parser generator],
 +      [collectd_cv_prog_bison],
 +      [AS_IF([$YACC --version 2>/dev/null | $EGREP -q '^bison '],
 +              [collectd_cv_prog_bison=yes], [collectd_cv_prog_bison=no]
 +      )]
 +)
 +
 +if test "x$collectd_cv_prog_bison" = "xno" && test ! -f "${srcdir}/src/liboconfig/parser.c"
  then
 -      have_protoc_c="no (unable to find <google/protobuf-c/protobuf-c.h>)"
 +      AC_MSG_ERROR([bison is missing and you do not have ${srcdir}/src/liboconfig/parser.c. Please install bison])
 +fi
 +
 +AC_ARG_VAR([PROTOC], [path to the protoc binary])
 +AC_PATH_PROG([PROTOC], [protoc])
 +have_protoc3="no"
 +if test "x$PROTOC" != "x"; then
 +      AC_MSG_CHECKING([for protoc 3.0.0+])
 +      if $PROTOC --version | $EGREP libprotoc.3 >/dev/null; then
 +              protoc3="yes (`$PROTOC --version`)"
 +              have_protoc3="yes"
 +      else
 +              protoc3="no (`$PROTOC --version`)"
 +      fi
 +      AC_MSG_RESULT([$protoc3])
 +fi
 +AM_CONDITIONAL(HAVE_PROTOC3, test "x$have_protoc3" = "xyes")
 +
 +AC_ARG_VAR([GRPC_CPP_PLUGIN], [path to the grpc_cpp_plugin binary])
 +AC_PATH_PROG([GRPC_CPP_PLUGIN], [grpc_cpp_plugin])
 +AM_CONDITIONAL(HAVE_GRPC_CPP, test "x$GRPC_CPP_PLUGIN" != "x")
 +
 +AC_ARG_VAR([PROTOC_C], [path to the protoc-c binary])
 +AC_PATH_PROG([PROTOC_C], [protoc-c])
 +if test "x$PROTOC_C" = "x"
 +then
 +  have_protoc_c="no (protoc-c compiler not found)"
 +else
 +  have_protoc_c="yes"
  fi
 -AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
  
  AC_MSG_CHECKING([for kernel type ($host_os)])
  case $host_os in
        AC_DEFINE([KERNEL_OPENBSD], 1, [True if program is to be compiled for an OpenBSD kernel])
        ac_system="OpenBSD"
        ;;
 +      *netbsd*)
 +      AC_DEFINE([KERNEL_NETBSD], 1, [True if program is to be compiled for a NetBSD kernel])
 +      ac_system="NetBSD"
 +      ;;
        *aix*)
        AC_DEFINE([KERNEL_AIX], 1, [True if program is to be compiled for a AIX kernel])
        ac_system="AIX"
  esac
  AC_MSG_RESULT([$ac_system])
  
 -AM_CONDITIONAL([BUILD_LINUX],[test "x$ac_system" = "xLinux"])
 -AM_CONDITIONAL([BUILD_SOLARIS],[test "x$ac_system" = "xSolaris"])
 -AM_CONDITIONAL([BUILD_DARWIN],[test "x$ac_system" = "xDarwin"])
 -AM_CONDITIONAL([BUILD_OPENBSD],[test "x$ac_system" = "xOpenBSD"])
 -AM_CONDITIONAL([BUILD_AIX],[test "x$ac_system" = "xAIX"])
 -AM_CONDITIONAL([BUILD_FREEBSD],[test "x$ac_system" = "xFreeBSD"])
 +AM_CONDITIONAL([BUILD_AIX], [test "x$ac_system" = "xAIX"])
 +AM_CONDITIONAL([BUILD_DARWIN], [test "x$ac_system" = "xDarwin"])
 +AM_CONDITIONAL([BUILD_FREEBSD], [test "x$ac_system" = "xFreeBSD"])
 +AM_CONDITIONAL([BUILD_LINUX], [test "x$ac_system" = "xLinux"])
 +AM_CONDITIONAL([BUILD_OPENBSD], [test "x$ac_system" = "xOpenBSD"])
 +AM_CONDITIONAL([BUILD_SOLARIS], [test "x$ac_system" = "xSolaris"])
  
  if test "x$ac_system" = "xLinux"
  then
@@@ -216,19 -171,6 +216,19 @@@ AC_HEADER_STDBOO
  
  AC_CHECK_HEADERS(stdio.h errno.h math.h stdarg.h syslog.h fcntl.h signal.h assert.h sys/types.h sys/socket.h sys/select.h poll.h netdb.h arpa/inet.h sys/resource.h sys/param.h kstat.h regex.h sys/ioctl.h endian.h sys/isa_defs.h fnmatch.h libgen.h)
  
 +# For entropy plugin on newer NetBSD
 +AC_CHECK_HEADERS(sys/rndio.h, [], [],
 +[#if HAVE_SYS_TYPES_H
 +# include <sys/types.h>
 +#endif
 +#if HAVE_SYS_IOCTL_H
 +# include <sys/ioctl.h>
 +#endif
 +#if HAVE_SYS_PARAM_H
 +# include <sys/param.h>
 +#endif
 +])
 +
  # For ping library
  AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
  [#if HAVE_STDINT_H
@@@ -443,7 -385,7 +443,7 @@@ AC_CHECK_HEADERS(sys/sysctl.h, [], []
  AC_MSG_CHECKING([for sysctl kern.cp_times])
  if test -x /sbin/sysctl
  then
 -      /sbin/sysctl kern.cp_times 2>/dev/null
 +      /sbin/sysctl kern.cp_times >/dev/null 2>&1
        if test $? -eq 0
        then
                AC_MSG_RESULT([yes])
@@@ -456,22 -398,6 +456,22 @@@ els
        AC_MSG_RESULT([no])
  fi
  
 +AC_MSG_CHECKING([for sysctl kern.cp_time])
 +if test -x /sbin/sysctl
 +then
 +      /sbin/sysctl kern.cp_time >/dev/null 2>&1
 +      if test $? -eq 0
 +      then
 +              AC_MSG_RESULT([yes])
 +              AC_DEFINE(HAVE_SYSCTL_KERN_CP_TIME, 1,
 +                      [Define if sysctl supports kern.cp_time])
 +      else
 +              AC_MSG_RESULT([no])
 +      fi
 +else
 +      AC_MSG_RESULT([no])
 +fi
 +
  # For hddtemp module
  AC_CHECK_HEADERS(linux/major.h)
  
@@@ -490,7 -416,7 +490,7 @@@ els
        have_linux_raid_md_u_h="no"
  fi
  
 -# For the swap module
 +# For the wireless module
  have_linux_wireless_h="no"
  if test "x$ac_system" = "xLinux"
  then
@@@ -657,35 -583,7 +657,35 @@@ AC_CHECK_HEADERS(linux/un.h, [], []
  #endif
  ])
  
 -AC_CHECK_HEADERS(pwd.h grp.h sys/un.h ctype.h limits.h xfs/xqm.h fs_info.h fshelp.h paths.h mntent.h mnttab.h sys/fstyp.h sys/fs_types.h sys/mntent.h sys/mnttab.h sys/statfs.h sys/statvfs.h sys/vfs.h sys/vfstab.h sys/vmmeter.h kvm.h wordexp.h locale.h)
 +AC_CHECK_HEADERS([ \
 +  ctype.h \
 +  fs_info.h \
 +  fshelp.h \
 +  grp.h \
 +  kvm.h \
 +  limits.h \
 +  locale.h \
 +  mntent.h \
 +  mnttab.h \
 +  paths.h \
 +  pwd.h \
 +  sys/fs_types.h \
 +  sys/fstyp.h \
 +  sys/mntent.h \
 +  sys/mnttab.h \
 +  sys/statfs.h \
 +  sys/statvfs.h \
 +  sys/un.h \
 +  sys/vfs.h \
 +  sys/vfstab.h \
 +  sys/vmmeter.h \
 +  wordexp.h \
 +])
 +
 +AC_CHECK_HEADERS([xfs/xqm.h], [], [],
 +[
 +#define _GNU_SOURCE
 +])
  
  # For the dns plugin
  AC_CHECK_HEADERS(arpa/nameser.h)
@@@ -725,6 -623,8 +725,6 @@@ AC_CHECK_HEADERS(netinet/if_ether.h, []
  #endif
  ])
  
 -AC_CHECK_HEADERS(netinet/ip_compat.h)
 -
  have_net_pfvar_h="no"
  AC_CHECK_HEADERS(net/pfvar.h,
                 [have_net_pfvar_h="yes"],
  have_termios_h="no"
  AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
  
 +# For cpusleep plugin
 +AC_CACHE_CHECK([whether clock_boottime and clock_monotonic are supported],
 +                     [c_cv_have_clock_boottime_monotonic],
 +                     AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
 +[[
 +#include <time.h>
 +]],
 +[[
 + struct timespec b, m;
 + clock_gettime(CLOCK_BOOTTIME, &b );
 + clock_gettime(CLOCK_MONOTONIC, &m );
 +]]
 +                     )],
 +                     [c_cv_have_clock_boottime_monotonic="yes"],
 +                     [c_cv_have_clock_boottime_monotonic="no"]))
 +
 +
  # For the turbostat plugin
  have_asm_msrindex_h="no"
  AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"])
@@@ -796,30 -679,23 +796,30 @@@ AC_CHECK_HEADERS(sys/capability.h
  # Checks for typedefs, structures, and compiler characteristics.
  #
  AC_C_CONST
 -AC_C_INLINE
 -AC_TYPE_OFF_T
  AC_TYPE_PID_T
  AC_TYPE_SIZE_T
 -AC_TYPE_SSIZE_T
  AC_TYPE_UID_T
 -AC_TYPE_UINT32_T
  AC_HEADER_TIME
  
  #
  # Checks for library functions.
  #
 -AC_PROG_GCC_TRADITIONAL
 -AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname setlocale)
 +AC_CHECK_FUNCS(gettimeofday select strdup strtol getaddrinfo getnameinfo strchr memcpy strstr strcmp strncmp strncpy strlen strncasecmp strcasecmp openlog closelog sysconf setenv if_indextoname setlocale asprintf)
  
  AC_FUNC_STRERROR_R
  
 +test_cxx_flags() {
 +      AC_LANG_PUSH([C++])
 +      AC_LANG_CONFTEST([
 +              AC_LANG_SOURCE([[int main(void){}]])
 +      ])
 +      $CXX -c conftest.cpp $CXXFLAGS $@ > /dev/null 2> /dev/null
 +      ret=$?
 +      rm -f conftest.o
 +      AC_LANG_POP([C++])
 +      return $ret
 +}
 +
  SAVE_CFLAGS="$CFLAGS"
  # Emulate behavior of src/Makefile.am
  if test "x$GCC" = "xyes"
@@@ -919,6 -795,8 +919,6 @@@ f
  if test "x$have_clock_gettime" = "xyes"
  then
        AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if the clock_gettime(2) function is available.])
 -else
 -      AC_MSG_WARN(cannot find clock_gettime)
  fi
  
  nanosleep_needs_rt="no"
@@@ -1370,28 -1248,12 +1370,28 @@@ AC_ARG_WITH(useragent, [AS_HELP_STRING(
  
  # }}}
  
 +# --with-data-max-name-len {{{
 +AC_ARG_WITH(data-max-name-len, [AS_HELP_STRING([--with-data-max-name-len@<:@=VALUE@:>@], [Maximum length of data buffers])],
 +[
 +    if test "x$withval" != "x" && test $withval -gt 0
 +    then
 +        AC_DEFINE_UNQUOTED(DATA_MAX_NAME_LEN, [$withval], [Maximum length of data buffers])
 +    else
 +        AC_MSG_ERROR([DATA_MAX_NAME_LEN must be a positive integer -- $withval given])
 +    fi
 +],
 +[   AC_DEFINE(DATA_MAX_NAME_LEN, 128, [Maximum length of data buffers])]
 +)
 +# }}}
 +
  have_getfsstat="no"
  AC_CHECK_FUNCS(getfsstat, [have_getfsstat="yes"])
  have_getvfsstat="no"
  AC_CHECK_FUNCS(getvfsstat, [have_getvfsstat="yes"])
  have_listmntent="no"
  AC_CHECK_FUNCS(listmntent, [have_listmntent="yes"])
 +have_getmntent_r="no"
 +AC_CHECK_FUNCS(getmntent_r, [have_getmntent_r="yes"])
  
  have_getmntent="no"
  AC_CHECK_FUNCS(getmntent, [have_getmntent="c"])
@@@ -1461,15 -1323,15 +1461,15 @@@ if test "x$have_getmntent" = "xc"; the
  fi
  if test "x$have_getmntent" = "xsun"; then
        AC_DEFINE(HAVE_SUN_GETMNTENT, 1,
 -                [Define if the function getmntent exists. It's the version from libsun.])
 +                [Define if the function getmntent exists. It is the version from libsun.])
  fi
  if test "x$have_getmntent" = "xseq"; then
        AC_DEFINE(HAVE_SEQ_GETMNTENT, 1,
 -                [Define if the function getmntent exists. It's the version from libseq.])
 +                [Define if the function getmntent exists. It is the version from libseq.])
  fi
  if test "x$have_getmntent" = "xgen"; then
        AC_DEFINE(HAVE_GEN_GETMNTENT, 1,
 -                [Define if the function getmntent exists. It's the version from libgen.])
 +                [Define if the function getmntent exists. It is the version from libgen.])
  fi
  
  # Check for htonll
@@@ -1560,24 -1422,6 +1560,24 @@@ AC_CHECK_MEMBERS([struct kinfo_proc.p_p
  #include <kvm.h>
        ])
  
 +
 +AC_CHECK_MEMBERS([struct kinfo_proc2.p_pid, struct kinfo_proc2.p_uru_maxrss],
 +      [
 +              AC_DEFINE(HAVE_STRUCT_KINFO_PROC2_NETBSD, 1,
 +                      [Define if struct kinfo_proc2 exists in the NetBSD variant.])
 +              have_struct_kinfo_proc2_netbsd="yes"
 +      ],
 +      [
 +              have_struct_kinfo_proc2_netbsd="no"
 +      ],
 +      [
 +#include <sys/param.h>
 +#include <sys/sysctl.h>
 +#include <kvm.h>
 +      ])
 +
 +
 +
  AC_CHECK_MEMBERS([struct udphdr.uh_dport, struct udphdr.uh_sport], [], [],
  [#define _BSD_SOURCE
  #define _DEFAULT_SOURCE
@@@ -1645,48 -1489,18 +1645,48 @@@ AC_CHECK_LIB(resolv, res_search
  AM_CONDITIONAL(BUILD_WITH_LIBRESOLV, test "x$with_libresolv" = "xyes")
  
  dnl Check for HAL (hardware abstraction library)
 -with_libhal="yes"
 -AC_CHECK_LIB(hal,libhal_device_property_exists,
 -           [AC_DEFINE(HAVE_LIBHAL, 1, [Define to 1 if you have 'hal' library])],
 -           [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`"
 -              AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
 -              AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
 -      fi
 -fi
 +with_libhal="no"
 +PKG_CHECK_MODULES([HAL], [hal],
 +  [
 +    SAVE_LIBS="$LIBS"
 +    LIBS="$HAL_LIBS $LIBS"
 +    AC_CHECK_LIB([hal], [libhal_device_property_exists],
 +      [
 +        SAVE_CPPFLAGS="$CPPFLAGS"
 +        CPPFLAGS="$HAL_CFLAGS $CPPFLAGS"
 +        AC_CHECK_HEADERS([libhal.h],
 +        [
 +          with_libhal="yes"
 +          BUILD_WITH_LIBHAL_CFLAGS="$HAL_CFLAGS"
 +          BUILD_WITH_LIBHAL_LIBS="$HAL_LIBS"
 +        ])
 +        CPPFLAGS="$SAVE_CPPFLAGS"
 +      ],
 +      [ : ]
 +    )
 +    LIBS="$SAVE_LIBS"
 +  ],
 +  [ : ]
 +)
 +AC_SUBST(BUILD_WITH_LIBHAL_CFLAGS)
 +AC_SUBST(BUILD_WITH_LIBHAL_LIBS)
 +
 +
 +SAVE_LIBS="$LIBS"
 +AC_CHECK_LIB([pthread],
 +  [pthread_create],
 +  [],
 +  [AC_MSG_ERROR([Symbol 'pthread_create' not found in libpthread"])],
 +  []
 +)
 +PTHREAD_LIBS="$LIBS"
 +LIBS="$SAVE_LIBS"
 +
 +AC_CHECK_HEADERS([pthread.h],
 +  [],
 +  [AC_MSG_ERROR([pthread.h not found])]
 +)
 +AC_SUBST([PTHREAD_LIBS])
  
  m4_divert_once([HELP_WITH], [
  collectd additional packages:])
  fi
  if test "x$with_libcurl" = "xyes"
  then
 +      SAVE_CPPFLAGS="$CPPFLAGS"
 +      SAVE_LDFLAGS="$LDFLAGS"
 +      CPPFLAGS="$CPPFLAGS $with_curl_cflags"
 +      LDFLAGS="$LDFLAGS $with_curl_libs"
 +      AC_CACHE_CHECK([for CURLINFO_APPCONNECT_TIME],
 +              [c_cv_have_curlinfo_appconnect_time],
 +              AC_LINK_IFELSE([AC_LANG_PROGRAM(
 +[[
 +#include <curl/curl.h>
 +]],
 +[[
 +int val = CURLINFO_APPCONNECT_TIME;
 +return val;
 +]]
 +                      )],
 +                      [c_cv_have_curlinfo_appconnect_time="yes"],
 +                      [c_cv_have_curlinfo_appconnect_time="no"]
 +              )
 +      )
 +      CPPFLAGS="$SAVE_CPPFLAGS"
 +      LDFLAGS="$SAVE_LDFLAGS"
 +fi
 +AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
 +if test "x$c_cv_have_curlinfo_appconnect_time" = "xyes"
 +then
 +      AC_DEFINE(HAVE_CURLINFO_APPCONNECT_TIME, 1, [Define if curl.h defines CURLINFO_APPCONNECT_TIME.])
 +fi
 +
 +if test "x$with_libcurl" = "xyes"
 +then
        BUILD_WITH_LIBCURL_CFLAGS="$with_curl_cflags"
        BUILD_WITH_LIBCURL_LIBS="$with_curl_libs"
        AC_SUBST(BUILD_WITH_LIBCURL_CFLAGS)
                AC_DEFINE(HAVE_CURLOPT_TIMEOUT_MS, 1, [Define if libcurl supports CURLOPT_TIMEOUT_MS option.])
        fi
  fi
 -AM_CONDITIONAL(BUILD_WITH_LIBCURL, test "x$with_libcurl" = "xyes")
  # }}}
  
  # --with-libdbi {{{
@@@ -2238,6 -2023,12 +2238,6 @@@ the
                GCRYPT_CPPFLAGS=`"$with_libgcrypt_config" --cflags 2>/dev/null`
        fi
  
 -      if test "x$GCRYPT_LDFLAGS" = "x"
 -      then
 -              gcrypt_exec_prefix=`"$with_libgcrypt_config" --exec-prefix 2>/dev/null`
 -              GCRYPT_LDFLAGS="-L$gcrypt_exec_prefix/lib"
 -      fi
 -
        if test "x$GCRYPT_LIBS" = "x"
        then
                GCRYPT_LIBS=`"$with_libgcrypt_config" --libs 2>/dev/null`
  
  SAVE_CPPFLAGS="$CPPFLAGS"
  SAVE_LDFLAGS="$LDFLAGS"
 +SAVE_LIBS="$LIBS"
  CPPFLAGS="$CPPFLAGS $GCRYPT_CPPFLAGS"
  LDFLAGS="$LDFLAGS $GCRYPT_LDFLAGS"
 +LIBS="$LIBS $GCRYPT_LIBS"
  
  if test "x$with_libgcrypt" = "xyes"
  then
  
  if test "x$with_libgcrypt" = "xyes"
  then
 -      if test "x$GCRYPT_LDFLAGS" != "x"
 -      then
 -              AC_MSG_NOTICE([gcrypt LDFLAGS: $GCRYPT_LDFLAGS])
 -      fi
        AC_CHECK_LIB(gcrypt, gcry_md_hash_buffer,
                [with_libgcrypt="yes"],
                [with_libgcrypt="no (symbol gcry_md_hash_buffer not found)"])
 -
 -      if test "$with_libgcrypt" != "no"; then
 -              m4_ifdef([AM_PATH_LIBGCRYPT],[AM_PATH_LIBGCRYPT(1:1.2.0,,with_libgcrypt="no (version 1.2.0+ required)")])
 -              GCRYPT_CPPFLAGS="$LIBGCRYPT_CPPFLAGS $LIBGCRYPT_CFLAGS"
 -              GCRYPT_LIBS="$LIBGCRYPT_LIBS"
 -      fi
  fi
  
  CPPFLAGS="$SAVE_CPPFLAGS"
  LDFLAGS="$SAVE_LDFLAGS"
 +LIBS="$SAVE_LIBS"
  
  if test "x$with_libgcrypt" = "xyes"
  then
@@@ -2284,92 -2082,58 +2284,142 @@@ AC_SUBST(GCRYPT_LIBS
  AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, test "x$with_libgcrypt" = "xyes")
  # }}}
  
 -
 -###
+ # --with-libgps {{{
+ with_libgps_cflags=""
+ with_libgps_ldflags=""
+ AC_ARG_WITH(libgps, [AS_HELP_STRING([--with-libgps@<:@=PREFIX@:>@], [Path to libgps.])],
+ [
+       if test "x$withval" != "xno" && test "x$withval" != "xyes"
+       then
+               with_libgps_cflags="-I$withval/include"
+               with_libgps_ldflags="-L$withval/lib"
+               with_libgps="yes"
+       else
+               with_libgps="$withval"
+       fi
+ ],
+ [
+       with_libgps="yes"
+ ])
+ if test "x$with_libgps" = "xyes"
+ then
+       SAVE_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS $with_libgps_cflags"
+       AC_CHECK_HEADERS(gps.h, [with_libgps="yes"], [with_libgps="no (gps.h not found)"])
+       CFLAGS="$SAVE_CFLAGS"
+ fi
+ if test "x$with_libgps" = "xyes"
+ then
+       SAVE_CFLAGS="$CFLAGS"
+       SAVE_LDFLAGS="$LDFLAGS"
+       CFLAGS="$CFLAGS $with_libgps_cflags"
+       LDFLAGS="$LDFLAGS $with_libgps_ldflags"
+       AC_CHECK_LIB(gps, gps_open, [with_libgps="yes"], [with_libgps="no (symbol gps_open not found)"])
+       CFLAGS="$SAVE_CFLAGS"
+       LDFLAGS="$SAVE_LDFLAGS"
+ fi
+ if test "x$with_libgps" = "xyes"
+ then
+       BUILD_WITH_LIBGPS_CFLAGS="$with_libgps_cflags"
+       BUILD_WITH_LIBGPS_LDFLAGS="$with_libgps_ldflags"
+       BUILD_WITH_LIBGPS_LIBS="-lgps"
+       AC_SUBST(BUILD_WITH_LIBGPS_CFLAGS)
+       AC_SUBST(BUILD_WITH_LIBGPS_LDFLAGS)
+       AC_SUBST(BUILD_WITH_LIBGPS_LIBS)
+ fi
+ AM_CONDITIONAL(BUILD_WITH_LIBGPS, test "x$with_libgps" = "xyes")
+ # }}}
 +# --with-libgrpc++ {{{
 +with_libgrpcpp_cppflags=""
 +with_libgrpcpp_ldflags=""
 +AC_ARG_WITH([libgrpc++], [AS_HELP_STRING([--with-libgrpc++@<:@=PREFIX@:>@], [Path to libgrpc++.])],
 +  [
 +    with_grpcpp="$withval"
 +    if test "x$withval" != "xno" && test "x$withval" != "xyes"
 +    then
 +      with_libgrpcpp_cppflags="-I$withval/include"
 +      with_libgrpcpp_ldflags="-L$withval/lib"
 +      with_libgrpcpp="yes"
 +    fi
 +    if test "x$withval" = "xno"
 +    then
 +      with_libgrpcpp="no (disabled on command line)"
 +    fi
 +  ],
 +  [withval="yes"]
 +)
 +if test "x$withval" = "xyes"
 +then
 +PKG_CHECK_MODULES([GRPCPP], [grpc++],
 +  [with_libgrpcpp="yes"],
 +  [with_libgrpcpp="no (pkg-config could not find libgrpc++)"]
 +)
 +fi
 +
 +if test "x$withval" != "xno"
 +then
 +  AC_MSG_CHECKING([whether $CXX accepts -std=c++11])
 +  if test_cxx_flags -std=c++11; then
 +    AC_MSG_RESULT([yes])
 +  else
 +    AC_MSG_RESULT([no])
 +    with_libgrpcpp="no (requires C++11 support)"
 +  fi
 +fi
 +
 +if test "x$with_libgrpcpp" = "xyes"
 +then
 +  AC_LANG_PUSH(C++)
 +  SAVE_CPPFLAGS="$CPPFLAGS"
 +  CPPFLAGS="$with_libgrpcpp_cppflags $GRPCPP_CFLAGS $CPPFLAGS -std=c++11"
 +  AC_CHECK_HEADERS([grpc++/grpc++.h], [],
 +    [with_libgrpcpp="no (<grpc++/grpc++.h> not found)"]
 +  )
 +  CPPFLAGS="$SAVE_CPPFLAGS"
 +  AC_LANG_POP(C++)
 +fi
 +if test "x$with_libgrpcpp" = "xyes"
 +then
 +  AC_LANG_PUSH(C++)
 +  SAVE_LDFLAGS="$LDFLAGS"
 +  SAVE_LIBS="$LIBS"
 +  LDFLAGS="$with_libgrpcpp_ldflags"
 +  if test "x$GRPCPP_LIBS" = "x"
 +  then
 +    LIBS="-lgrpc++"
 +  else
 +    LIBS="$GRPCPP_LIBS"
 +  fi
 +  AC_LINK_IFELSE(
 +    [AC_LANG_PROGRAM(
 +      [[#include <grpc++/grpc++.h>]],
 +      [[grpc::ServerBuilder sb;]]
 +    )],
 +    [
 +      with_libgrpcpp="yes"
 +      if test "x$GRPCPP_LIBS" = "x"
 +      then
 +        GRPCPP_LIBS="-lgrpc++"
 +      fi
 +    ],
 +    [with_libgrpcpp="no (libgrpc++ not found)"]
 +  )
 +  LDFLAGS="$SAVE_LDFLAGS"
 +  LIBS="$SAVE_LIBS"
 +  AC_LANG_POP(C++)
 +fi
 +BUILD_WITH_LIBGRPCPP_CPPFLAGS="-std=c++11 $with_libgrpcpp_cppflags $GRPCPP_CFLAGS"
 +BUILD_WITH_LIBGRPCPP_LDFLAGS="$with_libgrpcpp_ldflags"
 +BUILD_WITH_LIBGRPCPP_LIBS="$GRPCPP_LIBS"
 +AC_SUBST([BUILD_WITH_LIBGRPCPP_CPPFLAGS])
 +AC_SUBST([BUILD_WITH_LIBGRPCPP_LDFLAGS])
 +AC_SUBST([BUILD_WITH_LIBGRPCPP_LIBS])
 +# }}}
  
  # --with-libiptc {{{
  AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
        fi
  ])
  
 -if test "x$with_libiptc" = "xpkgconfig" && test "x$PKG_CONFIG" = "x"
 -then
 -      with_libiptc="no (Don't have pkg-config)"
 -fi
 -
  if test "x$with_libiptc" = "xpkgconfig"
  then
        $PKG_CONFIG --exists 'libiptc' 2>/dev/null
@@@ -2467,6 -2236,9 +2517,6 @@@ if test "x$with_java_home" = "x
  then
        with_java_home="/usr/lib/jvm"
  fi
 -with_java_vmtype="client"
 -with_java_cflags=""
 -with_java_libs=""
  JAVAC="$JAVAC"
  JAR="$JAR"
  AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
@@@ -2508,7 -2280,7 +2558,7 @@@ the
                fi
  
                AC_MSG_CHECKING([for libjvm.so])
 -              TMPVAR=`find -L "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
 +              TMPVAR=`find -L "$with_java_home" -type f \( -name libjvm.so -o -name libjvm.dylib \) -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
                if test "x$TMPVAR" != "x"
                then
                        AC_MSG_RESULT([found in $TMPVAR])
@@@ -2559,10 -2331,6 +2609,10 @@@ if test "x$JAVA_LDFLAGS" != "x
  then
        AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
  fi
 +if test "x$JAVA_LIBS" != "x"
 +then
 +      AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
 +fi
  if test "x$JAVAC" = "x"
  then
        with_javac_path="$PATH"
  SAVE_CPPFLAGS="$CPPFLAGS"
  SAVE_CFLAGS="$CFLAGS"
  SAVE_LDFLAGS="$LDFLAGS"
 +SAVE_LIBS="$LIBS"
  CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
  CFLAGS="$CFLAGS $JAVA_CFLAGS"
  LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
 +LIBS="$LIBS $JAVA_LIBS"
  
  if test "x$with_java" = "xyes"
  then
@@@ -2617,8 -2383,8 +2667,8 @@@ if test "x$with_java" = "xyes
  then
        AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
        [with_java="yes"],
 -      [with_java="no (libjvm not found)"],
 -      [$JAVA_LIBS])
 +      [with_java="no (Symbol 'JNI_CreateJavaVM' not found)"],
 +      [$JAVA_LIBS $PTHREAD_LIBS])
  fi
  if test "x$with_java" = "xyes"
  then
  CPPFLAGS="$SAVE_CPPFLAGS"
  CFLAGS="$SAVE_CFLAGS"
  LDFLAGS="$SAVE_LDFLAGS"
 +LIBS="$SAVE_LIBS"
  
  AC_SUBST(JAVA_CPPFLAGS)
  AC_SUBST(JAVA_CFLAGS)
@@@ -2701,25 -2466,17 +2751,25 @@@ with_liblvm2app_cppflags="
  with_liblvm2app_ldflags=""
  AC_ARG_WITH(liblvm2app, [AS_HELP_STRING([--with-liblvm2app@<:@=PREFIX@:>@], [Path to liblvm2app.])],
  [
 -        if test "x$withval" != "xno" && test "x$withval" != "xyes"
 -        then
 -                with_liblvm2app_cppflags="-I$withval/include"
 -                with_liblvm2app_ldflags="-L$withval/lib"
 -                with_liblvm2app="yes"
 -        else
 -                with_liblvm2app="$withval"
 +      if test "x$withval" = "xno"
 +      then
 +              with_liblvm2app="no"
 +      else
 +              with_liblvm2app="yes"
 +              if test "x$withval" != "xyes"
 +              then
 +                      with_liblvm2app_cppflags="-I$withval/include"
 +                      with_liblvm2app_ldflags="-L$withval/lib"
 +              fi
          fi
  ],
  [
 -        with_liblvm2app="yes"
 +      if test "x$ac_system" = "xLinux"
 +      then
 +              with_liblvm2app="yes"
 +      else
 +              with_liblvm2app="no (Linux only library)"
 +      fi
  ])
  if test "x$with_liblvm2app" = "xyes"
  then
@@@ -2832,6 -2589,13 +2882,6 @@@ AC_ARG_WITH(libmodbus, [AS_HELP_STRING(
  # configure using pkg-config
  if test "x$with_libmodbus" = "xuse_pkgconfig"
  then
 -      if test "x$PKG_CONFIG" = "x"
 -      then
 -              with_libmodbus="no (Don't have pkg-config)"
 -      fi
 -fi
 -if test "x$with_libmodbus" = "xuse_pkgconfig"
 -then
        AC_MSG_NOTICE([Checking for libmodbus using $PKG_CONFIG])
        $PKG_CONFIG --exists 'libmodbus' 2>/dev/null
        if test $? -ne 0
@@@ -2957,13 -2721,13 +3007,13 @@@ AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, te
  
  # --with-libmosquitto {{{
  with_libmosquitto_cppflags=""
 -with_libmosquitto_libs="-lmosquitto"
 +with_libmosquitto_ldflags=""
  AC_ARG_WITH(libmosquitto, [AS_HELP_STRING([--with-libmosquitto@<:@=PREFIX@:>@], [Path to libmosquitto.])],
  [
        if test "x$withval" != "xno" && test "x$withval" != "xyes"
        then
                with_libmosquitto_cppflags="-I$withval/include"
 -              with_libmosquitto_libs="-L$withval/lib -lmosquitto"
 +              with_libmosquitto_ldflags="-L$withval/lib"
                with_libmosquitto="yes"
        else
                with_libmosquitto="$withval"
  if test "x$with_libmosquitto" = "xyes"
  then
        SAVE_CPPFLAGS="$CPPFLAGS"
 -      CPPFLAGS="$with_libmosquitto_cppflags"
 +      CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
  
        AC_CHECK_HEADERS(mosquitto.h, [with_libmosquitto="yes"], [with_libmosquitto="no (mosquitto.h not found)"])
  
@@@ -2985,8 -2749,8 +3035,8 @@@ if test "x$with_libmosquitto" = "xyes
  then
        SAVE_LDFLAGS="$LDFLAGS"
        SAVE_CPPFLAGS="$CPPFLAGS"
 -      LDFLAGS="$with_libmosquitto_libs"
 -      CPPFLAGS="$with_libmosquitto_cppflags"
 +      LDFLAGS="$LDFLAGS $with_libmosquitto_ldflags"
 +      CPPFLAGS="$CPPFLAGS $with_libmosquitto_cppflags"
  
        AC_CHECK_LIB(mosquitto, mosquitto_connect, [with_libmosquitto="yes"], [with_libmosquitto="no (libmosquitto not found)"])
  
  if test "x$with_libmosquitto" = "xyes"
  then
        BUILD_WITH_LIBMOSQUITTO_CPPFLAGS="$with_libmosquitto_cppflags"
 -      BUILD_WITH_LIBMOSQUITTO_LIBS="$with_libmosquitto_libs"
 +      BUILD_WITH_LIBMOSQUITTO_LDFLAGS="$with_libmosquitto_ldflags"
 +      BUILD_WITH_LIBMOSQUITTO_LIBS="-lmosquitto"
        AC_SUBST(BUILD_WITH_LIBMOSQUITTO_CPPFLAGS)
 +      AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LDFLAGS)
        AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LIBS)
  fi
  # }}}
@@@ -3122,6 -2884,10 +3172,6 @@@ AC_ARG_WITH(libmnl, [AS_HELP_STRING([--
         with_libmnl="no (Linux only library)"
   fi
  ])
 -if test "x$PKG_CONFIG" = "x"
 -then
 -      with_libmnl="no (Don't have pkg-config)"
 -fi
  if test "x$with_libmnl" = "xyes"
  then
        if $PKG_CONFIG --exists libmnl 2>/dev/null; then
@@@ -3252,7 -3018,7 +3302,7 @@@ the
  
        if test "x$LIBNETAPP_LIBS" = "x"
        then
 -              LIBNETAPP_LIBS="-lpthread -lxml -ladt -lssl -lm -lcrypto -lz"
 +              LIBNETAPP_LIBS="$PTHREAD_LIBS -lxml -ladt -lssl -lm -lcrypto -lz"
        fi
        AC_MSG_NOTICE([netapp LIBS: $LIBNETAPP_LIBS])
  
  fi
  if test "x$with_oracle" = "xyes"
  then
 -      BUILD_WITH_ORACLE_CFLAGS="$with_oracle_cppflags"
 +      BUILD_WITH_ORACLE_CPPFLAGS="$with_oracle_cppflags"
        BUILD_WITH_ORACLE_LIBS="$with_oracle_libs"
 -      AC_SUBST(BUILD_WITH_ORACLE_CFLAGS)
 +      AC_SUBST(BUILD_WITH_ORACLE_CPPFLAGS)
        AC_SUBST(BUILD_WITH_ORACLE_LIBS)
  fi
  # }}}
  
  # --with-libowcapi {{{
  with_libowcapi_cppflags=""
 -with_libowcapi_libs="-lowcapi"
 +with_libowcapi_ldflags=""
  AC_ARG_WITH(libowcapi, [AS_HELP_STRING([--with-libowcapi@<:@=PREFIX@:>@], [Path to libowcapi.])],
  [
        if test "x$withval" != "xno" && test "x$withval" != "xyes"
        then
                with_libowcapi_cppflags="-I$withval/include"
 -              with_libowcapi_libs="-L$withval/lib -lowcapi"
 +              with_libowcapi_ldflags="-L$withval/lib"
                with_libowcapi="yes"
        else
                with_libowcapi="$withval"
  if test "x$with_libowcapi" = "xyes"
  then
        SAVE_CPPFLAGS="$CPPFLAGS"
 -      CPPFLAGS="$with_libowcapi_cppflags"
 +      CPPFLAGS="$CPPFLAGS $with_libowcapi_cppflags"
  
        AC_CHECK_HEADERS(owcapi.h, [with_libowcapi="yes"], [with_libowcapi="no (owcapi.h not found)"])
  
@@@ -3548,7 -3314,7 +3598,7 @@@ if test "x$with_libowcapi" = "xyes
  then
        SAVE_LDFLAGS="$LDFLAGS"
        SAVE_CPPFLAGS="$CPPFLAGS"
 -      LDFLAGS="$with_libowcapi_libs"
 +      LDFLAGS="$LDFLAGS $with_libowcapi_ldflags"
        CPPFLAGS="$with_libowcapi_cppflags"
  
        AC_CHECK_LIB(owcapi, OW_get, [with_libowcapi="yes"], [with_libowcapi="no (libowcapi not found)"])
  if test "x$with_libowcapi" = "xyes"
  then
        BUILD_WITH_LIBOWCAPI_CPPFLAGS="$with_libowcapi_cppflags"
 -      BUILD_WITH_LIBOWCAPI_LIBS="$with_libowcapi_libs"
 +      BUILD_WITH_LIBOWCAPI_LDFLAGS="$with_libowcapi_ldflags"
 +      BUILD_WITH_LIBOWCAPI_LIBS="-lowcapi"
        AC_SUBST(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
 +      AC_SUBST(BUILD_WITH_LIBOWCAPI_LDFLAGS)
        AC_SUBST(BUILD_WITH_LIBOWCAPI_LIBS)
  fi
  # }}}
@@@ -3657,7 -3421,7 +3707,7 @@@ the
    SAVE_CFLAGS="$CFLAGS"
    SAVE_LIBS="$LIBS"
  dnl ARCHFLAGS="" -> disable multi -arch on OSX (see Config_heavy.pl:fetch_string)
 -  PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ccopts`
 +  PERL_CFLAGS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e perl_inc`
    PERL_LIBS=`ARCHFLAGS="" $perl_interpreter -MExtUtils::Embed -e ldopts`
    CFLAGS="$CFLAGS $PERL_CFLAGS"
    LIBS="$LIBS $PERL_LIBS"
  AM_CONDITIONAL(BUILD_WITH_LIBPQ, test "x$with_libpq" = "xyes")
  # }}}
  
 -# --with-libpthread {{{
 -AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
 -[     if test "x$withval" != "xno" \
 -              && test "x$withval" != "xyes"
 -      then
 -              LDFLAGS="$LDFLAGS -L$withval/lib"
 -              CPPFLAGS="$CPPFLAGS -I$withval/include"
 -              with_libpthread="yes"
 -      else
 -              if test "x$withval" = "xno"
 -              then
 -                      with_libpthread="no (disabled)"
 -              fi
 -      fi
 -], [with_libpthread="yes"])
 -if test "x$with_libpthread" = "xyes"
 +# --with-libprotobuf {{{
 +with_libprotobuf_cppflags=""
 +with_libprotobuf_ldflags=""
 +AC_ARG_WITH([libprotobuf], [AS_HELP_STRING([--with-libprotobuf@<:@=PREFIX@:>@], [Path to libprotobuf.])],
 +  [
 +    if test "x$withval" != "xno" && test "x$withval" != "xyes"
 +    then
 +      with_libprotobuf_cppflags="-I$withval/include"
 +      with_libprotobuf_ldflags="-L$withval/lib"
 +      with_libprotobuf="yes"
 +    fi
 +    if test "x$withval" = "xno"
 +    then
 +      with_libprotobuf="no (disabled on command line)"
 +    fi
 +  ],
 +  [withval="yes"]
 +)
 +if test "x$withval" = "xyes"
  then
 -      AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
 +PKG_CHECK_MODULES([PROTOBUF], [protobuf],
 +  [with_libprotobuf="yes"],
 +  [with_libprotobuf="no (pkg-config could not find libprotobuf)"]
 +)
  fi
  
 -if test "x$with_libpthread" = "xyes"
 +if test "x$withval" != "xno"
  then
 -      AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
 -fi
 -if test "x$with_libpthread" = "xyes"
 -then
 -      collect_pthread=1
 -else
 -      collect_pthread=0
 +  SAVE_LDFLAGS="$LDFLAGS"
 +  SAVE_LIBS="$LIBS"
 +  LDFLAGS="$with_libprotobuf_ldflags"
 +  LIBS="$PROTOBUF_LIBS $LIBS"
 +  AC_LANG_PUSH([C++])
 +  AC_CHECK_LIB([protobuf], [main],
 +    [
 +      SAVE_CPPFLAGS="$CPPFLAGS"
 +      CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
 +      if test "x$PROTOBUF_LIBS" = "x"
 +      then
 +        PROTOBUF_LIBS="-lprotobuf"
 +      fi
 +      AC_CHECK_HEADERS([google/protobuf/util/time_util.h],
 +        [with_libprotobuf="yes"],
 +        [with_libprotobuf="no (<google/protobuf/util/time_util.h> not found)"]
 +      )
 +      CPPFLAGS="$SAVE_CPPFLAGS"
 +    ],
 +    [with_libprotobuf="no (libprotobuf not found)"]
 +  )
 +  AC_LANG_POP([C++])
 +  LDFLAGS="$SAVE_LDFLAGS"
 +  LIBS="$SAVE_LIBS"
  fi
 -AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
 -      [Wether or not to use pthread (POSIX threads) library])
 -AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")
 +BUILD_WITH_LIBPROTOBUF_CPPFLAGS="$with_libprotobuf_cppflags $PROTOBUF_CFLAGS"
 +BUILD_WITH_LIBPROTOBUF_LDFLAGS="$with_libprotobuf_ldflags"
 +BUILD_WITH_LIBPROTOBUF_LIBS="$PROTOBUF_LIBS"
 +AC_SUBST([BUILD_WITH_LIBPROTOBUF_CPPFLAGS])
 +AC_SUBST([BUILD_WITH_LIBPROTOBUF_LDFLAGS])
 +AC_SUBST([BUILD_WITH_LIBPROTOBUF_LIBS])
  # }}}
  
 -# --with-python {{{
 -with_python_prog=""
 -with_python_path="$PATH"
 -AC_ARG_WITH(python, [AS_HELP_STRING([--with-python@<:@=PREFIX@:>@], [Path to the python interpreter.])],
 -[
 - if test "x$withval" = "xyes" || test "x$withval" = "xno"
 - then
 -       with_python="$withval"
 - else if test -x "$withval"
 - then
 -       with_python_prog="$withval"
 -       with_python_path="`dirname \"$withval\"`$PATH_SEPARATOR$with_python_path"
 -       with_python="yes"
 - else if test -d "$withval"
 - then
 -       with_python_path="$withval$PATH_SEPARATOR$with_python_path"
 -       with_python="yes"
 - else
 -       AC_MSG_WARN([Argument not recognized: $withval])
 - fi; fi; fi
 -], [with_python="yes"])
 -
 -SAVE_PATH="$PATH"
 -SAVE_CPPFLAGS="$CPPFLAGS"
 -SAVE_LDFLAGS="$LDFLAGS"
 -SAVE_LIBS="$LIBS"
 -
 -PATH="$with_python_path"
 -
 -if test "x$with_python" = "xyes" && test "x$with_python_prog" = "x"
 -then
 -      AC_MSG_CHECKING([for python])
 -      with_python_prog="`which python 2>/dev/null`"
 -      if test "x$with_python_prog" = "x"
 -      then
 -              AC_MSG_RESULT([not found])
 -              with_python="no (interpreter not found)"
 -      else
 -              AC_MSG_RESULT([$with_python_prog])
 -      fi
 -fi
 -
 -if test "x$with_python" = "xyes"
 -then
 -      AC_MSG_CHECKING([for Python CPPFLAGS])
 -      python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2>&1`
 -      python_config_status=$?
 -
 -      if test "$python_config_status" -ne 0 || test "x$python_include_path" = "x"
 -      then
 -              AC_MSG_RESULT([failed with status $python_config_status (output: $python_include_path)])
 -              with_python="no"
 -      else
 -              AC_MSG_RESULT([$python_include_path])
 -      fi
 -fi
 -
 -if test "x$with_python" = "xyes"
 +# --with-libprotobuf-c {{{
 +with_libprotobuf_c_cppflags=""
 +with_libprotobuf_c_ldflags=""
 +AC_ARG_WITH([libprotobuf-c], [AS_HELP_STRING([--with-libprotobuf-c@<:@=PREFIX@:>@], [Path to libprotobuf-c.])],
 +  [
 +    if test "x$withval" != "xno" && test "x$withval" != "xyes"
 +    then
 +      with_libprotobuf_c_cppflags="-I$withval/include"
 +      with_libprotobuf_c_ldflags="-L$withval/lib"
 +      with_libprotobuf_c="yes"
 +    fi
 +    if test "x$withval" = "xno"
 +    then
 +      with_libprotobuf_c="no (disabled on command line)"
 +    fi
 +  ],
 +  [withval="yes"]
 +)
 +if test "x$withval" = "xyes"
  then
 -      CPPFLAGS="-I$python_include_path $CPPFLAGS"
 -      AC_CHECK_HEADERS(Python.h,
 -                       [with_python="yes"],
 -                       [with_python="no ('Python.h' not found)"])
 +PKG_CHECK_MODULES([PROTOBUF_C], [libprotobuf-c],
 +  [with_libprotobuf_c="yes"],
 +  [with_libprotobuf_c="no (pkg-config could not find libprotobuf-c)"]
 +)
  fi
  
 -if test "x$with_python" = "xyes"
 +if test "x$withval" != "xno"
  then
 -      AC_MSG_CHECKING([for Python LDFLAGS])
 -      python_library_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_config_vars(\"LIBDIR\").__getitem__(0))" | "$with_python_prog" 2>&1`
 -      python_config_status=$?
 -
 -      if test "$python_config_status" -ne 0 || test "x$python_library_path" = "x"
 -      then
 -              AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_path)])
 -              with_python="no"
 -      else
 -              AC_MSG_RESULT([$python_library_path])
 -      fi
 +  SAVE_LDFLAGS="$LDFLAGS"
 +  SAVE_LIBS="$LIBS"
 +  LDFLAGS="$with_libprotobuf_c_ldflags"
 +  LIBS="$PROTOBUF_C_LIBS $LIBS"
 +  AC_CHECK_LIB([protobuf-c], [protobuf_c_message_pack],
 +    [
 +      SAVE_CPPFLAGS="$CPPFLAGS"
 +      CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
 +      if test "x$PROTOBUF_C_LIBS" = "x"
 +      then
 +        PROTOBUF_C_LIBS="-lprotobuf-c"
 +      fi
 +      AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
 +        [
 +          with_libprotobuf_c="yes"
 +          break
 +        ],
 +        [with_libprotobuf_c="no (<protobuf-c.h> not found)"]
 +      )
 +      CPPFLAGS="$SAVE_CPPFLAGS"
 +    ],
 +    [with_libprotobuf_c="no (libprotobuf-c not found)"]
 +  )
 +  LDFLAGS="$SAVE_LDFLAGS"
 +  LIBS="$SAVE_LIBS"
  fi
 +BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS="$with_libprotobuf_c_cppflags $PROTOBUF_C_CFLAGS"
 +BUILD_WITH_LIBPROTOBUF_C_LDFLAGS="$with_libprotobuf_c_ldflags"
 +BUILD_WITH_LIBPROTOBUF_C_LIBS="$PROTOBUF_C_LIBS"
 +AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS])
 +AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LDFLAGS])
 +AC_SUBST([BUILD_WITH_LIBPROTOBUF_C_LIBS])
 +# }}}
  
 -if test "x$with_python" = "xyes"
 -then
 -      AC_MSG_CHECKING([for Python LIBS])
 -      python_library_flags=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_config_vars(\"BLDLIBRARY\").__getitem__(0))" | "$with_python_prog" 2>&1`
 -      python_config_status=$?
 +# --with-libpython {{{
 +AC_ARG_VAR([LIBPYTHON_CPPFLAGS], [Preprocessor flags for libpython])
 +AC_ARG_VAR([LIBPYTHON_LDFLAGS], [Linker flags for libpython])
 +AC_ARG_VAR([LIBPYTHON_LIBS], [Libraries for libpython])
  
 -      if test "$python_config_status" -ne 0 || test "x$python_library_flags" = "x"
 -      then
 -              AC_MSG_RESULT([failed with status $python_config_status (output: $python_library_flags)])
 -              with_python="no"
 -      else
 -              AC_MSG_RESULT([$python_library_flags])
 -      fi
 +AC_ARG_WITH([libpython],
 +  [AS_HELP_STRING([--with-libpython],
 +    [if we should build with libpython @<:@default=yes@:>@])
 +  ],
 +  [with_libpython="$withval"],
 +  [with_libpython="check"]
 +)
 +if test "$with_libpython" != "no"; then
 +  if test "$LIBPYTHON_CPPFLAGS" = "" && test "$LIBPYTHON_LDFLAGS" = ""; then
 +    AC_ARG_VAR([PYTHON_CONFIG], [path to python-config])
 +    AC_PATH_PROGS([PYTHON_CONFIG],
 +      [python3-config python2-config python-config]
 +    )
 +    if test "$PYTHON_CONFIG" = ""; then
 +      if test "$with_libpython" = "yes"; then
 +        AC_MSG_ERROR([Unable to find python-config])
 +      fi
 +      with_libpython="no"
 +    fi
 +  fi
  fi
  
 -if test "x$with_python" = "xyes"
 -then
 -      LDFLAGS="-L$python_library_path $LDFLAGS"
 -      LIBS="$python_library_flags $LIBS"
 -
 -      AC_CHECK_FUNC(PyObject_CallFunction,
 -                    [with_python="yes"],
 -                    [with_python="no (Symbol 'PyObject_CallFunction' not found)"])
 +if test "$PYTHON_CONFIG" != ""; then
 +  LIBPYTHON_CPPFLAGS="`${PYTHON_CONFIG} --includes`"
 +  if test $? -ne 0; then
 +    with_libpython="no"
 +  fi
 +  LIBPYTHON_LDFLAGS="`${PYTHON_CONFIG} --ldflags`"
 +  if test $? -ne 0; then
 +    with_libpython="no"
 +  fi
 +  LIBPYTHON_LIBS="`${PYTHON_CONFIG} --libs`"
 +  if test $? -ne 0; then
 +    with_libpython="no"
 +  fi
  fi
  
 -PATH="$SAVE_PATH"
 -CPPFLAGS="$SAVE_CPPFLAGS"
 -LDFLAGS="$SAVE_LDFLAGS"
 -LIBS="$SAVE_LIBS"
 -
 -if test "x$with_python" = "xyes"
 -then
 -      BUILD_WITH_PYTHON_CPPFLAGS="-I$python_include_path"
 -      BUILD_WITH_PYTHON_LDFLAGS="-L$python_library_path"
 -      BUILD_WITH_PYTHON_LIBS="$python_library_flags"
 -      AC_SUBST(BUILD_WITH_PYTHON_CPPFLAGS)
 -      AC_SUBST(BUILD_WITH_PYTHON_LDFLAGS)
 -      AC_SUBST(BUILD_WITH_PYTHON_LIBS)
 +if test "$with_libpython" != "xno"; then
 +  SAVE_CPPFLAGS="$CPPFLAGS"
 +  SAVE_LDFLAGS="$LDFLAGS"
 +  SAVE_LIBS="$LIBS"
 +  CPPFLAGS="$LIBPYTHON_CPPFLAGS $CPPFLAGS"
 +  LDFLAGS="$LIBPYTHON_LDFLAGS $LDFLAGS"
 +  LIBS="$LIBPYTHON_LIBS $LIBS"
 +  AC_CHECK_HEADERS([Python.h],
 +    [
 +      AC_MSG_CHECKING([for libpython])
 +      AC_LINK_IFELSE([AC_LANG_PROGRAM(
 +          [[#include <Python.h>]],
 +          [[Py_Initialize();]])
 +        ],
 +        [with_libpython="yes"],
 +        [with_libpython="no"]
 +      )
 +      AC_MSG_RESULT([$with_libpython])
 +    ],
 +    [with_libpython="no"]
 +  )
 +  CPPFLAGS="$SAVE_CPPFLAGS"
 +  LDFLAGS="$SAVE_LDFLAGS"
 +  LIBS="$SAVE_LIBS"
  fi
 -# }}} --with-python
 +# }}} --with-libpython
  
  # --with-librabbitmq {{{
  with_librabbitmq_cppflags=""
@@@ -4304,102 -4032,76 +4354,102 @@@ AM_CONDITIONAL(BUILD_WITH_LIBROUTEROS, 
  # }}}
  
  # --with-librrd {{{
 -# AC_ARG_WITH (package, help-string, [action-if-given], [action-if-not-given])
  librrd_cflags=""
  librrd_ldflags=""
 -librrd_threadsafe="yes"
 +librrd_threadsafe="no"
  librrd_rrdc_update="no"
 -AC_ARG_WITH(librrd, [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
 -[     if test "x$withval" != "xno" && test "x$withval" != "xyes"
 -      then
 -              librrd_cflags="-I$withval/include"
 -              librrd_ldflags="-L$withval/lib"
 -              with_librrd="yes"
 -      else
 -              with_librrd="$withval"
 -      fi
 -], [with_librrd="yes"])
 +AC_ARG_WITH(librrd,
 +  [AS_HELP_STRING([--with-librrd@<:@=PREFIX@:>@], [Path to rrdtool.])],
 +  [
 +    if test "x$withval" != "xno" && test "x$withval" != "xyes"
 +    then
 +      librrd_cflags="-I$withval/include"
 +      librrd_ldflags="-L$withval/lib"
 +      with_librrd="yes"
 +    else
 +      with_librrd="$withval"
 +    fi
 +  ],
 +  [with_librrd="yes"]
 +)
 +
  if test "x$with_librrd" = "xyes"
  then
 -      SAVE_CPPFLAGS="$CPPFLAGS"
 -      SAVE_LDFLAGS="$LDFLAGS"
 +  SAVE_LDFLAGS="$LDFLAGS"
 +  LDFLAGS="$LDFLAGS $librrd_ldflags"
 +  PKG_CHECK_MODULES([RRD], [librrd >= 1.6.0],
 +    [
 +      AC_CHECK_LIB([rrd], [rrd_update_r],
 +        [librrd_threadsafe="yes"],
 +        [:]
 +      )
 +      AC_CHECK_LIB([rrd], [rrdc_update],
 +        [librrd_rrdc_update="yes"],
 +        [:]
 +      )
 +    ],[:]
 +  )
 +  LDFLAGS="$SAVE_LDFLAGS"
  
 -      CPPFLAGS="$CPPFLAGS $librrd_cflags"
 -      LDFLAGS="$LDFLAGS $librrd_ldflags"
 +  SAVE_CPPFLAGS="$CPPFLAGS"
 +  CPPFLAGS="$CPPFLAGS $RRD_CFLAGS $librrd_cflags"
  
 -      AC_CHECK_HEADERS(rrd.h,, [with_librrd="no (rrd.h not found)"])
 +  AC_CHECK_HEADERS([rrd.h],, [with_librrd="no (rrd.h not found)"])
  
 -      CPPFLAGS="$SAVE_CPPFLAGS"
 -      LDFLAGS="$SAVE_LDFLAGS"
 +  CPPFLAGS="$SAVE_CPPFLAGS"
  fi
 -if test "x$with_librrd" = "xyes"
 -then
 -      SAVE_CPPFLAGS="$CPPFLAGS"
 -      SAVE_LDFLAGS="$LDFLAGS"
  
 -      CPPFLAGS="$CPPFLAGS $librrd_cflags"
 -      LDFLAGS="$LDFLAGS $librrd_ldflags"
 +if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
 +then
 +  SAVE_LDFLAGS="$LDFLAGS"
 +  LDFLAGS="$LDFLAGS $librrd_ldflags"
  
 -      AC_CHECK_LIB(rrd_th, rrd_update_r,
 -      [with_librrd="yes"
 -       librrd_ldflags="$librrd_ldflags -lrrd_th -lm"
 -      ],
 -      [librrd_threadsafe="no"
 -       AC_CHECK_LIB(rrd, rrd_update,
 -       [with_librrd="yes"
 -        librrd_ldflags="$librrd_ldflags -lrrd -lm"
 -       ],
 -       [with_librrd="no (symbol 'rrd_update' not found)"],
 -       [-lm])
 -      ],
 -      [-lm])
 +  AC_CHECK_LIB([rrd_th], [rrd_update_r],
 +    [
 +      librrd_ldflags="$librrd_ldflags -lrrd_th"
 +      librrd_threadsafe="yes"
 +      AC_CHECK_LIB([rrd_th], [rrdc_update],
 +        [librrd_rrdc_update="yes"],
 +        [:],
 +      )
 +    ],
 +    [:]
 +  )
 +  LDFLAGS="$SAVE_LDFLAGS"
 +fi
  
 -      if test "x$librrd_threadsafe" = "xyes"
 -      then
 -              AC_CHECK_LIB(rrd_th, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
 -      else
 -              AC_CHECK_LIB(rrd, rrdc_update, [librrd_rrdc_update="yes"], [librrd_rrdc_update="no"])
 -      fi
 +if test "x$with_librrd" = "xyes" && test "x$librrd_threadsafe" = "xno"
 +then
 +  SAVE_LDFLAGS="$LDFLAGS"
 +  LDFLAGS="$LDFLAGS $librrd_ldflags"
  
 -      CPPFLAGS="$SAVE_CPPFLAGS"
 -      LDFLAGS="$SAVE_LDFLAGS"
 +  AC_CHECK_LIB([rrd], [rrd_update],
 +    [
 +      librrd_ldflags="$librrd_ldflags -lrrd"
 +      AC_CHECK_LIB([rrd], [rrdc_update],
 +        [librrd_rrdc_update="yes"],
 +        [:]
 +      )
 +    ],
 +    [with_librrd="no (symbol 'rrd_update' not found)"]
 +  )
 +  LDFLAGS="$SAVE_LDFLAGS"
  fi
 +
  if test "x$with_librrd" = "xyes"
  then
 -      BUILD_WITH_LIBRRD_CFLAGS="$librrd_cflags"
 -      BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
 -      AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
 -      AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
 +  BUILD_WITH_LIBRRD_CFLAGS="$RRD_CFLAGS $librrd_cflags"
 +  BUILD_WITH_LIBRRD_LDFLAGS="$librrd_ldflags"
 +  BUILD_WITH_LIBRRD_LIBS="$RRD_LIBS"
 +  AC_SUBST(BUILD_WITH_LIBRRD_CFLAGS)
 +  AC_SUBST(BUILD_WITH_LIBRRD_LDFLAGS)
 +  AC_SUBST(BUILD_WITH_LIBRRD_LIBS)
  fi
  if test "x$librrd_threadsafe" = "xyes"
  then
 -      AC_DEFINE(HAVE_THREADSAFE_LIBRRD, 1, [Define to 1 if you have the threadsafe rrd library (-lrrd_th).])
 +  AC_DEFINE([HAVE_THREADSAFE_LIBRRD], [1],
 +    [Define to 1 if the rrd library is thread-safe]
 +  )
  fi
  # }}}
  
@@@ -4434,6 -4136,11 +4484,6 @@@ the
        SAVE_CPPFLAGS="$CPPFLAGS"
        CPPFLAGS="$CPPFLAGS $with_sensors_cflags"
  
 -#     AC_CHECK_HEADERS(sensors/sensors.h,
 -#     [
 -#             AC_DEFINE(HAVE_SENSORS_SENSORS_H, 1, [Define to 1 if you have the <sensors/sensors.h> header file.])
 -#     ],
 -#     [with_libsensors="no (sensors/sensors.h not found)"])
        AC_CHECK_HEADERS(sensors/sensors.h, [], [with_libsensors="no (sensors/sensors.h not found)"])
  
        CPPFLAGS="$SAVE_CPPFLAGS"
  AM_CONDITIONAL(BUILD_WITH_LM_SENSORS, test "x$with_libsensors" = "xyes")
  # }}}
  
 -# --with-libsigrok {{{
 -with_libsigrok_cflags=""
 -with_libsigrok_ldflags=""
 -AC_ARG_WITH(libsigrok, [AS_HELP_STRING([--with-libsigrok@<:@=PREFIX@:>@], [Path to libsigrok.])],
 -[
 -      if test "x$withval" = "xno"
 -      then
 -              with_libsigrok="no"
 -      else
 -              with_libsigrok="yes"
 -              if test "x$withval" != "xyes"
 -              then
 -                      with_libsigrok_cflags="-I$withval/include"
 -                      with_libsigrok_ldflags="-L$withval/lib"
 -              fi
 -      fi
 -],[with_libsigrok="yes"])
 -
 -# libsigrok has a glib dependency
 -if test "x$with_libsigrok" = "xyes"
 -then
 -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)"
 -      ]
 +# libsigrok {{{
 +AC_SUBST([LIBSIGROK_CFLAGS])
 +AC_SUBST([LIBSIGROK_LIBS])
 +PKG_CHECK_MODULES([LIBSIGROK], [libsigrok < 0.4],
 +  [with_libsigrok="yes"],
 +  [with_libsigrok="no (pkg-config could not find libsigrok)"]
  )
 -fi
 -
 -# libsigrok headers
 -if test "x$with_libsigrok" = "xyes"
 -then
 -      SAVE_CPPFLAGS="$CPPFLAGS"
 -      CPPFLAGS="$CPPFLAGS $with_libsigrok_cflags"
 -
 -      AC_CHECK_HEADERS(libsigrok/libsigrok.h, [], [with_libsigrok="no (libsigrok/libsigrok.h not found)"])
 -
 -      CPPFLAGS="$SAVE_CPPFLAGS"
 -fi
 -
 -# libsigrok library
 -if test "x$with_libsigrok" = "xyes"
 -then
 -      SAVE_CPPFLAGS="$CPPFLAGS"
 -      SAVE_LDFLAGS="$LDFLAGS"
 -      CPPFLAGS="$CPPFLAGS $with_libsigrok_cflags"
 -      LDFLAGS="$LDFLAGS $with_libsigrok_ldflags"
 -
 -      AC_CHECK_LIB(sigrok, sr_init,
 -      [
 -              AC_DEFINE(HAVE_LIBSIGROK, 1, [Define to 1 if you have the sigrok library (-lsigrok).])
 -      ],
 -      [with_libsigrok="no (libsigrok not found)"])
 -
 -      CPPFLAGS="$SAVE_CPPFLAGS"
 -      LDFLAGS="$SAVE_LDFLAGS"
 -fi
 -if test "x$with_libsigrok" = "xyes"
 -then
 -      BUILD_WITH_LIBSIGROK_CFLAGS="$with_libsigrok_cflags"
 -      BUILD_WITH_LIBSIGROK_LDFLAGS="$with_libsigrok_ldflags"
 -      AC_SUBST(BUILD_WITH_LIBSIGROK_CFLAGS)
 -      AC_SUBST(BUILD_WITH_LIBSIGROK_LDFLAGS)
 -fi
 -AM_CONDITIONAL(BUILD_WITH_LIBSIGROK, test "x$with_libsigrok" = "xyes")
  # }}}
  
  # --with-libstatgrab {{{
@@@ -4498,16 -4266,23 +4548,16 @@@ AC_ARG_WITH(libstatgrab, [AS_HELP_STRIN
  if test "x$with_libstatgrab" = "xyes" \
    && test "x$with_libstatgrab_pkg_config" = "xyes"
  then
 -  if test "x$PKG_CONFIG" != "x"
 +  AC_MSG_CHECKING([pkg-config for libstatgrab])
 +  temp_result="found"
 +  $PKG_CONFIG --exists libstatgrab 2>/dev/null
 +  if test "$?" != "0"
    then
 -    AC_MSG_CHECKING([pkg-config for libstatgrab])
 -    temp_result="found"
 -    $PKG_CONFIG --exists libstatgrab 2>/dev/null
 -    if test "$?" != "0"
 -    then
 -      with_libstatgrab_pkg_config="no"
 -      with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
 -      temp_result="not found"
 -    fi
 -    AC_MSG_RESULT([$temp_result])
 -  else
 -    AC_MSG_NOTICE([pkg-config not available, trying to guess flags for the statgrab library.])
      with_libstatgrab_pkg_config="no"
 -    with_libstatgrab_ldflags="$with_libstatgrab_ldflags -lstatgrab"
 +    with_libstatgrab="no (pkg-config doesn't know libstatgrab)"
 +    temp_result="not found"
    fi
 +  AC_MSG_RESULT([$temp_result])
  fi
  
  if test "x$with_libstatgrab" = "xyes" \
  if test "x$with_libstatgrab" = "xyes"
  then
    SAVE_CFLAGS="$CFLAGS"
 +  SAVE_LDFLAGS="$LDFLAGS"
    SAVE_LIBS="$LIBS"
  
    CFLAGS="$CFLAGS $with_libstatgrab_cflags"
@@@ -4744,10 -4518,8 +4794,10 @@@ if test "x$with_libudev" = "xyes
  then
        BUILD_WITH_LIBUDEV_CFLAGS="$with_libudev_cflags"
        BUILD_WITH_LIBUDEV_LDFLAGS="$with_libudev_ldflags"
 +      BUILD_WITH_LIBUDEV_LIBS="-ludev"
        AC_SUBST(BUILD_WITH_LIBUDEV_CFLAGS)
        AC_SUBST(BUILD_WITH_LIBUDEV_LDFLAGS)
 +      AC_SUBST(BUILD_WITH_LIBUDEV_LIBS)
  fi
  AM_CONDITIONAL(BUILD_WITH_LIBUDEV, test "x$with_libudev" = "xyes")
  # }}}
  # configure using pkg-config
  if test "x$with_libupsclient" = "xuse_pkgconfig"
  then
 -      if test "x$PKG_CONFIG" = "x"
 -      then
 -              with_libupsclient="no (Don't have pkg-config)"
 -      fi
 -fi
 -if test "x$with_libupsclient" = "xuse_pkgconfig"
 -then
        AC_MSG_NOTICE([Checking for libupsclient using $PKG_CONFIG])
        $PKG_CONFIG --exists 'libupsclient' 2>/dev/null
        if test $? -ne 0
  fi
  # }}}
  
 +# --with-libxenctrl {{{
 +with_libxenctrl_cppflags=""
 +with_libxenctrl_ldflags=""
 +AC_ARG_WITH(libxenctrl, [AS_HELP_STRING([--with-libxenctrl@<:@=PREFIX@:>@], [Path to libxenctrl.])],
 +[
 +      if test "x$withval" != "xno" && test "x$withval" != "xyes"
 +      then
 +              with_libxenctrl_cppflags="-I$withval/include"
 +              with_libxenctrl_ldflags="-L$withval/lib"
 +              with_libxenctrl="yes"
 +      else
 +              with_libxenctrl="$withval"
 +      fi
 +],
 +[
 +      with_libxenctrl="yes"
 +])
 +if test "x$with_libxenctrl" = "xyes"
 +then
 +      SAVE_CPPFLAGS="$CPPFLAGS"
 +      CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
 +
 +      AC_CHECK_HEADERS(xenctrl.h, [with_libxenctrl="yes"], [with_libxenctrl="no (xenctrl.h not found)"])
 +
 +      CPPFLAGS="$SAVE_CPPFLAGS"
 +fi
 +if test "x$with_libxenctrl" = "xyes"
 +then
 +      SAVE_CPPFLAGS="$CPPFLAGS"
 +      SAVE_LDFLAGS="$LDFLAGS"
 +      CPPFLAGS="$CPPFLAGS $with_libxenctrl_cppflags"
 +      LDFLAGS="$LDFLAGS $with_libxenctrl_ldflags"
 +
 +      #Xen versions older than 3.4 has no xc_getcpuinfo()
 +      AC_CHECK_LIB(xenctrl, xc_getcpuinfo, [with_libxenctrl="yes"], [with_libxenctrl="no (symbol 'xc_getcpuinfo' not found)"], [])
 +
 +      CPPFLAGS="$SAVE_CPPFLAGS"
 +      LDFLAGS="$SAVE_LDFLAGS"
 +      LIBXENCTL_CPPFLAGS="$with_libxenctl_cppflags"
 +      LIBXENCTL_LDFLAGS="$with_libxenctl_ldflags"
 +      AC_SUBST(LIBXENCTL_CPPFLAGS)
 +      AC_SUBST(LIBXENCTL_LDFLAGS)
 +fi
 +# }}}
 +
  # --with-libxmms {{{
  with_xmms_config="xmms-config"
  with_xmms_cflags=""
@@@ -5062,7 -4796,7 +5112,7 @@@ AC_ARG_WITH(mic,[AS_HELP_STRING([--with
                AC_MSG_NOTICE([Not checking for Intel Mic: Manually configured])
                with_mic_cflags="-I$withval/include"
                with_mic_ldpath="-L$withval/lib/Linux"
 -              with_mic_libs="-lMicAccessSDK -lscif -lpthread"
 +              with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"
                with_mic="yes"
        fi; fi; fi
  ],
@@@ -5084,8 -4818,8 +5134,8 @@@ the
  
        AC_CHECK_LIB(MicAccessSDK, MicInitAPI,
                        [with_mic_ldpath="$with_mic_ldpath"
 -                      with_mic_libs="-lMicAccessSDK -lscif -lpthread"],
 -                      [with_mic="no (symbol MicInitAPI not found)"],[-lscif -lpthread])
 +                      with_mic_libs="$PTHREAD_LIBS -lMicAccessSDK -lscif"],
 +                      [with_mic="no (symbol MicInitAPI not found)"],[$PTHREAD_LIBS -lscif])
  
        CPPFLAGS="$SAVE_CPPFLAGS"
        LDFLAGS="$SAVE_LDFLAGS"
@@@ -5127,6 -4861,13 +5177,6 @@@ AC_ARG_WITH(libvarnish, [AS_HELP_STRING
  # configure using pkg-config
  if test "x$with_libvarnish" = "xuse_pkgconfig"
  then
 -      if test "x$PKG_CONFIG" = "x"
 -      then
 -              with_libvarnish="no (Don't have pkg-config)"
 -      fi
 -fi
 -if test "x$with_libvarnish" = "xuse_pkgconfig"
 -then
        AC_MSG_NOTICE([Checking for varnishapi using $PKG_CONFIG])
        $PKG_CONFIG --exists 'varnishapi' 2>/dev/null
        if test $? -ne 0
@@@ -5186,20 -4927,23 +5236,20 @@@ with_libxml2_ldflags="
  with_libvirt="no (pkg-config isn't available)"
  with_libvirt_cflags=""
  with_libvirt_ldflags=""
 -if test "x$PKG_CONFIG" != "x"
 +$PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
 +if test "$?" = "0"
  then
 -      $PKG_CONFIG --exists 'libxml-2.0' 2>/dev/null
 -      if test "$?" = "0"
 -      then
 -              with_libxml2="yes"
 -      else
 -              with_libxml2="no (pkg-config doesn't know libxml-2.0)"
 -      fi
 +      with_libxml2="yes"
 +else
 +      with_libxml2="no (pkg-config doesn't know libxml-2.0)"
 +fi
  
 -      $PKG_CONFIG --exists libvirt 2>/dev/null
 -      if test "$?" = "0"
 -      then
 -              with_libvirt="yes"
 -      else
 -              with_libvirt="no (pkg-config doesn't know libvirt)"
 -      fi
 +$PKG_CONFIG --exists libvirt 2>/dev/null
 +if test "$?" = "0"
 +then
 +      with_libvirt="yes"
 +else
 +      with_libvirt="no (pkg-config doesn't know libvirt)"
  fi
  if test "x$with_libxml2" = "xyes"
  then
@@@ -5298,6 -5042,17 +5348,6 @@@ with_libopenipmipthread="yes
  with_libopenipmipthread_cflags=""
  with_libopenipmipthread_libs=""
  
 -AC_MSG_CHECKING([for pkg-config])
 -temp_result="no"
 -if test "x$PKG_CONFIG" = "x"
 -then
 -      with_libopenipmipthread="no"
 -      temp_result="no"
 -else
 -      temp_result="$PKG_CONFIG"
 -fi
 -AC_MSG_RESULT([$temp_result])
 -
  if test "x$with_libopenipmipthread" = "xyes"
  then
        AC_MSG_CHECKING([for libOpenIPMIpthread])
@@@ -5421,12 -5176,11 +5471,12 @@@ AM_CONDITIONAL(BUILD_WITH_LIBATASMART, 
  
  PKG_CHECK_MODULES([LIBNOTIFY], [libnotify],
                [with_libnotify="yes"],
 -              [if test "x$LIBNOTIFY_PKG_ERRORS" = "x"; then
 -                       with_libnotify="no"
 -               else
 -                       with_libnotify="no ($LIBNOTIFY_PKG_ERRORS)"
 -               fi])
 +              [with_libnotify="no (pkg-config doesn't know libnotify)"]
 +)
 +
 +PKG_CHECK_MODULES([LIBRIEMANN_CLIENT], [riemann-client >= 1.8.0],
 + [with_libriemann_client="yes"],
 + [with_libriemann_client="no (pkg-config doesn't know libriemann-client)"])
  
  # Check for enabled/disabled features
  #
@@@ -5519,7 -5273,7 +5569,7 @@@ AC_DEFUN
             then
                     enable_plugin="yes"
             else
 -                   enable_plugin="no"
 +                   enable_plugin="$2"
             fi
         else
             enable_plugin="$enable_all_plugins"
                    fi
            else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
                    dependency_error="yes"
 -                  enable_plugin="no (dependency error)"
 +                  enable_plugin="$2 (dependency error)"
            fi
      fi
      AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes")
@@@ -5565,7 -5319,6 +5615,7 @@@ plugin_conntrack="no
  plugin_contextswitch="no"
  plugin_cpu="no"
  plugin_cpufreq="no"
 +plugin_cpusleep="no"
  plugin_curl_json="no"
  plugin_curl_xml="no"
  plugin_df="no"
@@@ -5575,7 -5328,7 +5625,8 @@@ plugin_entropy="no
  plugin_ethstat="no"
  plugin_fhcount="no"
  plugin_fscache="no"
+ plugin_gps="no"
 +plugin_grpc="no"
  plugin_interface="no"
  plugin_ipmi="no"
  plugin_ipvs="no"
@@@ -5587,12 -5340,9 +5638,12 @@@ plugin_multimeter="no
  plugin_nfs="no"
  plugin_numa="no"
  plugin_perl="no"
 +plugin_pinba="no"
  plugin_processes="no"
  plugin_protocols="no"
 +plugin_python="no"
  plugin_serial="no"
 +plugin_smart="no"
  plugin_swap="no"
  plugin_tape="no"
  plugin_tcpconns="no"
@@@ -5605,7 -5355,6 +5656,7 @@@ plugin_virt="no
  plugin_vmem="no"
  plugin_vserver="no"
  plugin_wireless="no"
 +plugin_xencpu="no"
  plugin_zfs_arc="no"
  plugin_zone="no"
  plugin_zookeeper="no"
  if test "x$ac_system" = "xLinux"
  then
        plugin_battery="yes"
 +      plugin_cgroups="yes"
        plugin_conntrack="yes"
        plugin_contextswitch="yes"
 -      plugin_cgroups="yes"
        plugin_cpu="yes"
        plugin_cpufreq="yes"
        plugin_disk="yes"
        then
                plugin_turbostat="yes"
        fi
 +      
 +      if test "x$c_cv_have_clock_boottime_monotonic" = "xyes"
 +      then
 +              plugin_cpusleep="yes"
 +      fi
  fi
  
  if test "x$ac_system" = "xOpenBSD"
        plugin_tcpconns="yes"
  fi
  
 +if test "x$ac_system" = "xNetBSD"
 +then
 +      plugin_disk="yes"
 +      plugin_entropy="yes"
 +      plugin_irq="yes"
 +      plugin_processes="yes"
 +fi
 +
  # Mac OS X devices
  if test "x$with_libiokit" = "xyes"
  then
  
  if test "x$ac_system" = "xAIX"
  then
 -      plugin_tcpconns="yes"
        plugin_ipc="yes"
 +      plugin_tcpconns="yes"
  fi
  
  # FreeBSD
  
  if test "x$with_perfstat" = "xyes"
  then
 -      plugin_cpu="yes"
        plugin_contextswitch="yes"
 +      plugin_cpu="yes"
        plugin_disk="yes"
 -      plugin_memory="yes"
 -      plugin_swap="yes"
        plugin_interface="yes"
        plugin_load="yes"
 +      plugin_memory="yes"
 +      plugin_swap="yes"
        plugin_uptime="yes"
  fi
  
@@@ -5733,6 -5469,7 +5784,6 @@@ the
  fi
  
  # libi2c-dev
 -with_libi2c="no"
  if test "x$ac_system" = "xLinux"
  then
  AC_CHECK_DECL(i2c_smbus_read_i2c_block_data,
        [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>]])
 +else
 +      with_libi2c="no (Linux only)"
  fi
  
  if test "x$with_libi2c" = "xyes"
        plugin_df="yes"
  fi
  
 +if test "x$c_cv_have_getmntent_r" = "xyes"
 +then
 +      plugin_df="yes"
 +fi
 +
  # Df plugin: Check if we have either `statfs' or `statvfs' second.
  if test "x$plugin_df" = "xyes"
  then
        plugin_ethstat="yes"
  fi
  
 +if test "x$with_libgrpcpp" = "xyes" && test "x$with_libprotobuf" = "xyes" && test "x$have_protoc3" = "xyes" && test "x$GRPC_CPP_PLUGIN" != "x"
 +then
 +      plugin_grpc="yes"
 +fi
 +
  if test "x$have_getifaddrs" = "xyes"
  then
        plugin_interface="yes"
  fi
  
 -if test "x$with_libgps" = "xyes" && test "x$with_libpthread" = "xyes"
++if test "x$with_libgps" = "xyes"
+ then
+       plugin_gps="yes"
+ fi
  if test "x$have_getloadavg" = "xyes"
  then
        plugin_load="yes"
        plugin_perl="yes"
  fi
  
 +if test "x$have_protoc_c" = "xyes" && test "x$with_libprotobuf_c" = "xyes"
 +then
 +      plugin_pinba="yes"
 +fi
 +
  # Mac OS X memory interface
  if test "x$have_host_statistics" = "xyes"
  then
        plugin_processes="yes"
  fi
  
 +if test "x$with_libpython" != "xno"
 +then
 +      plugin_python="yes"
 +fi
 +
 +if test "x$with_libatasmart" = "xyes" && test "x$with_libudev" = "xyes"
 +then
 +      plugin_smart="yes"
 +fi
 +
  if test "x$with_kvm_getswapinfo" = "xyes"
  then
        plugin_swap="yes"
        plugin_swap="yes"
  fi
  
 +if test "x$have_swapctl" = "xyes" && test "x$c_cv_have_swapctl_three_args" = "xyes"
 +then
 +      plugin_swap="yes"
 +fi
 +
  if test "x$with_kvm_openfiles$with_kvm_nlist" = "xyesyes"
  then
        plugin_tcpconns="yes"
        plugin_virt="yes"
  fi
  
 +if test "x$with_libxenctrl" = "xyes"
 +then
 +  plugin_xencpu="yes"
 +fi
  
  m4_divert_once([HELP_ENABLE], [
  collectd plugins:])
@@@ -5987,148 -5693,144 +6043,149 @@@ AC_ARG_ENABLE([all-plugins]
  
  m4_divert_once([HELP_ENABLE], [])
  
 -AC_PLUGIN([aggregation], [yes],                [Aggregation plugin])
 -AC_PLUGIN([amqp],        [$with_librabbitmq],  [AMQP output plugin])
 -AC_PLUGIN([apache],      [$with_libcurl],      [Apache httpd statistics])
 -AC_PLUGIN([apcups],      [yes],                [Statistics of UPSes by APC])
 -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([ceph],        [$plugin_ceph],       [Ceph daemon statistics])
 -AC_PLUGIN([conntrack],   [$plugin_conntrack],  [nf_conntrack statistics])
 -AC_PLUGIN([contextswitch], [$plugin_contextswitch], [context switch statistics])
 -AC_PLUGIN([cpufreq],     [$plugin_cpufreq],    [CPU frequency statistics])
 -AC_PLUGIN([cpu],         [$plugin_cpu],        [CPU usage statistics])
 -AC_PLUGIN([csv],         [yes],                [CSV output plugin])
 -AC_PLUGIN([curl],        [$with_libcurl],      [CURL generic web statistics])
 -AC_PLUGIN([curl_json],   [$plugin_curl_json],    [CouchDB statistics])
 -AC_PLUGIN([curl_xml],   [$plugin_curl_xml],    [CURL generic xml statistics])
 -AC_PLUGIN([cgroups],     [$plugin_cgroups],    [CGroups CPU usage accounting])
 -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])
 -AC_PLUGIN([ethstat],     [$plugin_ethstat],    [Stats from NIC driver])
 -AC_PLUGIN([exec],        [yes],                [Execution of external programs])
 -AC_PLUGIN([fhcount],     [$plugin_fhcount],    [File handles statistics])
 -AC_PLUGIN([filecount],   [yes],                [Count files in directories])
 -AC_PLUGIN([fscache],     [$plugin_fscache],    [fscache statistics])
 -AC_PLUGIN([gmond],       [$with_libganglia],   [Ganglia plugin])
 -AC_PLUGIN([gps],         [$plugin_gps],        [GPS plugin])
 -AC_PLUGIN([hddtemp],     [yes],                [Query hddtempd])
 -AC_PLUGIN([interface],   [$plugin_interface],  [Interface traffic statistics])
 -AC_PLUGIN([ipc],         [$plugin_ipc],        [IPC statistics])
 -AC_PLUGIN([ipmi],        [$plugin_ipmi],       [IPMI sensor statistics])
 -AC_PLUGIN([iptables],    [$with_libiptc],      [IPTables rule counters])
 -AC_PLUGIN([ipvs],        [$plugin_ipvs],       [IPVS connection statistics])
 -AC_PLUGIN([irq],         [$plugin_irq],        [IRQ statistics])
 -AC_PLUGIN([java],        [$with_java],         [Embed the Java Virtual Machine])
 -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])
 -AC_PLUGIN([match_empty_counter], [yes],        [The empty counter match])
 -AC_PLUGIN([match_hashed], [yes],               [The hashed match])
 -AC_PLUGIN([match_regex], [yes],                [The regex match])
 -AC_PLUGIN([match_timediff], [yes],             [The timediff match])
 -AC_PLUGIN([match_value], [yes],                [The value match])
 -AC_PLUGIN([mbmon],       [yes],                [Query mbmond])
 -AC_PLUGIN([md],          [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
 -AC_PLUGIN([memcachec],   [$with_libmemcached], [memcachec statistics])
 -AC_PLUGIN([memcached],   [yes],                [memcached statistics])
 -AC_PLUGIN([memory],      [$plugin_memory],     [Memory usage])
 -AC_PLUGIN([mic],         [$with_mic],          [Intel Many Integrated Core stats])
 -AC_PLUGIN([modbus],      [$with_libmodbus],    [Modbus plugin])
 -AC_PLUGIN([mqtt],        [$with_libmosquitto], [MQTT output plugin])
 -AC_PLUGIN([multimeter],  [$plugin_multimeter], [Read multimeter values])
 -AC_PLUGIN([mysql],       [$with_libmysql],     [MySQL statistics])
 -AC_PLUGIN([netapp],      [$with_libnetapp],    [NetApp plugin])
 -AC_PLUGIN([netlink],     [$with_libmnl],       [Enhanced Linux network statistics])
 -AC_PLUGIN([network],     [yes],                [Network communication plugin])
 -AC_PLUGIN([nfs],         [$plugin_nfs],        [NFS statistics])
 -AC_PLUGIN([nginx],       [$with_libcurl],      [nginx statistics])
 -AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
 -AC_PLUGIN([notify_email], [$with_libesmtp],    [Email notifier])
 -AC_PLUGIN([ntpd],        [yes],                [NTPd statistics])
 -AC_PLUGIN([numa],        [$plugin_numa],       [NUMA virtual memory statistics])
 -AC_PLUGIN([nut],         [$with_libupsclient], [Network UPS tools statistics])
 -AC_PLUGIN([olsrd],       [yes],                [olsrd statistics])
 -AC_PLUGIN([onewire],     [$with_libowcapi],    [OneWire sensor statistics])
 -AC_PLUGIN([openldap],    [$with_libldap],      [OpenLDAP statistics])
 -AC_PLUGIN([openvpn],     [yes],                [OpenVPN client statistics])
 -AC_PLUGIN([oracle],      [$with_oracle],       [Oracle plugin])
 -AC_PLUGIN([perl],        [$plugin_perl],       [Embed a Perl interpreter])
 -AC_PLUGIN([pf],          [$have_net_pfvar_h],  [BSD packet filter (PF) statistics])
 +AC_PLUGIN([aggregation],         [yes],                     [Aggregation plugin])
 +AC_PLUGIN([amqp],                [$with_librabbitmq],       [AMQP output plugin])
 +AC_PLUGIN([apache],              [$with_libcurl],           [Apache httpd statistics])
 +AC_PLUGIN([apcups],              [yes],                     [Statistics of UPSes by APC])
 +AC_PLUGIN([apple_sensors],       [$with_libiokit],          [Apple hardware sensors])
 +AC_PLUGIN([aquaero],             [$with_libaquaero5],       [Aquaero 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([ceph],                [$plugin_ceph],            [Ceph daemon statistics])
 +AC_PLUGIN([cgroups],             [$plugin_cgroups],         [CGroups CPU usage accounting])
 +AC_PLUGIN([chrony],              [yes],                     [Chrony statistics])
 +AC_PLUGIN([conntrack],           [$plugin_conntrack],       [nf_conntrack statistics])
 +AC_PLUGIN([contextswitch],       [$plugin_contextswitch],   [context switch statistics])
 +AC_PLUGIN([cpu],                 [$plugin_cpu],             [CPU usage statistics])
 +AC_PLUGIN([cpufreq],             [$plugin_cpufreq],         [CPU frequency statistics])
 +AC_PLUGIN([cpusleep],            [$plugin_cpusleep],        [CPU sleep statistics])
 +AC_PLUGIN([csv],                 [yes],                     [CSV output plugin])
 +AC_PLUGIN([curl],                [$with_libcurl],           [CURL generic web statistics])
 +AC_PLUGIN([curl_json],           [$plugin_curl_json],       [CouchDB statistics])
 +AC_PLUGIN([curl_xml],            [$plugin_curl_xml],        [CURL generic xml statistics])
 +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([dns],                 [$with_libpcap],           [DNS traffic analysis])
 +AC_PLUGIN([drbd],                [$plugin_drbd],            [DRBD statistics])
 +AC_PLUGIN([email],               [yes],                     [EMail statistics])
 +AC_PLUGIN([entropy],             [$plugin_entropy],         [Entropy statistics])
 +AC_PLUGIN([ethstat],             [$plugin_ethstat],         [Stats from NIC driver])
 +AC_PLUGIN([exec],                [yes],                     [Execution of external programs])
 +AC_PLUGIN([fhcount],             [$plugin_fhcount],         [File handles statistics])
 +AC_PLUGIN([filecount],           [yes],                     [Count files in directories])
 +AC_PLUGIN([fscache],             [$plugin_fscache],         [fscache statistics])
 +AC_PLUGIN([gmond],               [$with_libganglia],        [Ganglia plugin])
++AC_PLUGIN([gps],                 [$plugin_gps],             [GPS plugin])
 +AC_PLUGIN([grpc],                [$plugin_grpc],            [gRPC plugin])
 +AC_PLUGIN([hddtemp],             [yes],                     [Query hddtempd])
 +AC_PLUGIN([interface],           [$plugin_interface],       [Interface traffic statistics])
 +AC_PLUGIN([ipc],                 [$plugin_ipc],             [IPC statistics])
 +AC_PLUGIN([ipmi],                [$plugin_ipmi],            [IPMI sensor statistics])
 +AC_PLUGIN([iptables],            [$with_libiptc],           [IPTables rule counters])
 +AC_PLUGIN([ipvs],                [$plugin_ipvs],            [IPVS connection statistics])
 +AC_PLUGIN([irq],                 [$plugin_irq],             [IRQ statistics])
 +AC_PLUGIN([java],                [$with_java],              [Embed the Java Virtual Machine])
 +AC_PLUGIN([load],                [$plugin_load],            [System load])
 +AC_PLUGIN([log_logstash],        [$plugin_log_logstash],    [Logstash json_event compatible logging])
 +AC_PLUGIN([logfile],             [yes],                     [File logging plugin])
 +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])
 +AC_PLUGIN([match_empty_counter], [yes],                     [The empty counter match])
 +AC_PLUGIN([match_hashed],        [yes],                     [The hashed match])
 +AC_PLUGIN([match_regex],         [yes],                     [The regex match])
 +AC_PLUGIN([match_timediff],      [yes],                     [The timediff match])
 +AC_PLUGIN([match_value],         [yes],                     [The value match])
 +AC_PLUGIN([mbmon],               [yes],                     [Query mbmond])
 +AC_PLUGIN([md],                  [$have_linux_raid_md_u_h], [md (Linux software RAID) devices])
 +AC_PLUGIN([memcachec],           [$with_libmemcached],      [memcachec statistics])
 +AC_PLUGIN([memcached],           [yes],                     [memcached statistics])
 +AC_PLUGIN([memory],              [$plugin_memory],          [Memory usage])
 +AC_PLUGIN([mic],                 [$with_mic],               [Intel Many Integrated Core stats])
 +AC_PLUGIN([modbus],              [$with_libmodbus],         [Modbus plugin])
 +AC_PLUGIN([mqtt],                [$with_libmosquitto],      [MQTT output plugin])
 +AC_PLUGIN([multimeter],          [$plugin_multimeter],      [Read multimeter values])
 +AC_PLUGIN([mysql],               [$with_libmysql],          [MySQL statistics])
 +AC_PLUGIN([netapp],              [$with_libnetapp],         [NetApp plugin])
 +AC_PLUGIN([netlink],             [$with_libmnl],            [Enhanced Linux network statistics])
 +AC_PLUGIN([network],             [yes],                     [Network communication plugin])
 +AC_PLUGIN([nfs],                 [$plugin_nfs],             [NFS statistics])
 +AC_PLUGIN([nginx],               [$with_libcurl],           [nginx statistics])
 +AC_PLUGIN([notify_desktop],      [$with_libnotify],         [Desktop notifications])
 +AC_PLUGIN([notify_email],        [$with_libesmtp],          [Email notifier])
 +AC_PLUGIN([notify_nagios],       [yes],                     [Nagios notification plugin])
 +AC_PLUGIN([ntpd],                [yes],                     [NTPd statistics])
 +AC_PLUGIN([numa],                [$plugin_numa],            [NUMA virtual memory statistics])
 +AC_PLUGIN([nut],                 [$with_libupsclient],      [Network UPS tools statistics])
 +AC_PLUGIN([olsrd],               [yes],                     [olsrd statistics])
 +AC_PLUGIN([onewire],             [$with_libowcapi],         [OneWire sensor statistics])
 +AC_PLUGIN([openldap],            [$with_libldap],           [OpenLDAP statistics])
 +AC_PLUGIN([openvpn],             [yes],                     [OpenVPN client statistics])
 +AC_PLUGIN([oracle],              [$with_oracle],            [Oracle plugin])
 +AC_PLUGIN([perl],                [$plugin_perl],            [Embed a Perl interpreter])
 +AC_PLUGIN([pf],                  [$have_net_pfvar_h],       [BSD packet filter (PF) statistics])
  # FIXME: Check for libevent, too.
 -AC_PLUGIN([pinba],       [$have_protoc_c],     [Pinba statistics])
 -AC_PLUGIN([ping],        [$with_liboping],     [Network latency statistics])
 -AC_PLUGIN([postgresql],  [$with_libpq],        [PostgreSQL database statistics])
 -AC_PLUGIN([powerdns],    [yes],                [PowerDNS statistics])
 -AC_PLUGIN([processes],   [$plugin_processes],  [Process statistics])
 -AC_PLUGIN([protocols],   [$plugin_protocols],  [Protocol (IP, TCP, ...) statistics])
 -AC_PLUGIN([python],      [$with_python],       [Embed a Python interpreter])
 -AC_PLUGIN([redis],       [$with_libhiredis],    [Redis plugin])
 -AC_PLUGIN([routeros],    [$with_librouteros],  [RouterOS plugin])
 -AC_PLUGIN([rrdcached],   [$librrd_rrdc_update], [RRDTool output plugin])
 -AC_PLUGIN([rrdtool],     [$with_librrd],       [RRDTool output plugin])
 -AC_PLUGIN([sensors],     [$with_libsensors],   [lm_sensors statistics])
 -AC_PLUGIN([serial],      [$plugin_serial],     [serial port traffic])
 -AC_PLUGIN([sigrok],      [$with_libsigrok],    [sigrok acquisition sources])
 -AC_PLUGIN([smart],       [$with_libatasmart],  [SMART statistics])
 -AC_PLUGIN([snmp],        [$with_libnetsnmp],   [SNMP querying plugin])
 -AC_PLUGIN([statsd],      [yes],                [StatsD plugin])
 -AC_PLUGIN([swap],        [$plugin_swap],       [Swap usage statistics])
 -AC_PLUGIN([syslog],      [$have_syslog],       [Syslog logging plugin])
 -AC_PLUGIN([table],       [yes],                [Parsing of tabular data])
 -AC_PLUGIN([tail],        [yes],                [Parsing of logfiles])
 -AC_PLUGIN([tail_csv],    [yes],                [Parsing of CSV files])
 -AC_PLUGIN([tape],        [$plugin_tape],       [Tape drive statistics])
 -AC_PLUGIN([target_notification], [yes],        [The notification target])
 -AC_PLUGIN([target_replace], [yes],             [The replace target])
 -AC_PLUGIN([target_scale],[yes],                [The scale target])
 -AC_PLUGIN([target_set],  [yes],                [The set target])
 -AC_PLUGIN([target_v5upgrade], [yes],           [The v5upgrade 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([threshold],   [yes],                [Threshold checking plugin])
 -AC_PLUGIN([tokyotyrant], [$with_libtokyotyrant],  [TokyoTyrant database statistics])
 -AC_PLUGIN([turbostat],   [$plugin_turbostat],  [Advanced statistic on Intel cpu states])
 -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([varnish],     [$with_libvarnish],   [Varnish cache statistics])
 -AC_PLUGIN([virt],        [$plugin_virt],       [Virtual machine statistics])
 -AC_PLUGIN([vmem],        [$plugin_vmem],       [Virtual memory statistics])
 -AC_PLUGIN([vserver],     [$plugin_vserver],    [Linux VServer statistics])
 -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_log], [yes],                  [Log output plugin])
 -AC_PLUGIN([write_mongodb], [$with_libmongoc],  [MongoDB output plugin])
 -AC_PLUGIN([write_redis], [$with_libhiredis],    [Redis output plugin])
 -AC_PLUGIN([write_riemann], [$have_protoc_c],   [Riemann output plugin])
 -AC_PLUGIN([write_sensu], [yes],                [Sensu 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])
 -AC_PLUGIN([zone],        [$plugin_zone],       [Solaris container statistics])
 -AC_PLUGIN([zookeeper],   [yes],              [Zookeeper statistics])
 +AC_PLUGIN([pinba],               [$plugin_pinba],           [Pinba statistics])
 +AC_PLUGIN([ping],                [$with_liboping],          [Network latency statistics])
 +AC_PLUGIN([postgresql],          [$with_libpq],             [PostgreSQL database statistics])
 +AC_PLUGIN([powerdns],            [yes],                     [PowerDNS statistics])
 +AC_PLUGIN([processes],           [$plugin_processes],       [Process statistics])
 +AC_PLUGIN([protocols],           [$plugin_protocols],       [Protocol (IP, TCP, ...) statistics])
 +AC_PLUGIN([python],              [$plugin_python],          [Embed a Python interpreter])
 +AC_PLUGIN([redis],               [$with_libhiredis],        [Redis plugin])
 +AC_PLUGIN([routeros],            [$with_librouteros],       [RouterOS plugin])
 +AC_PLUGIN([rrdcached],           [$librrd_rrdc_update],     [RRDTool output plugin])
 +AC_PLUGIN([rrdtool],             [$with_librrd],            [RRDTool output plugin])
 +AC_PLUGIN([sensors],             [$with_libsensors],        [lm_sensors statistics])
 +AC_PLUGIN([serial],              [$plugin_serial],          [serial port traffic])
 +AC_PLUGIN([sigrok],              [$with_libsigrok],         [sigrok acquisition sources])
 +AC_PLUGIN([smart],               [$plugin_smart],           [SMART statistics])
 +AC_PLUGIN([snmp],                [$with_libnetsnmp],        [SNMP querying plugin])
 +AC_PLUGIN([statsd],              [yes],                     [StatsD plugin])
 +AC_PLUGIN([swap],                [$plugin_swap],            [Swap usage statistics])
 +AC_PLUGIN([syslog],              [$have_syslog],            [Syslog logging plugin])
 +AC_PLUGIN([table],               [yes],                     [Parsing of tabular data])
 +AC_PLUGIN([tail],                [yes],                     [Parsing of logfiles])
 +AC_PLUGIN([tail_csv],            [yes],                     [Parsing of CSV files])
 +AC_PLUGIN([tape],                [$plugin_tape],            [Tape drive statistics])
 +AC_PLUGIN([target_notification], [yes],                     [The notification target])
 +AC_PLUGIN([target_replace],      [yes],                     [The replace target])
 +AC_PLUGIN([target_scale],        [yes],                     [The scale target])
 +AC_PLUGIN([target_set],          [yes],                     [The set target])
 +AC_PLUGIN([target_v5upgrade],    [yes],                     [The v5upgrade 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([threshold],           [yes],                     [Threshold checking plugin])
 +AC_PLUGIN([tokyotyrant],         [$with_libtokyotyrant],    [TokyoTyrant database statistics])
 +AC_PLUGIN([turbostat],           [$plugin_turbostat],       [Advanced statistic on Intel cpu states])
 +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([varnish],             [$with_libvarnish],        [Varnish cache statistics])
 +AC_PLUGIN([virt],                [$plugin_virt],            [Virtual machine statistics])
 +AC_PLUGIN([vmem],                [$plugin_vmem],            [Virtual memory statistics])
 +AC_PLUGIN([vserver],             [$plugin_vserver],         [Linux VServer statistics])
 +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_log],           [yes],                     [Log output plugin])
 +AC_PLUGIN([write_mongodb],       [$with_libmongoc],         [MongoDB output plugin])
 +AC_PLUGIN([write_redis],         [$with_libhiredis],        [Redis output plugin])
 +AC_PLUGIN([write_riemann],       [$with_libriemann_client], [Riemann output plugin])
 +AC_PLUGIN([write_sensu],         [yes],                     [Sensu output plugin])
 +AC_PLUGIN([write_tsdb],          [yes],                     [TSDB output plugin])
 +AC_PLUGIN([xencpu],              [$plugin_xencpu],          [Xen Host CPU usage])
 +AC_PLUGIN([xmms],                [$with_libxmms],           [XMMS statistics])
 +AC_PLUGIN([zfs_arc],             [$plugin_zfs_arc],         [ZFS ARC statistics])
 +AC_PLUGIN([zone],                [$plugin_zone],            [Solaris container statistics])
 +AC_PLUGIN([zookeeper],           [yes],                     [Zookeeper statistics])
  
  dnl Default configuration file
  # Load either syslog or logfile
@@@ -6280,16 -5982,13 +6337,16 @@@ AC_SUBST(LCC_VERSION_STRING
  AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
  
  AM_CFLAGS="-Wall"
 +AM_CXXFLAGS="-Wall"
  if test "x$enable_werror" != "xno"
  then
          AM_CFLAGS="$AM_CFLAGS -Werror"
 +        AM_CXXFLAGS="$AM_CXXFLAGS -Werror"
  fi
  AC_SUBST([AM_CFLAGS])
 +AC_SUBST([AM_CXXFLAGS])
  
 -AC_CONFIG_FILES([Makefile src/Makefile src/daemon/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile])
 +AC_CONFIG_FILES([Makefile proto/Makefile src/Makefile src/daemon/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile])
  AC_OUTPUT
  
  if test "x$with_librrd" = "xyes" \
        with_perl_bindings="yes ($PERL_BINDINGS_OPTIONS)"
  fi
  
 -cat <<EOF;
 -
 -Configuration:
 -  Build:
 -    Platform  . . . . . . $ac_system
 -    CC  . . . . . . . . . $CC
 -    CFLAGS  . . . . . . . $AM_CFLAGS $CFLAGS
 -    CPP . . . . . . . . . $CPP
 -    CPPFLAGS  . . . . . . $CPPFLAGS
 -    LD  . . . . . . . . . $LD
 -    LDFLAGS . . . . . . . $LDFLAGS
 -    YACC  . . . . . . . . $YACC
 -    YFLAGS  . . . . . . . $YFLAGS
 -
 -  Libraries:
 -    intel mic . . . . . . $with_mic
 -    libaquaero5 . . . . . $with_libaquaero5
 -    libatasmart . . . . . $with_libatasmart
 -    libcurl . . . . . . . $with_libcurl
 -    libdbi  . . . . . . . $with_libdbi
 -    libesmtp  . . . . . . $with_libesmtp
 -    libganglia  . . . . . $with_libganglia
 -    libgcrypt . . . . . . $with_libgcrypt
 -    libgps  . . . . . . . $with_libgps
 -    libhal  . . . . . . . $with_libhal
 -    libhiredis  . . . . . $with_libhiredis
 -    libi2c-dev  . . . . . $with_libi2c
 -    libiokit  . . . . . . $with_libiokit
 -    libiptc . . . . . . . $with_libiptc
 -    libjvm  . . . . . . . $with_java
 -    libkstat  . . . . . . $with_kstat
 -    libkvm  . . . . . . . $with_libkvm
 -    libldap . . . . . . . $with_libldap
 -    liblvm2app  . . . . . $with_liblvm2app
 -    libmemcached  . . . . $with_libmemcached
 -    libmnl  . . . . . . . $with_libmnl
 -    libmodbus . . . . . . $with_libmodbus
 -    libmongoc . . . . . . $with_libmongoc
 -    libmosquitto  . . . . $with_libmosquitto
 -    libmysql  . . . . . . $with_libmysql
 -    libnetapp . . . . . . $with_libnetapp
 -    libnetsnmp  . . . . . $with_libnetsnmp
 -    libnotify . . . . . . $with_libnotify
 -    liboconfig  . . . . . $with_liboconfig
 -    libopenipmi . . . . . $with_libopenipmipthread
 -    liboping  . . . . . . $with_liboping
 -    libowcapi . . . . . . $with_libowcapi
 -    libpcap . . . . . . . $with_libpcap
 -    libperfstat . . . . . $with_perfstat
 -    libperl . . . . . . . $with_libperl
 -    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
 -    libxml2 . . . . . . . $with_libxml2
 -    libxmms . . . . . . . $with_libxmms
 -    libyajl . . . . . . . $with_libyajl
 -    oracle  . . . . . . . $with_oracle
 -    protobuf-c  . . . . . $have_protoc_c
 -    python  . . . . . . . $with_python
 -
 -  Features:
 -    daemon mode . . . . . $enable_daemon
 -    debug . . . . . . . . $enable_debug
 -
 -  Bindings:
 -    perl  . . . . . . . . $with_perl_bindings
 -
 -  Modules:
 -    aggregation . . . . . $enable_aggregation
 -    amqp    . . . . . . . $enable_amqp
 -    apache  . . . . . . . $enable_apache
 -    apcups  . . . . . . . $enable_apcups
 -    apple_sensors . . . . $enable_apple_sensors
 -    aquaero . . . . . . . $enable_aquaero
 -    ascent  . . . . . . . $enable_ascent
 -    barometer . . . . . . $enable_barometer
 -    battery . . . . . . . $enable_battery
 -    bind  . . . . . . . . $enable_bind
 -    ceph  . . . . . . . . $enable_ceph
 -    cgroups . . . . . . . $enable_cgroups
 -    conntrack . . . . . . $enable_conntrack
 -    contextswitch . . . . $enable_contextswitch
 -    cpu . . . . . . . . . $enable_cpu
 -    cpufreq . . . . . . . $enable_cpufreq
 -    csv . . . . . . . . . $enable_csv
 -    curl  . . . . . . . . $enable_curl
 -    curl_json . . . . . . $enable_curl_json
 -    curl_xml  . . . . . . $enable_curl_xml
 -    dbi . . . . . . . . . $enable_dbi
 -    df  . . . . . . . . . $enable_df
 -    disk  . . . . . . . . $enable_disk
 -    dns . . . . . . . . . $enable_dns
 -    drbd  . . . . . . . . $enable_drbd
 -    email . . . . . . . . $enable_email
 -    entropy . . . . . . . $enable_entropy
 -    ethstat . . . . . . . $enable_ethstat
 -    exec  . . . . . . . . $enable_exec
 -    fhcount . . . . . . . $enable_fhcount
 -    filecount . . . . . . $enable_filecount
 -    fscache . . . . . . . $enable_fscache
 -    gmond . . . . . . . . $enable_gmond
 -    gps . . . . . . . . . $enable_gps
 -    hddtemp . . . . . . . $enable_hddtemp
 -    interface . . . . . . $enable_interface
 -    ipc . . . . . . . . . $enable_ipc
 -    ipmi  . . . . . . . . $enable_ipmi
 -    iptables  . . . . . . $enable_iptables
 -    ipvs  . . . . . . . . $enable_ipvs
 -    irq . . . . . . . . . $enable_irq
 -    java  . . . . . . . . $enable_java
 -    load  . . . . . . . . $enable_load
 -    logfile . . . . . . . $enable_logfile
 -    log_logstash  . . . . $enable_log_logstash
 -    lpar  . . . . . . . . $enable_lpar
 -    lvm . . . . . . . . . $enable_lvm
 -    madwifi . . . . . . . $enable_madwifi
 -    match_empty_counter . $enable_match_empty_counter
 -    match_hashed  . . . . $enable_match_hashed
 -    match_regex . . . . . $enable_match_regex
 -    match_timediff  . . . $enable_match_timediff
 -    match_value . . . . . $enable_match_value
 -    mbmon . . . . . . . . $enable_mbmon
 -    md  . . . . . . . . . $enable_md
 -    memcachec . . . . . . $enable_memcachec
 -    memcached . . . . . . $enable_memcached
 -    memory  . . . . . . . $enable_memory
 -    mic . . . . . . . . . $enable_mic
 -    modbus  . . . . . . . $enable_modbus
 -    mqtt  . . . . . . . . $enable_mqtt
 -    multimeter  . . . . . $enable_multimeter
 -    mysql . . . . . . . . $enable_mysql
 -    netapp  . . . . . . . $enable_netapp
 -    netlink . . . . . . . $enable_netlink
 -    network . . . . . . . $enable_network
 -    nfs . . . . . . . . . $enable_nfs
 -    nginx . . . . . . . . $enable_nginx
 -    notify_desktop  . . . $enable_notify_desktop
 -    notify_email  . . . . $enable_notify_email
 -    ntpd  . . . . . . . . $enable_ntpd
 -    numa  . . . . . . . . $enable_numa
 -    nut . . . . . . . . . $enable_nut
 -    olsrd . . . . . . . . $enable_olsrd
 -    onewire . . . . . . . $enable_onewire
 -    openldap  . . . . . . $enable_openldap
 -    openvpn . . . . . . . $enable_openvpn
 -    oracle  . . . . . . . $enable_oracle
 -    perl  . . . . . . . . $enable_perl
 -    pf  . . . . . . . . . $enable_pf
 -    pinba . . . . . . . . $enable_pinba
 -    ping  . . . . . . . . $enable_ping
 -    postgresql  . . . . . $enable_postgresql
 -    powerdns  . . . . . . $enable_powerdns
 -    processes . . . . . . $enable_processes
 -    protocols . . . . . . $enable_protocols
 -    python  . . . . . . . $enable_python
 -    redis . . . . . . . . $enable_redis
 -    routeros  . . . . . . $enable_routeros
 -    rrdcached . . . . . . $enable_rrdcached
 -    rrdtool . . . . . . . $enable_rrdtool
 -    sensors . . . . . . . $enable_sensors
 -    serial  . . . . . . . $enable_serial
 -    sigrok  . . . . . . . $enable_sigrok
 -    smart . . . . . . . . $enable_smart
 -    snmp  . . . . . . . . $enable_snmp
 -    statsd  . . . . . . . $enable_statsd
 -    swap  . . . . . . . . $enable_swap
 -    syslog  . . . . . . . $enable_syslog
 -    table . . . . . . . . $enable_table
 -    tail_csv  . . . . . . $enable_tail_csv
 -    tail  . . . . . . . . $enable_tail
 -    tape  . . . . . . . . $enable_tape
 -    target_notification . $enable_target_notification
 -    target_replace  . . . $enable_target_replace
 -    target_scale  . . . . $enable_target_scale
 -    target_set  . . . . . $enable_target_set
 -    target_v5upgrade  . . $enable_target_v5upgrade
 -    tcpconns  . . . . . . $enable_tcpconns
 -    teamspeak2  . . . . . $enable_teamspeak2
 -    ted . . . . . . . . . $enable_ted
 -    thermal . . . . . . . $enable_thermal
 -    threshold . . . . . . $enable_threshold
 -    tokyotyrant . . . . . $enable_tokyotyrant
 -    turbostat . . . . . . $enable_turbostat
 -    unixsock  . . . . . . $enable_unixsock
 -    uptime  . . . . . . . $enable_uptime
 -    users . . . . . . . . $enable_users
 -    uuid  . . . . . . . . $enable_uuid
 -    varnish . . . . . . . $enable_varnish
 -    virt  . . . . . . . . $enable_virt
 -    vmem  . . . . . . . . $enable_vmem
 -    vserver . . . . . . . $enable_vserver
 -    wireless  . . . . . . $enable_wireless
 -    write_graphite  . . . $enable_write_graphite
 -    write_http  . . . . . $enable_write_http
 -    write_kafka . . . . . $enable_write_kafka
 -    write_log . . . . . . $enable_write_log
 -    write_mongodb . . . . $enable_write_mongodb
 -    write_redis . . . . . $enable_write_redis
 -    write_riemann . . . . $enable_write_riemann
 -    write_sensu . . . . . $enable_write_sensu
 -    write_tsdb  . . . . . $enable_write_tsdb
 -    xmms  . . . . . . . . $enable_xmms
 -    zfs_arc . . . . . . . $enable_zfs_arc
 -    zone  . . . . . . . . $enable_zone
 -    zookeeper . . . . . . $enable_zookeeper
 -
 -EOF
 +AC_MSG_RESULT()
 +AC_MSG_RESULT([Configuration:])
 +AC_MSG_RESULT([  Build:])
 +AC_MSG_RESULT([    Platform  . . . . . . $ac_system])
 +AC_MSG_RESULT([    CC  . . . . . . . . . $CC])
 +AC_MSG_RESULT([    CFLAGS  . . . . . . . $AM_CFLAGS $CFLAGS])
 +AC_MSG_RESULT([    CXXFLAGS  . . . . . . $AM_CXXFLAGS $CXXFLAGS])
 +AC_MSG_RESULT([    CPP . . . . . . . . . $CPP])
 +AC_MSG_RESULT([    CPPFLAGS  . . . . . . $CPPFLAGS])
 +AC_MSG_RESULT([    GRPC_CPP_PLUGIN . . . $GRPC_CPP_PLUGIN])
 +AC_MSG_RESULT([    LD  . . . . . . . . . $LD])
 +AC_MSG_RESULT([    LDFLAGS . . . . . . . $LDFLAGS])
 +AC_MSG_RESULT([    PROTOC  . . . . . . . $PROTOC])
 +AC_MSG_RESULT([    YACC  . . . . . . . . $YACC])
 +AC_MSG_RESULT([    YFLAGS  . . . . . . . $YFLAGS])
 +AC_MSG_RESULT()
 +AC_MSG_RESULT([  Libraries:])
 +AC_MSG_RESULT([    intel mic . . . . . . $with_mic])
 +AC_MSG_RESULT([    libaquaero5 . . . . . $with_libaquaero5])
 +AC_MSG_RESULT([    libatasmart . . . . . $with_libatasmart])
 +AC_MSG_RESULT([    libcurl . . . . . . . $with_libcurl])
 +AC_MSG_RESULT([    libdbi  . . . . . . . $with_libdbi])
 +AC_MSG_RESULT([    libesmtp  . . . . . . $with_libesmtp])
 +AC_MSG_RESULT([    libganglia  . . . . . $with_libganglia])
 +AC_MSG_RESULT([    libgcrypt . . . . . . $with_libgcrypt])
++AC_MSG_RESULT([    libgps  . . . . . . . $with_libgps])
 +AC_MSG_RESULT([    libgrpc++ . . . . . . $with_libgrpcpp])
 +AC_MSG_RESULT([    libhal  . . . . . . . $with_libhal])
 +AC_MSG_RESULT([    libhiredis  . . . . . $with_libhiredis])
 +AC_MSG_RESULT([    libi2c-dev  . . . . . $with_libi2c])
 +AC_MSG_RESULT([    libiokit  . . . . . . $with_libiokit])
 +AC_MSG_RESULT([    libiptc . . . . . . . $with_libiptc])
 +AC_MSG_RESULT([    libjvm  . . . . . . . $with_java])
 +AC_MSG_RESULT([    libkstat  . . . . . . $with_kstat])
 +AC_MSG_RESULT([    libkvm  . . . . . . . $with_libkvm])
 +AC_MSG_RESULT([    libldap . . . . . . . $with_libldap])
 +AC_MSG_RESULT([    liblvm2app  . . . . . $with_liblvm2app])
 +AC_MSG_RESULT([    libmemcached  . . . . $with_libmemcached])
 +AC_MSG_RESULT([    libmnl  . . . . . . . $with_libmnl])
 +AC_MSG_RESULT([    libmodbus . . . . . . $with_libmodbus])
 +AC_MSG_RESULT([    libmongoc . . . . . . $with_libmongoc])
 +AC_MSG_RESULT([    libmosquitto  . . . . $with_libmosquitto])
 +AC_MSG_RESULT([    libmysql  . . . . . . $with_libmysql])
 +AC_MSG_RESULT([    libnetapp . . . . . . $with_libnetapp])
 +AC_MSG_RESULT([    libnetsnmp  . . . . . $with_libnetsnmp])
 +AC_MSG_RESULT([    libnotify . . . . . . $with_libnotify])
 +AC_MSG_RESULT([    liboconfig  . . . . . $with_liboconfig])
 +AC_MSG_RESULT([    libopenipmi . . . . . $with_libopenipmipthread])
 +AC_MSG_RESULT([    liboping  . . . . . . $with_liboping])
 +AC_MSG_RESULT([    libowcapi . . . . . . $with_libowcapi])
 +AC_MSG_RESULT([    libpcap . . . . . . . $with_libpcap])
 +AC_MSG_RESULT([    libperfstat . . . . . $with_perfstat])
 +AC_MSG_RESULT([    libperl . . . . . . . $with_libperl])
 +AC_MSG_RESULT([    libpq . . . . . . . . $with_libpq])
 +AC_MSG_RESULT([    libprotobuf . . . . . $with_libprotobuf])
 +AC_MSG_RESULT([    libprotobuf-c . . . . $with_libprotobuf_c])
 +AC_MSG_RESULT([    libpython . . . . . . $with_libpython])
 +AC_MSG_RESULT([    librabbitmq . . . . . $with_librabbitmq])
 +AC_MSG_RESULT([    libriemann-client . . $with_libriemann_client])
 +AC_MSG_RESULT([    librdkafka  . . . . . $with_librdkafka])
 +AC_MSG_RESULT([    librouteros . . . . . $with_librouteros])
 +AC_MSG_RESULT([    librrd  . . . . . . . $with_librrd])
 +AC_MSG_RESULT([    libsensors  . . . . . $with_libsensors])
 +AC_MSG_RESULT([    libsigrok   . . . . . $with_libsigrok])
 +AC_MSG_RESULT([    libstatgrab . . . . . $with_libstatgrab])
 +AC_MSG_RESULT([    libtokyotyrant  . . . $with_libtokyotyrant])
 +AC_MSG_RESULT([    libudev . . . . . . . $with_libudev])
 +AC_MSG_RESULT([    libupsclient  . . . . $with_libupsclient])
 +AC_MSG_RESULT([    libvarnish  . . . . . $with_libvarnish])
 +AC_MSG_RESULT([    libvirt . . . . . . . $with_libvirt])
 +AC_MSG_RESULT([    libxenctrl  . . . . . $with_libxenctrl])
 +AC_MSG_RESULT([    libxml2 . . . . . . . $with_libxml2])
 +AC_MSG_RESULT([    libxmms . . . . . . . $with_libxmms])
 +AC_MSG_RESULT([    libyajl . . . . . . . $with_libyajl])
 +AC_MSG_RESULT([    oracle  . . . . . . . $with_oracle])
 +AC_MSG_RESULT([    protobuf-c  . . . . . $have_protoc_c])
 +AC_MSG_RESULT([    protoc 3  . . . . . . $have_protoc3])
 +AC_MSG_RESULT()
 +AC_MSG_RESULT([  Features:])
 +AC_MSG_RESULT([    daemon mode . . . . . $enable_daemon])
 +AC_MSG_RESULT([    debug . . . . . . . . $enable_debug])
 +AC_MSG_RESULT()
 +AC_MSG_RESULT([  Bindings:])
 +AC_MSG_RESULT([    perl  . . . . . . . . $with_perl_bindings])
 +AC_MSG_RESULT()
 +AC_MSG_RESULT([  Modules:])
 +AC_MSG_RESULT([    aggregation . . . . . $enable_aggregation])
 +AC_MSG_RESULT([    amqp    . . . . . . . $enable_amqp])
 +AC_MSG_RESULT([    apache  . . . . . . . $enable_apache])
 +AC_MSG_RESULT([    apcups  . . . . . . . $enable_apcups])
 +AC_MSG_RESULT([    apple_sensors . . . . $enable_apple_sensors])
 +AC_MSG_RESULT([    aquaero . . . . . . . $enable_aquaero])
 +AC_MSG_RESULT([    ascent  . . . . . . . $enable_ascent])
 +AC_MSG_RESULT([    barometer . . . . . . $enable_barometer])
 +AC_MSG_RESULT([    battery . . . . . . . $enable_battery])
 +AC_MSG_RESULT([    bind  . . . . . . . . $enable_bind])
 +AC_MSG_RESULT([    ceph  . . . . . . . . $enable_ceph])
 +AC_MSG_RESULT([    cgroups . . . . . . . $enable_cgroups])
 +AC_MSG_RESULT([    chrony. . . . . . . . $enable_chrony])
 +AC_MSG_RESULT([    conntrack . . . . . . $enable_conntrack])
 +AC_MSG_RESULT([    contextswitch . . . . $enable_contextswitch])
 +AC_MSG_RESULT([    cpu . . . . . . . . . $enable_cpu])
 +AC_MSG_RESULT([    cpufreq . . . . . . . $enable_cpufreq])
 +AC_MSG_RESULT([    cpusleep  . . . . . . $enable_cpusleep])
 +AC_MSG_RESULT([    csv . . . . . . . . . $enable_csv])
 +AC_MSG_RESULT([    curl  . . . . . . . . $enable_curl])
 +AC_MSG_RESULT([    curl_json . . . . . . $enable_curl_json])
 +AC_MSG_RESULT([    curl_xml  . . . . . . $enable_curl_xml])
 +AC_MSG_RESULT([    dbi . . . . . . . . . $enable_dbi])
 +AC_MSG_RESULT([    df  . . . . . . . . . $enable_df])
 +AC_MSG_RESULT([    disk  . . . . . . . . $enable_disk])
 +AC_MSG_RESULT([    dns . . . . . . . . . $enable_dns])
 +AC_MSG_RESULT([    drbd  . . . . . . . . $enable_drbd])
 +AC_MSG_RESULT([    email . . . . . . . . $enable_email])
 +AC_MSG_RESULT([    entropy . . . . . . . $enable_entropy])
 +AC_MSG_RESULT([    ethstat . . . . . . . $enable_ethstat])
 +AC_MSG_RESULT([    exec  . . . . . . . . $enable_exec])
 +AC_MSG_RESULT([    fhcount . . . . . . . $enable_fhcount])
 +AC_MSG_RESULT([    filecount . . . . . . $enable_filecount])
 +AC_MSG_RESULT([    fscache . . . . . . . $enable_fscache])
 +AC_MSG_RESULT([    gmond . . . . . . . . $enable_gmond])
++AC_MSG_RESULT([    gps . . . . . . . . . $enable_gps])
 +AC_MSG_RESULT([    grpc  . . . . . . . . $enable_grpc])
 +AC_MSG_RESULT([    hddtemp . . . . . . . $enable_hddtemp])
 +AC_MSG_RESULT([    interface . . . . . . $enable_interface])
 +AC_MSG_RESULT([    ipc . . . . . . . . . $enable_ipc])
 +AC_MSG_RESULT([    ipmi  . . . . . . . . $enable_ipmi])
 +AC_MSG_RESULT([    iptables  . . . . . . $enable_iptables])
 +AC_MSG_RESULT([    ipvs  . . . . . . . . $enable_ipvs])
 +AC_MSG_RESULT([    irq . . . . . . . . . $enable_irq])
 +AC_MSG_RESULT([    java  . . . . . . . . $enable_java])
 +AC_MSG_RESULT([    load  . . . . . . . . $enable_load])
 +AC_MSG_RESULT([    logfile . . . . . . . $enable_logfile])
 +AC_MSG_RESULT([    log_logstash  . . . . $enable_log_logstash])
 +AC_MSG_RESULT([    lpar  . . . . . . . . $enable_lpar])
 +AC_MSG_RESULT([    lvm . . . . . . . . . $enable_lvm])
 +AC_MSG_RESULT([    madwifi . . . . . . . $enable_madwifi])
 +AC_MSG_RESULT([    match_empty_counter . $enable_match_empty_counter])
 +AC_MSG_RESULT([    match_hashed  . . . . $enable_match_hashed])
 +AC_MSG_RESULT([    match_regex . . . . . $enable_match_regex])
 +AC_MSG_RESULT([    match_timediff  . . . $enable_match_timediff])
 +AC_MSG_RESULT([    match_value . . . . . $enable_match_value])
 +AC_MSG_RESULT([    mbmon . . . . . . . . $enable_mbmon])
 +AC_MSG_RESULT([    md  . . . . . . . . . $enable_md])
 +AC_MSG_RESULT([    memcachec . . . . . . $enable_memcachec])
 +AC_MSG_RESULT([    memcached . . . . . . $enable_memcached])
 +AC_MSG_RESULT([    memory  . . . . . . . $enable_memory])
 +AC_MSG_RESULT([    mic . . . . . . . . . $enable_mic])
 +AC_MSG_RESULT([    modbus  . . . . . . . $enable_modbus])
 +AC_MSG_RESULT([    mqtt  . . . . . . . . $enable_mqtt])
 +AC_MSG_RESULT([    multimeter  . . . . . $enable_multimeter])
 +AC_MSG_RESULT([    mysql . . . . . . . . $enable_mysql])
 +AC_MSG_RESULT([    netapp  . . . . . . . $enable_netapp])
 +AC_MSG_RESULT([    netlink . . . . . . . $enable_netlink])
 +AC_MSG_RESULT([    network . . . . . . . $enable_network])
 +AC_MSG_RESULT([    nfs . . . . . . . . . $enable_nfs])
 +AC_MSG_RESULT([    nginx . . . . . . . . $enable_nginx])
 +AC_MSG_RESULT([    notify_desktop  . . . $enable_notify_desktop])
 +AC_MSG_RESULT([    notify_email  . . . . $enable_notify_email])
 +AC_MSG_RESULT([    notify_nagios . . . . $enable_notify_nagios])
 +AC_MSG_RESULT([    ntpd  . . . . . . . . $enable_ntpd])
 +AC_MSG_RESULT([    numa  . . . . . . . . $enable_numa])
 +AC_MSG_RESULT([    nut . . . . . . . . . $enable_nut])
 +AC_MSG_RESULT([    olsrd . . . . . . . . $enable_olsrd])
 +AC_MSG_RESULT([    onewire . . . . . . . $enable_onewire])
 +AC_MSG_RESULT([    openldap  . . . . . . $enable_openldap])
 +AC_MSG_RESULT([    openvpn . . . . . . . $enable_openvpn])
 +AC_MSG_RESULT([    oracle  . . . . . . . $enable_oracle])
 +AC_MSG_RESULT([    perl  . . . . . . . . $enable_perl])
 +AC_MSG_RESULT([    pf  . . . . . . . . . $enable_pf])
 +AC_MSG_RESULT([    pinba . . . . . . . . $enable_pinba])
 +AC_MSG_RESULT([    ping  . . . . . . . . $enable_ping])
 +AC_MSG_RESULT([    postgresql  . . . . . $enable_postgresql])
 +AC_MSG_RESULT([    powerdns  . . . . . . $enable_powerdns])
 +AC_MSG_RESULT([    processes . . . . . . $enable_processes])
 +AC_MSG_RESULT([    protocols . . . . . . $enable_protocols])
 +AC_MSG_RESULT([    python  . . . . . . . $enable_python])
 +AC_MSG_RESULT([    redis . . . . . . . . $enable_redis])
 +AC_MSG_RESULT([    routeros  . . . . . . $enable_routeros])
 +AC_MSG_RESULT([    rrdcached . . . . . . $enable_rrdcached])
 +AC_MSG_RESULT([    rrdtool . . . . . . . $enable_rrdtool])
 +AC_MSG_RESULT([    sensors . . . . . . . $enable_sensors])
 +AC_MSG_RESULT([    serial  . . . . . . . $enable_serial])
 +AC_MSG_RESULT([    sigrok  . . . . . . . $enable_sigrok])
 +AC_MSG_RESULT([    smart . . . . . . . . $enable_smart])
 +AC_MSG_RESULT([    snmp  . . . . . . . . $enable_snmp])
 +AC_MSG_RESULT([    statsd  . . . . . . . $enable_statsd])
 +AC_MSG_RESULT([    swap  . . . . . . . . $enable_swap])
 +AC_MSG_RESULT([    syslog  . . . . . . . $enable_syslog])
 +AC_MSG_RESULT([    table . . . . . . . . $enable_table])
 +AC_MSG_RESULT([    tail_csv  . . . . . . $enable_tail_csv])
 +AC_MSG_RESULT([    tail  . . . . . . . . $enable_tail])
 +AC_MSG_RESULT([    tape  . . . . . . . . $enable_tape])
 +AC_MSG_RESULT([    target_notification . $enable_target_notification])
 +AC_MSG_RESULT([    target_replace  . . . $enable_target_replace])
 +AC_MSG_RESULT([    target_scale  . . . . $enable_target_scale])
 +AC_MSG_RESULT([    target_set  . . . . . $enable_target_set])
 +AC_MSG_RESULT([    target_v5upgrade  . . $enable_target_v5upgrade])
 +AC_MSG_RESULT([    tcpconns  . . . . . . $enable_tcpconns])
 +AC_MSG_RESULT([    teamspeak2  . . . . . $enable_teamspeak2])
 +AC_MSG_RESULT([    ted . . . . . . . . . $enable_ted])
 +AC_MSG_RESULT([    thermal . . . . . . . $enable_thermal])
 +AC_MSG_RESULT([    threshold . . . . . . $enable_threshold])
 +AC_MSG_RESULT([    tokyotyrant . . . . . $enable_tokyotyrant])
 +AC_MSG_RESULT([    turbostat . . . . . . $enable_turbostat])
 +AC_MSG_RESULT([    unixsock  . . . . . . $enable_unixsock])
 +AC_MSG_RESULT([    uptime  . . . . . . . $enable_uptime])
 +AC_MSG_RESULT([    users . . . . . . . . $enable_users])
 +AC_MSG_RESULT([    uuid  . . . . . . . . $enable_uuid])
 +AC_MSG_RESULT([    varnish . . . . . . . $enable_varnish])
 +AC_MSG_RESULT([    virt  . . . . . . . . $enable_virt])
 +AC_MSG_RESULT([    vmem  . . . . . . . . $enable_vmem])
 +AC_MSG_RESULT([    vserver . . . . . . . $enable_vserver])
 +AC_MSG_RESULT([    wireless  . . . . . . $enable_wireless])
 +AC_MSG_RESULT([    write_graphite  . . . $enable_write_graphite])
 +AC_MSG_RESULT([    write_http  . . . . . $enable_write_http])
 +AC_MSG_RESULT([    write_kafka . . . . . $enable_write_kafka])
 +AC_MSG_RESULT([    write_log . . . . . . $enable_write_log])
 +AC_MSG_RESULT([    write_mongodb . . . . $enable_write_mongodb])
 +AC_MSG_RESULT([    write_redis . . . . . $enable_write_redis])
 +AC_MSG_RESULT([    write_riemann . . . . $enable_write_riemann])
 +AC_MSG_RESULT([    write_sensu . . . . . $enable_write_sensu])
 +AC_MSG_RESULT([    write_tsdb  . . . . . $enable_write_tsdb])
 +AC_MSG_RESULT([    xencpu  . . . . . . . $enable_xencpu])
 +AC_MSG_RESULT([    xmms  . . . . . . . . $enable_xmms])
 +AC_MSG_RESULT([    zfs_arc . . . . . . . $enable_zfs_arc])
 +AC_MSG_RESULT([    zone  . . . . . . . . $enable_zone])
 +AC_MSG_RESULT([    zookeeper . . . . . . $enable_zookeeper])
 +AC_MSG_RESULT()
  
  if test "x$dependency_error" = "xyes"; then
        AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
diff --combined src/Makefile.am
@@@ -17,37 -17,18 +17,37 @@@ endi
  AM_CPPFLAGS += -DPLUGINDIR='"${pkglibdir}"'
  AM_CPPFLAGS += -DPKGDATADIR='"${pkgdatadir}"'
  
 -AUTOMAKE_OPTIONS = subdir-objects
 +LOG_COMPILER = env VALGRIND="@VALGRIND@" $(abs_top_srcdir)/testwrapper.sh
 +
 +V_PROTOC = $(v_protoc_@AM_V@)
 +v_protoc_ = $(v_protoc_@AM_DEFAULT_V@)
 +v_protoc_0 = @echo "  PROTOC  " $@;
  
  noinst_LTLIBRARIES =
  check_PROGRAMS =
  TESTS =
  
 +noinst_LTLIBRARIES += libformat_json.la
 +libformat_json_la_SOURCES   = utils_format_json.c utils_format_json.h
 +libformat_json_la_CPPFLAGS  = $(AM_CPPFLAGS)
 +libformat_json_la_LDFLAGS   = $(AM_LDFLAGS)
 +libformat_json_la_LIBADD    =
 +if BUILD_WITH_LIBYAJL
 +libformat_json_la_CPPFLAGS += $(BUILD_WITH_LIBYAJL_CPPFLAGS)
 +libformat_json_la_LDFLAGS  += $(BUILD_WITH_LIBYAJL_LDFLAGS)
 +libformat_json_la_LIBADD   += $(BUILD_WITH_LIBYAJL_LIBS)
 +check_PROGRAMS += test_format_json
 +TESTS += test_format_json
 +test_format_json_SOURCES = utils_format_json_test.c testing.h
 +test_format_json_LDADD = libformat_json.la daemon/libmetadata.la daemon/libplugin_mock.la -lm
 +endif
 +
  noinst_LTLIBRARIES += liblatency.la
  liblatency_la_SOURCES = utils_latency.c utils_latency.h
  check_PROGRAMS += test_utils_latency
  TESTS += test_utils_latency
  test_utils_latency_SOURCES = utils_latency_test.c testing.h
 -test_utils_latency_LDADD = liblatency.la daemon/libcommon.la daemon/libplugin_mock.la -lm
 +test_utils_latency_LDADD = liblatency.la daemon/libplugin_mock.la -lm
  
  noinst_LTLIBRARIES += liblookup.la
  liblookup_la_SOURCES = utils_vl_lookup.c utils_vl_lookup.h
@@@ -55,7 -36,7 +55,7 @@@ liblookup_la_LIBADD = daemon/libavltree
  check_PROGRAMS += test_utils_vl_lookup
  TESTS += test_utils_vl_lookup
  test_utils_vl_lookup_SOURCES = utils_vl_lookup_test.c testing.h
 -test_utils_vl_lookup_LDADD = liblookup.la daemon/libcommon.la daemon/libplugin_mock.la
 +test_utils_vl_lookup_LDADD = liblookup.la daemon/libplugin_mock.la
  if BUILD_WITH_LIBKSTAT
  test_utils_vl_lookup_LDADD += -lkstat
  endif
@@@ -65,7 -46,7 +65,7 @@@ libmount_la_SOURCES = utils_mount.c uti
  check_PROGRAMS += test_utils_mount
  TESTS += test_utils_mount
  test_utils_mount_SOURCES = utils_mount_test.c testing.h
 -test_utils_mount_LDADD = libmount.la daemon/libcommon.la daemon/libplugin_mock.la
 +test_utils_mount_LDADD = libmount.la daemon/libplugin_mock.la
  if BUILD_WITH_LIBKSTAT
  test_utils_mount_LDADD += -lkstat
  endif
@@@ -74,12 -55,11 +74,12 @@@ sbin_PROGRAMS = collectdmo
  bin_PROGRAMS = collectd-nagios collectdctl collectd-tg
  
  collectdmon_SOURCES = collectdmon.c
 -collectdmon_CPPFLAGS = $(AM_CPPFLAGS)
  
  collectd_nagios_SOURCES = collectd-nagios.c
 -collectd_nagios_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/libcollectdclient/collectd -I$(top_builddir)/src/libcollectdclient/collectd
 -collectd_nagios_LDADD =
 +collectd_nagios_CPPFLAGS = $(AM_CPPFLAGS) \
 +      -I$(top_srcdir)/src/libcollectdclient/collectd \
 +      -I$(top_builddir)/src/libcollectdclient/collectd
 +collectd_nagios_LDADD = libcollectdclient/libcollectdclient.la
  if BUILD_WITH_LIBSOCKET
  collectd_nagios_LDADD += -lsocket
  endif
@@@ -87,28 -67,26 +87,28 @@@ if BUILD_AI
  collectd_nagios_LDADD += -lm
  endif
  
 -collectd_nagios_LDADD += libcollectdclient/libcollectdclient.la
 -collectd_nagios_DEPENDENCIES = libcollectdclient/libcollectdclient.la
 -
  
  collectdctl_SOURCES = collectdctl.c
 -collectdctl_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/libcollectdclient/collectd -I$(top_builddir)/src/libcollectdclient/collectd
 -collectdctl_LDADD =
 +collectdctl_CPPFLAGS = $(AM_CPPFLAGS) \
 +      -I$(top_srcdir)/src/libcollectdclient/collectd \
 +      -I$(top_builddir)/src/libcollectdclient/collectd
 +collectdctl_LDADD = libcollectdclient/libcollectdclient.la
  if BUILD_WITH_LIBSOCKET
  collectdctl_LDADD += -lsocket
  endif
  if BUILD_AIX
  collectdctl_LDADD += -lm
  endif
 -collectdctl_LDADD += libcollectdclient/libcollectdclient.la
 -collectdctl_DEPENDENCIES = libcollectdclient/libcollectdclient.la
 +
  
  collectd_tg_SOURCES = collectd-tg.c
  collectd_tg_CPPFLAGS = $(AM_CPPFLAGS) \
 -                     -I$(top_srcdir)/src/libcollectdclient/collectd -I$(top_builddir)/src/libcollectdclient/collectd
 -collectd_tg_LDADD = daemon/libheap.la
 +      -I$(top_srcdir)/src/libcollectdclient/collectd \
 +      -I$(top_builddir)/src/libcollectdclient/collectd
 +collectd_tg_LDADD = \
 +      $(PTHREAD_LIBS) \
 +      daemon/libheap.la \
 +      libcollectdclient/libcollectdclient.la
  if BUILD_WITH_LIBSOCKET
  collectd_tg_LDADD += -lsocket
  endif
@@@ -118,6 -96,11 +118,6 @@@ endi
  if BUILD_AIX
  collectd_tg_LDADD += -lm
  endif
 -if BUILD_WITH_LIBPTHREAD
 -collectd_tg_LDADD += -lpthread
 -endif
 -collectd_tg_LDADD += libcollectdclient/libcollectdclient.la
 -collectd_tg_DEPENDENCIES = libcollectdclient/libcollectdclient.la
  
  
  pkglib_LTLIBRARIES =
  BUILT_SOURCES =
  CLEANFILES =
  
 +if HAVE_PROTOC3
 +if HAVE_GRPC_CPP
 +BUILT_SOURCES += collectd.grpc.pb.cc collectd.pb.cc types.pb.cc
 +CLEANFILES += collectd.grpc.pb.cc collectd.pb.cc types.pb.cc \
 +              collectd.grpc.pb.h collectd.pb.h types.pb.h
 +
 +collectd.grpc.pb.cc: $(top_srcdir)/proto/collectd.proto $(top_srcdir)/proto/types.proto
 +      $(V_PROTOC)@PROTOC@ -I$(top_srcdir)/proto \
 +              --grpc_out=$(builddir) --plugin=protoc-gen-grpc=$(GRPC_CPP_PLUGIN) $<
 +
 +collectd.pb.cc: $(top_srcdir)/proto/collectd.proto $(top_srcdir)/proto/types.proto
 +      $(V_PROTOC)@PROTOC@ -I$(top_srcdir)/proto --cpp_out=$(builddir) $<
 +
 +types.pb.cc: $(top_srcdir)/proto/types.proto
 +      $(V_PROTOC)@PROTOC@ -I$(top_srcdir)/proto --cpp_out=$(builddir) $<
 +endif
 +endif
 +
  if BUILD_PLUGIN_AGGREGATION
  pkglib_LTLIBRARIES += aggregation.la
  aggregation_la_SOURCES = aggregation.c \
@@@ -155,19 -120,24 +155,19 @@@ if BUILD_PLUGIN_AMQ
  pkglib_LTLIBRARIES += amqp.la
  amqp_la_SOURCES = amqp.c \
                  utils_cmd_putval.c utils_cmd_putval.h \
 -                utils_parse_option.c utils_parse_option.h \
 -                utils_format_graphite.c utils_format_graphite.h \
 -                utils_format_json.c utils_format_json.h
 +                utils_parse_option.c utils_parse_option.h \
 +                utils_format_graphite.c utils_format_graphite.h
  amqp_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
  amqp_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
 -amqp_la_LIBADD = $(BUILD_WITH_LIBRABBITMQ_LIBS)
 +amqp_la_LIBADD = $(BUILD_WITH_LIBRABBITMQ_LIBS) libformat_json.la
  endif
  
  if BUILD_PLUGIN_APACHE
  pkglib_LTLIBRARIES += apache.la
  apache_la_SOURCES = apache.c
  apache_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 -apache_la_CFLAGS = $(AM_CFLAGS)
 -apache_la_LIBADD =
 -if BUILD_WITH_LIBCURL
 -apache_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
 -apache_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
 -endif
 +apache_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
 +apache_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS)
  endif
  
  if BUILD_PLUGIN_APCUPS
@@@ -183,15 -153,16 +183,15 @@@ endi
  if BUILD_PLUGIN_APPLE_SENSORS
  pkglib_LTLIBRARIES += apple_sensors.la
  apple_sensors_la_SOURCES = apple_sensors.c
 -apple_sensors_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 -apple_sensors_la_LDFLAGS += -framework IOKit
 +apple_sensors_la_LDFLAGS = $(PLUGIN_LDFLAGS) -framework IOKit
  endif
  
  if BUILD_PLUGIN_AQUAERO
  pkglib_LTLIBRARIES += aquaero.la
  aquaero_la_SOURCES = aquaero.c
 -aquaero_la_LDFLAGS = $(PLUGIN_LDFLAGS)
  aquaero_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBAQUAERO5_CFLAGS)
 -aquaero_la_LIBADD = $(BUILD_WITH_LIBAQUAERO5_LDFLAGS) -laquaero5
 +aquaero_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBAQUAERO5_LDFLAGS)
 +aquaero_la_LIBADD = -laquaero5
  endif
  
  if BUILD_PLUGIN_ASCENT
@@@ -214,6 -185,7 +214,6 @@@ if BUILD_PLUGIN_BATTER
  pkglib_LTLIBRARIES += battery.la
  battery_la_SOURCES = battery.c
  battery_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 -battery_la_LIBADD =
  if BUILD_WITH_LIBIOKIT
  battery_la_LDFLAGS += -framework IOKit
  endif
@@@ -244,12 -216,6 +244,12 @@@ cgroups_la_LDFLAGS = $(PLUGIN_LDFLAGS
  cgroups_la_LIBADD = libmount.la
  endif
  
 +if BUILD_PLUGIN_CHRONY
 +pkglib_LTLIBRARIES += chrony.la
 +chrony_la_SOURCES = chrony.c
 +chrony_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 +endif
 +
  if BUILD_PLUGIN_CONNTRACK
  pkglib_LTLIBRARIES += conntrack.la
  conntrack_la_SOURCES = conntrack.c
@@@ -293,12 -259,6 +293,12 @@@ cpufreq_la_SOURCES = cpufreq.
  cpufreq_la_LDFLAGS = $(PLUGIN_LDFLAGS)
  endif
  
 +if BUILD_PLUGIN_CPUSLEEP
 +pkglib_LTLIBRARIES += cpusleep.la
 +cpusleep_la_SOURCES = cpusleep.c
 +cpusleep_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 +endif
 +
  if BUILD_PLUGIN_CSV
  pkglib_LTLIBRARIES += csv.la
  csv_la_SOURCES = csv.c
@@@ -307,27 -267,32 +307,27 @@@ endi
  
  if BUILD_PLUGIN_CURL
  pkglib_LTLIBRARIES += curl.la
 -curl_la_SOURCES = curl.c
 +curl_la_SOURCES = curl.c \
 +                utils_curl_stats.c utils_curl_stats.h
  curl_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 -curl_la_CFLAGS = $(AM_CFLAGS)
 -curl_la_LIBADD =
 -if BUILD_WITH_LIBCURL
 -curl_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
 -curl_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
 -endif
 +curl_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
 +curl_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS)
  endif
  
  if BUILD_PLUGIN_CURL_JSON
  pkglib_LTLIBRARIES += curl_json.la
 -curl_json_la_SOURCES = curl_json.c
 -curl_json_la_CFLAGS = $(AM_CFLAGS)
 -curl_json_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
 +curl_json_la_SOURCES = curl_json.c \
 +                utils_curl_stats.c utils_curl_stats.h
 +curl_json_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
  curl_json_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
 -curl_json_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
 -if BUILD_WITH_LIBCURL
 -curl_json_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
 -curl_json_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
 -endif
 +curl_json_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
 +curl_json_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) $(BUILD_WITH_LIBYAJL_LIBS)
  endif
  
  if BUILD_PLUGIN_CURL_XML
  pkglib_LTLIBRARIES += curl_xml.la
 -curl_xml_la_SOURCES = curl_xml.c
 +curl_xml_la_SOURCES = curl_xml.c \
 +                utils_curl_stats.c utils_curl_stats.h
  curl_xml_la_LDFLAGS = $(PLUGIN_LDFLAGS)
  curl_xml_la_CFLAGS = $(AM_CFLAGS) \
                $(BUILD_WITH_LIBCURL_CFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS)
@@@ -370,9 -335,7 +370,9 @@@ disk_la_CFLAGS += $(BUILD_WITH_LIBSTATG
  disk_la_LIBADD += $(BUILD_WITH_LIBSTATGRAB_LDFLAGS)
  endif
  if BUILD_WITH_LIBUDEV
 -disk_la_LIBADD += -ludev
 +disk_la_CFLAGS += $(BUILD_WITH_LIBUDEV_CFLAGS)
 +disk_la_LDFLAGS += $(BUILD_WITH_LIBUDEV_LDFLAGS)
 +disk_la_LIBADD += $(BUILD_WITH_LIBUDEV_LIBS)
  endif
  if BUILD_FREEBSD
  disk_la_LIBADD += -ldevstat -lgeom
@@@ -386,19 -349,21 +386,19 @@@ if BUILD_PLUGIN_DN
  pkglib_LTLIBRARIES += dns.la
  dns_la_SOURCES = dns.c utils_dns.c utils_dns.h
  dns_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 -dns_la_LIBADD = -lpcap -lpthread
 +dns_la_LIBADD = -lpcap
  endif
  
  if BUILD_PLUGIN_DRBD
  pkglib_LTLIBRARIES += drbd.la
  drbd_la_SOURCES = drbd.c
  drbd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 -drbd_la_LIBADD = -lpthread
  endif
  
  if BUILD_PLUGIN_EMAIL
  pkglib_LTLIBRARIES += email.la
  email_la_SOURCES = email.c
  email_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 -email_la_LIBADD = -lpthread
  endif
  
  if BUILD_PLUGIN_ENTROPY
@@@ -414,6 -379,7 +414,6 @@@ exec_la_SOURCES = exec.c 
                  utils_cmd_putval.c utils_cmd_putval.h \
                  utils_parse_option.h utils_parse_option.c
  exec_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 -exec_la_LIBADD = -lpthread
  endif
  
  if BUILD_PLUGIN_ETHSTAT
@@@ -442,15 -408,14 +442,23 @@@ gmond_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(
  gmond_la_LIBADD = $(GANGLIA_LIBS)
  endif
  
 -gps_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBGPS_LDFLAGS)
+ if BUILD_PLUGIN_GPS
+ pkglib_LTLIBRARIES += gps.la
+ gps_la_SOURCES = gps.c
+ gps_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBGPS_CFLAGS)
++gps_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBGPS_LDFLAGS)
+ gps_la_LIBADD = -lpthread $(BUILD_WITH_LIBGPS_LIBS)
+ endif
 +if BUILD_PLUGIN_GRPC
 +pkglib_LTLIBRARIES += grpc.la
 +grpc_la_SOURCES = grpc.cc
 +nodist_grpc_la_SOURCES = collectd.grpc.pb.cc collectd.pb.cc types.pb.cc
 +grpc_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBGRPCPP_CPPFLAGS) $(BUILD_WITH_LIBPROTOBUF_CPPFLAGS)
 +grpc_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBGRPCPP_LDFLAGS) $(BUILD_WITH_LIBPROTOBUF_LDFLAGS)
 +grpc_la_LIBADD = $(BUILD_WITH_LIBGRPCPP_LIBS) $(BUILD_WITH_LIBPROTOBUF_LIBS)
 +endif
 +
  if BUILD_PLUGIN_HDDTEMP
  pkglib_LTLIBRARIES += hddtemp.la
  hddtemp_la_SOURCES = hddtemp.c
@@@ -486,6 -451,7 +494,6 @@@ endif # BUILD_PLUGIN_INTERFAC
  if BUILD_PLUGIN_IPC
  pkglib_LTLIBRARIES += ipc.la
  ipc_la_SOURCES = ipc.c
 -ipc_la_CFLAGS = $(AM_CFLAGS)
  ipc_la_LDFLAGS = $(PLUGIN_LDFLAGS)
  endif
  
@@@ -508,9 -474,10 +516,9 @@@ endi
  if BUILD_PLUGIN_IPVS
  pkglib_LTLIBRARIES += ipvs.la
  ipvs_la_SOURCES = ipvs.c
 -if IP_VS_H_NEEDS_KERNEL_CFLAGS
 -ipvs_la_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS)
 -else
  ipvs_la_CFLAGS = $(AM_CFLAGS)
 +if IP_VS_H_NEEDS_KERNEL_CFLAGS
 +ipvs_la_CFLAGS += $(KERNEL_CFLAGS)
  endif
  ipvs_la_LDFLAGS = $(PLUGIN_LDFLAGS)
  endif
@@@ -554,6 -521,7 +562,6 @@@ endi
  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 = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
  log_logstash_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
  log_logstash_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS)
@@@ -569,8 -537,7 +577,8 @@@ endi
  if BUILD_PLUGIN_LVM
  pkglib_LTLIBRARIES += lvm.la
  lvm_la_SOURCES = lvm.c
 -lvm_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 +lvm_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBLVM2APP_CPPFLAGS)
 +lvm_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBLVM2APP_LDFLAGS)
  lvm_la_LIBADD = $(BUILD_WITH_LIBLVM2APP_LIBS)
  endif
  
@@@ -684,8 -651,8 +692,8 @@@ endi
  if BUILD_PLUGIN_MQTT
  pkglib_LTLIBRARIES += mqtt.la
  mqtt_la_SOURCES = mqtt.c
 -mqtt_la_LDFLAGS = $(PLUGIN_LDFLAGS)
  mqtt_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBMOSQUITTO_CPPFLAGS)
 +mqtt_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBMOSQUITTO_LDFLAGS)
  mqtt_la_LIBADD = $(BUILD_WITH_LIBMOSQUITTO_LIBS)
  endif
  
@@@ -698,9 -665,13 +706,9 @@@ endi
  if BUILD_PLUGIN_MYSQL
  pkglib_LTLIBRARIES += mysql.la
  mysql_la_SOURCES = mysql.c
 +mysql_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBMYSQL_CFLAGS)
  mysql_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 -mysql_la_CFLAGS = $(AM_CFLAGS)
 -mysql_la_LIBADD =
 -if BUILD_WITH_LIBMYSQL
 -mysql_la_CFLAGS += $(BUILD_WITH_LIBMYSQL_CFLAGS)
 -mysql_la_LIBADD += $(BUILD_WITH_LIBMYSQL_LIBS)
 -endif
 +mysql_la_LIBADD = $(BUILD_WITH_LIBMYSQL_LIBS)
  endif
  
  if BUILD_PLUGIN_NETAPP
@@@ -725,7 -696,7 +733,7 @@@ network_la_SOURCES = network.c network.
                     utils_fbhash.c utils_fbhash.h
  network_la_CPPFLAGS = $(AM_CPPFLAGS)
  network_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 -network_la_LIBADD = -lpthread
 +network_la_LIBADD =
  if BUILD_WITH_LIBSOCKET
  network_la_LIBADD += -lsocket
  endif
@@@ -751,9 -722,13 +759,9 @@@ endi
  if BUILD_PLUGIN_NGINX
  pkglib_LTLIBRARIES += nginx.la
  nginx_la_SOURCES = nginx.c
 -nginx_la_CFLAGS = $(AM_CFLAGS)
 -nginx_la_LIBADD =
 +nginx_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
  nginx_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 -if BUILD_WITH_LIBCURL
 -nginx_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
 -nginx_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
 -endif
 +nginx_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS)
  endif
  
  if BUILD_PLUGIN_NOTIFY_DESKTOP
@@@ -768,13 -743,7 +776,13 @@@ if BUILD_PLUGIN_NOTIFY_EMAI
  pkglib_LTLIBRARIES += notify_email.la
  notify_email_la_SOURCES = notify_email.c
  notify_email_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 -notify_email_la_LIBADD = -lesmtp -lssl -lcrypto -lpthread
 +notify_email_la_LIBADD = -lesmtp -lssl -lcrypto
 +endif
 +
 +if BUILD_PLUGIN_NOTIFY_NAGIOS
 +pkglib_LTLIBRARIES += notify_nagios.la
 +notify_nagios_la_SOURCES = notify_nagios.c
 +notify_nagios_la_LDFLAGS = $(PLUGIN_LDFLAGS)
  endif
  
  if BUILD_PLUGIN_NTPD
@@@ -798,7 -767,7 +806,7 @@@ pkglib_LTLIBRARIES += nut.l
  nut_la_SOURCES = nut.c
  nut_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBUPSCLIENT_CFLAGS)
  nut_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 -nut_la_LIBADD = -lpthread $(BUILD_WITH_LIBUPSCLIENT_LIBS)
 +nut_la_LIBADD = $(BUILD_WITH_LIBUPSCLIENT_LIBS)
  endif
  
  if BUILD_PLUGIN_OLSRD
@@@ -814,22 -783,24 +822,22 @@@ endi
  if BUILD_PLUGIN_ONEWIRE
  pkglib_LTLIBRARIES += onewire.la
  onewire_la_SOURCES = onewire.c
 -onewire_la_CFLAGS = $(AM_CFLAGS)
  onewire_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBOWCAPI_CPPFLAGS)
  onewire_la_LIBADD = $(BUILD_WITH_LIBOWCAPI_LIBS)
 -onewire_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 +onewire_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBOWCAPI_LDFLAGS)
  endif
  
  if BUILD_PLUGIN_OPENLDAP
  pkglib_LTLIBRARIES += openldap.la
  openldap_la_SOURCES = openldap.c
 -openldap_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBLDAP_LDFLAGS)
 -openldap_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBLDAP_CPPFLAGS)
 +openldap_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBLDAP_CPPFLAGS)
 +openldap_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBLDAP_LDFLAGS)
  openldap_la_LIBADD = -lldap
  endif
  
  if BUILD_PLUGIN_OPENVPN
  pkglib_LTLIBRARIES += openvpn.la
  openvpn_la_SOURCES = openvpn.c
 -openvpn_la_CFLAGS = $(AM_CFLAGS)
  openvpn_la_LDFLAGS = $(PLUGIN_LDFLAGS)
  endif
  
@@@ -837,7 -808,8 +845,7 @@@ if BUILD_PLUGIN_ORACL
  pkglib_LTLIBRARIES += oracle.la
  oracle_la_SOURCES = oracle.c \
        utils_db_query.c utils_db_query.h
 -oracle_la_CFLAGS = $(AM_CFLAGS)
 -oracle_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_ORACLE_CFLAGS)
 +oracle_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_ORACLE_CPPFLAGS)
  oracle_la_LIBADD = $(BUILD_WITH_ORACLE_LIBS)
  oracle_la_LDFLAGS = $(PLUGIN_LDFLAGS)
  endif
@@@ -848,10 -820,6 +856,10 @@@ perl_la_SOURCES = perl.
  # Despite C99 providing the "bool" type thru stdbool.h, Perl defines its own
  # version of that type if HAS_BOOL is not defined... *sigh*
  perl_la_CPPFLAGS = $(AM_CPPFLAGS) -DHAS_BOOL=1
 +# Despite off_t being 64 bit wide on 64 bit platforms, Perl insist on using
 +# off64_t which is only exposed when _LARGEFILE64_SOURCE is defined... *sigh*
 +# On older platforms we also need _REENTRANT. _GNU_SOURCE sets both of these.
 +perl_la_CPPFLAGS += -D_GNU_SOURCE
  perl_la_CFLAGS  = $(AM_CFLAGS) \
                $(PERL_CFLAGS) \
                -DXS_VERSION=\"$(VERSION)\" -DVERSION=\"$(VERSION)\"
@@@ -875,9 -843,8 +883,9 @@@ if BUILD_PLUGIN_PINB
  pkglib_LTLIBRARIES += pinba.la
  pinba_la_SOURCES = pinba.c
  nodist_pinba_la_SOURCES = pinba.pb-c.c pinba.pb-c.h
 -pinba_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 -pinba_la_LIBADD = -lprotobuf-c
 +pinba_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBPROTOBUF_C_CPPFLAGS)
 +pinba_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBPROTOBUF_C_LDFLAGS)
 +pinba_la_LIBADD = $(BUILD_WITH_LIBPROTOBUF_C_LIBS)
  endif
  
  if BUILD_PLUGIN_PING
@@@ -907,11 -874,13 +915,11 @@@ endi
  if BUILD_PLUGIN_PYTHON
  pkglib_LTLIBRARIES += python.la
  python_la_SOURCES = python.c pyconfig.c pyvalues.c cpython.h
 -python_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_PYTHON_CPPFLAGS)
 -python_la_CFLAGS = $(AM_CFLAGS)
 +python_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBPYTHON_CPPFLAGS)
  if COMPILER_IS_GCC
 -python_la_CFLAGS += -fno-strict-aliasing -Wno-strict-aliasing
 +python_la_CPPFLAGS += -fno-strict-aliasing -Wno-strict-aliasing
  endif
 -python_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_PYTHON_LDFLAGS)
 -python_la_LIBADD = $(BUILD_WITH_PYTHON_LIBS)
 +python_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBPYTHON_LDFLAGS)
  endif
  
  if BUILD_PLUGIN_PROCESSES
@@@ -949,17 -918,17 +957,17 @@@ endi
  if BUILD_PLUGIN_RRDCACHED
  pkglib_LTLIBRARIES += rrdcached.la
  rrdcached_la_SOURCES = rrdcached.c utils_rrdcreate.c utils_rrdcreate.h
 -rrdcached_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 +rrdcached_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBRRD_LDFLAGS)
  rrdcached_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBRRD_CFLAGS)
 -rrdcached_la_LIBADD = $(BUILD_WITH_LIBRRD_LDFLAGS)
 +rrdcached_la_LIBADD = $(BUILD_WITH_LIBRRD_LIBS)
  endif
  
  if BUILD_PLUGIN_RRDTOOL
  pkglib_LTLIBRARIES += rrdtool.la
  rrdtool_la_SOURCES = rrdtool.c utils_rrdcreate.c utils_rrdcreate.h
 -rrdtool_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 +rrdtool_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBRRD_LDFLAGS)
  rrdtool_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBRRD_CFLAGS)
 -rrdtool_la_LIBADD = $(BUILD_WITH_LIBRRD_LDFLAGS)
 +rrdtool_la_LIBADD = $(BUILD_WITH_LIBRRD_LIBS)
  endif
  
  if BUILD_PLUGIN_SENSORS
@@@ -979,18 -948,18 +987,18 @@@ endi
  if BUILD_PLUGIN_SIGROK
  pkglib_LTLIBRARIES += sigrok.la
  sigrok_la_SOURCES = sigrok.c
 -sigrok_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBSIGROK_CFLAGS)
 -sigrok_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBSIGROK_LDFLAGS)
 -sigrok_la_LIBADD = -lsigrok
 +sigrok_la_CFLAGS = $(AM_CFLAGS) $(LIBSIGROK_CFLAGS)
 +sigrok_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 +sigrok_la_LIBADD = $(LIBSIGROK_LIBS)
  endif
  
  if BUILD_PLUGIN_SMART
  if BUILD_WITH_LIBUDEV
  pkglib_LTLIBRARIES += smart.la
  smart_la_SOURCES = smart.c
 -smart_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBATASMART_CPPFLAGS)
 -smart_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBATASMART_LDFLAGS)
 -smart_la_LIBADD = $(BUILD_WITH_LIBATASMART_LIBS) -ludev
 +smart_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBATASMART_CPPFLAGS) $(BUILD_WITH_LIBUDEV_CFLAGS)
 +smart_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBATASMART_LDFLAGS) $(BUILD_WITH_LIBUDEV_LDFLAGS)
 +smart_la_LIBADD = $(BUILD_WITH_LIBATASMART_LIBS) $(BUILD_WITH_LIBUDEV_LIBS)
  endif
  endif
  
@@@ -1004,13 -973,16 +1012,13 @@@ if BUILD_WITH_LIBNETSNM
  snmp_la_CFLAGS += $(BUILD_WITH_LIBSNMP_CFLAGS)
  snmp_la_LIBADD += $(BUILD_WITH_LIBSNMP_LIBS)
  endif
 -if BUILD_WITH_LIBPTHREAD
 -snmp_la_LIBADD += -lpthread
 -endif
  endif
  
  if BUILD_PLUGIN_STATSD
  pkglib_LTLIBRARIES += statsd.la
  statsd_la_SOURCES = statsd.c
  statsd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 -statsd_la_LIBADD = liblatency.la -lpthread -lm
 +statsd_la_LIBADD = liblatency.la -lm
  endif
  
  if BUILD_PLUGIN_SWAP
@@@ -1161,6 -1133,7 +1169,6 @@@ unixsock_la_SOURCES = unixsock.c 
                      utils_cmd_putnotif.h utils_cmd_putnotif.c \
                      utils_parse_option.h utils_parse_option.c
  unixsock_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 -unixsock_la_LIBADD = -lpthread
  endif
  
  if BUILD_PLUGIN_UPTIME
@@@ -1235,29 -1208,34 +1243,29 @@@ endi
  if BUILD_PLUGIN_WRITE_GRAPHITE
  pkglib_LTLIBRARIES += write_graphite.la
  write_graphite_la_SOURCES = write_graphite.c \
 -                        utils_format_graphite.c utils_format_graphite.h \
 -                        utils_format_json.c utils_format_json.h
 +                        utils_format_graphite.c utils_format_graphite.h
  write_graphite_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 +write_graphite_la_LIBADD = libformat_json.la
  endif
  
  if BUILD_PLUGIN_WRITE_HTTP
  pkglib_LTLIBRARIES += write_http.la
  write_http_la_SOURCES = write_http.c \
 -                      utils_format_json.c utils_format_json.h
 +                      utils_format_kairosdb.c utils_format_kairosdb.h
  write_http_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 -write_http_la_CFLAGS = $(AM_CFLAGS)
 -write_http_la_LIBADD =
 -if BUILD_WITH_LIBCURL
 -write_http_la_CFLAGS += $(BUILD_WITH_LIBCURL_CFLAGS)
 -write_http_la_LIBADD += $(BUILD_WITH_LIBCURL_LIBS)
 -endif
 +write_http_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCURL_CFLAGS)
 +write_http_la_LIBADD = $(BUILD_WITH_LIBCURL_LIBS) libformat_json.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_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBRDKAFKA_CPPFLAGS)
  write_kafka_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
 -write_kafka_la_LIBADD = $(BUILD_WITH_LIBRDKAFKA_LIBS)
 +write_kafka_la_LIBADD = $(BUILD_WITH_LIBRDKAFKA_LIBS) libformat_json.la
  endif
  
  if BUILD_PLUGIN_WRITE_LOG
@@@ -1279,15 -1257,16 +1287,15 @@@ if BUILD_PLUGIN_WRITE_REDI
  pkglib_LTLIBRARIES += write_redis.la
  write_redis_la_SOURCES = write_redis.c
  write_redis_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBHIREDIS_LDFLAGS)
 -write_redis_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBHIREDIS_CPPFLAGS)
 +write_redis_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBHIREDIS_CPPFLAGS)
  write_redis_la_LIBADD = -lhiredis
  endif
  
  if BUILD_PLUGIN_WRITE_RIEMANN
  pkglib_LTLIBRARIES += write_riemann.la
 -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 = $(PLUGIN_LDFLAGS)
 -write_riemann_la_LIBADD = -lprotobuf-c
 +write_riemann_la_SOURCES = write_riemann.c write_riemann_threshold.c write_riemann_threshold.h
 +write_riemann_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBRIEMANN_CLIENT_LIBS)
 +write_riemann_la_CFLAGS = $(AM_CFLAGS) $(LIBRIEMANN_CLIENT_CFLAGS)
  endif
  
  if BUILD_PLUGIN_WRITE_SENSU
@@@ -1302,14 -1281,6 +1310,14 @@@ write_tsdb_la_SOURCES = write_tsdb.
  write_tsdb_la_LDFLAGS = $(PLUGIN_LDFLAGS)
  endif
  
 +if BUILD_PLUGIN_XENCPU
 +pkglib_LTLIBRARIES += xencpu.la
 +xencpu_la_SOURCES = xencpu.c
 +xencpu_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBXENCTL_CPPFLAGS)
 +xencpu_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(LIBXENCTL_LDFLAGS)
 +xencpu_la_LIBADD = -lxenctrl
 +endif
 +
  if BUILD_PLUGIN_XMMS
  pkglib_LTLIBRARIES += xmms.la
  xmms_la_SOURCES = xmms.c
@@@ -1321,12 -1292,17 +1329,12 @@@ endi
  if BUILD_PLUGIN_ZFS_ARC
  pkglib_LTLIBRARIES += zfs_arc.la
  zfs_arc_la_SOURCES = zfs_arc.c
 -zfs_arc_la_CFLAGS = $(AM_CFLAGS)
  zfs_arc_la_LDFLAGS = $(PLUGIN_LDFLAGS)
  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
 +if BUILD_SOLARIS
 +zfs_arc_la_LIBADD = -lkstat
  endif
  endif
  
@@@ -1341,6 -1317,7 +1349,6 @@@ BUILT_SOURCES += $(dist_man_MANS
  if BUILD_PLUGIN_ZONE
  pkglib_LTLIBRARIES += zone.la
  zone_la_SOURCES = zone.c
 -zone_la_CFLAGS = $(AM_CFLAGS)
  zone_la_LDFLAGS = $(PLUGIN_LDFLAGS)
  endif
  
@@@ -1360,7 -1337,11 +1368,7 @@@ dist_man_MANS = collectd.1 
                collectd-unixsock.5 \
                types.db.5
  
 -#collectd_1_SOURCES = collectd.pod
 -
 -EXTRA_DIST = types.db
 -
 -EXTRA_DIST +=   collectd.conf.pod \
 +EXTRA_DIST =  collectd.conf.pod \
                collectd-email.pod \
                collectd-exec.pod \
                collectdctl.pod \
                collectd-threshold.pod \
                collectd-unixsock.pod \
                postgresql_default.conf \
 -              types.db.pod
 +              types.db \
 +              types.db.pod \
 +              valgrind.FreeBSD.suppress
 +
 +AM_V_POD2MAN_C = $(am__v_POD2MAN_C_@AM_V@)
 +am__v_POD2MAN_C_ = $(am__v_POD2MAN_C_@AM_DEFAULT_V@)
 +am__v_POD2MAN_C_0 = @echo "  POD2MAN " $@;
 +am__v_POD2MAN_C_1 =
  
  .pod.1:
 -      pod2man --release=$(VERSION) --center=$(PACKAGE) $< \
 +      $(AM_V_POD2MAN_C)pod2man --release=$(VERSION) --center=$(PACKAGE) $< \
                >.pod2man.tmp.$$$$ 2>/dev/null && mv -f .pod2man.tmp.$$$$ $@ || true
        @if grep '\<POD ERRORS\>' $@ >/dev/null 2>&1; \
        then \
        fi
  
  .pod.5:
 -      pod2man --section=5 --release=$(VERSION) --center=$(PACKAGE) $< \
 +      $(AM_V_POD2MAN_C)pod2man --section=5 --release=$(VERSION) --center=$(PACKAGE) $< \
                >.pod2man.tmp.$$$$ 2>/dev/null && mv -f .pod2man.tmp.$$$$ $@ || true
        @if grep '\<POD ERRORS\>' $@ >/dev/null 2>&1; \
        then \
                echo "$@ has some POD errors!"; false; \
        fi
  
 +AM_V_PROTOC_C = $(am__v_PROTOC_C_@AM_V@)
 +am__v_PROTOC_C_ = $(am__v_PROTOC_C_@AM_DEFAULT_V@)
 +am__v_PROTOC_C_0 = @echo "  PROTOC-C" $@;
 +am__v_PROTOC_C_1 =
 +
  # Protocol buffer for the "pinba" plugin.
  EXTRA_DIST += pinba.proto
 -if HAVE_PROTOC_C
 +if BUILD_PLUGIN_PINBA
  CLEANFILES += pinba.pb-c.c pinba.pb-c.h
  BUILT_SOURCES += pinba.pb-c.c pinba.pb-c.h
  
  pinba.pb-c.c pinba.pb-c.h: pinba.proto
 -      protoc-c -I$(srcdir) --c_out . $(srcdir)/pinba.proto
 -endif
 -
 -# Protocol buffer for the "write_riemann" plugin.
 -EXTRA_DIST += riemann.proto
 -if HAVE_PROTOC_C
 -CLEANFILES += riemann.pb-c.c riemann.pb-c.h
 -
 -BUILT_SOURCES += riemann.pb-c.c riemann.pb-c.h
 -
 -riemann.pb-c.c riemann.pb-c.h: riemann.proto
 -      protoc-c -I$(srcdir) --c_out . $(srcdir)/riemann.proto
 +      $(AM_V_PROTOC_C)$(PROTOC_C) -I$(srcdir) --c_out . $(srcdir)/pinba.proto
  endif
  
  install-exec-hook:
@@@ -1433,11 -1413,4 +1441,11 @@@ uninstall-hook
        rm -f $(DESTDIR)$(sysconfdir)/collectd.conf
        rm -f $(DESTDIR)$(pkgdatadir)/postgresql_default.conf;
  
 -
 +if BUILD_PLUGIN_CEPH
 +test_plugin_ceph_SOURCES = ceph_test.c
 +test_plugin_ceph_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
 +test_plugin_ceph_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
 +test_plugin_ceph_LDADD = daemon/libplugin_mock.la $(BUILD_WITH_LIBYAJL_LIBS)
 +check_PROGRAMS += test_plugin_ceph
 +TESTS += test_plugin_ceph
 +endif
diff --combined src/collectd.conf.in
@@@ -84,7 -84,7 +84,7 @@@
  # Lines beginning with a single `#' belong to plugins which have been built  #
  # but are disabled by default.                                               #
  #                                                                            #
 -# Lines begnning with `##' belong to plugins which have not been built due   #
 +# Lines beginning with `##' belong to plugins which have not been built due  #
  # to missing dependencies or because they have been deactivated explicitly.  #
  ##############################################################################
  
  #@BUILD_PLUGIN_BIND_TRUE@LoadPlugin bind
  #@BUILD_PLUGIN_CEPH_TRUE@LoadPlugin ceph
  #@BUILD_PLUGIN_CGROUPS_TRUE@LoadPlugin cgroups
 +#@BUILD_PLUGIN_CHRONY_TRUE@LoadPlugin chrony
  #@BUILD_PLUGIN_CONNTRACK_TRUE@LoadPlugin conntrack
  #@BUILD_PLUGIN_CONTEXTSWITCH_TRUE@LoadPlugin contextswitch
  @BUILD_PLUGIN_CPU_TRUE@@BUILD_PLUGIN_CPU_TRUE@LoadPlugin cpu
  #@BUILD_PLUGIN_CPUFREQ_TRUE@LoadPlugin cpufreq
 +#@BUILD_PLUGIN_CPUSLEEP_TRUE@LoadPlugin cpusleep
  @LOAD_PLUGIN_CSV@LoadPlugin csv
  #@BUILD_PLUGIN_CURL_TRUE@LoadPlugin curl
  #@BUILD_PLUGIN_CURL_JSON_TRUE@LoadPlugin curl_json
  #@BUILD_PLUGIN_FILECOUNT_TRUE@LoadPlugin filecount
  #@BUILD_PLUGIN_FSCACHE_TRUE@LoadPlugin fscache
  #@BUILD_PLUGIN_GMOND_TRUE@LoadPlugin gmond
+ #@BUILD_PLUGIN_GPS_TRUE@LoadPlugin gps
 +#@BUILD_PLUGIN_GRPC_TRUE@LoadPlugin grpc
  #@BUILD_PLUGIN_HDDTEMP_TRUE@LoadPlugin hddtemp
  @BUILD_PLUGIN_INTERFACE_TRUE@@BUILD_PLUGIN_INTERFACE_TRUE@LoadPlugin interface
 -#@BUILD_PLUGIN_IPC_TRUE@@BUILD_PLUGIN_IPC_TRUE@LoadPlugin ipc
 +#@BUILD_PLUGIN_IPC_TRUE@LoadPlugin ipc
  #@BUILD_PLUGIN_IPMI_TRUE@LoadPlugin ipmi
  #@BUILD_PLUGIN_IPTABLES_TRUE@LoadPlugin iptables
  #@BUILD_PLUGIN_IPVS_TRUE@LoadPlugin ipvs
  #@BUILD_PLUGIN_NGINX_TRUE@LoadPlugin nginx
  #@BUILD_PLUGIN_NOTIFY_DESKTOP_TRUE@LoadPlugin notify_desktop
  #@BUILD_PLUGIN_NOTIFY_EMAIL_TRUE@LoadPlugin notify_email
 +#@BUILD_PLUGIN_NOTIFY_NAGIOS_TRUE@LoadPlugin notify_nagios
  #@BUILD_PLUGIN_NTPD_TRUE@LoadPlugin ntpd
  #@BUILD_PLUGIN_NUMA_TRUE@LoadPlugin numa
  #@BUILD_PLUGIN_NUT_TRUE@LoadPlugin nut
  #@BUILD_PLUGIN_WRITE_RIEMANN_TRUE@LoadPlugin write_riemann
  #@BUILD_PLUGIN_WRITE_SENSU_TRUE@LoadPlugin write_sensu
  #@BUILD_PLUGIN_WRITE_TSDB_TRUE@LoadPlugin write_tsdb
 +#@BUILD_PLUGIN_XENCPU_TRUE@LoadPlugin xencpu
  #@BUILD_PLUGIN_XMMS_TRUE@LoadPlugin xmms
  #@BUILD_PLUGIN_ZFS_ARC_TRUE@LoadPlugin zfs_arc
  #@BUILD_PLUGIN_ZONE_TRUE@LoadPlugin zone
  #  </Daemon>
  #</Plugin>
  
 +#<Plugin chrony>
 +#     Host    "localhost"
 +#     Port    "323"
 +#     Timeout "2"
 +#</Plugin>
 +
  #<Plugin cgroups>
  #  CGroup "libvirt"
  #  IgnoreSelected false
  #     FSType "ext3"
  #     IgnoreSelected false
  #     ReportByDevice false
 -#     ReportReserved false
  #     ReportInodes false
  #     ValuesAbsolute true
  #     ValuesPercentage false
  #  </Metric>
  #</Plugin>
  
+ #<Plugin gps>
+ #  Host "127.0.0.1"
+ #  Port "2947"
+ #  Timeout 0.015
+ #  PauseConnect 5
+ #</Plugin>
 +#<Plugin grpc>
 +#     WorkerThreads 5
 +#     <Listen "0.0.0.0" "50051">
 +#             EnableSSL true
 +#             SSLRootCerts "/path/to/root.pem"
 +#             SSLServerCert "/path/to/server.pem"
 +#             SSLServerKey "/path/to/server.key"
 +#     </Listen>
 +#</Plugin>
 +
  #<Plugin hddtemp>
  #  Host "127.0.0.1"
  #  Port "7634"
  #<Plugin interface>
  #     Interface "eth0"
  #     IgnoreSelected false
 +#     ReportInactive true
 +#     UniqueName false
  #</Plugin>
  
  #<Plugin ipmi>
  
  #<Plugin iptables>
  #     Chain table chain
 +#     Chain6 table chain
  #</Plugin>
  
  #<Plugin irq>
  #             Prefix "collectd"
  #             StoreRates true
  #             Retain false
 +#             CACert "/etc/ssl/ca.crt"
 +#             CertificateFile "/etc/ssl/client.crt"
 +#             CertificateKeyFile "/etc/ssl/client.pem"
 +#             TLSProtocol "tlsv1.2"
 +#             CipherSuite "ciphers"
  #     </Publish>
  #     <Subscribe "name">
  #             Host "localhost"
  #             SlaveStats true
  #             SlaveNotifications true
  #     </Database>
 +#     <Database galera>
 +#             Alias "galera"
 +#             Host "localhost"
 +#             Socket "/var/run/mysql/mysqld.sock"
 +#             WsrepStats true
 +#     </Database>
  #</Plugin>
  
  #<Plugin netapp>
  #     Recipient "email2@domain2.com"
  #</Plugin>
  
 +#<Plugin notify_nagios>
 +#     CommandFile "/usr/local/nagios/var/rw/nagios.cmd"
 +#</Plugin>
 +
  #<Plugin ntpd>
  #     Host "localhost"
  #     Port 123
  #  DeleteTimers   false
  #  DeleteGauges   false
  #  DeleteSets     false
 +#  CounterSum     false
  #  TimerPercentile 90.0
  #  TimerPercentile 95.0
  #  TimerPercentile 99.0
  ##    None of the following option should be set manually
  ##    This plugin automatically detect most optimal options
  ##    Only set values here if:
 -##    - The module ask you to
 +##    - The module asks you to
  ##    - You want to disable the collection of some data
 -##    - Your (intel) CPU is not supported (yet) by the module
 -##    - The module generate a lot of errors 'MSR offset 0x... read failed'
 +##    - Your (Intel) CPU is not supported (yet) by the module
 +##    - The module generates a lot of errors 'MSR offset 0x... read failed'
  ##    In the last two cases, please open a bug request
  #
  #     TCCActivationTemp "100"
  #    Host "localhost"
  #    Port "2003"
  #    Protocol "tcp"
 +#    ReconnectInterval 0
  #    LogSendErrors true
  #    Prefix "collectd"
  #    Postfix "collectd"
  #             ClientKey "/etc/ssl/client.pem"
  #             ClientCert "/etc/ssl/client.crt"
  #             ClientKeyPass "secret"
 +#             Header "X-Custom-Header: custom_value"
  #             SSLVersion "TLSv1"
  #             Format "Command"
 +#             Metrics true
 +#             Notifications false
  #             StoreRates false
  #             BufferSize 4096
  #             LowSpeedLimit 0
diff --combined src/collectd.conf.pod
@@@ -38,7 -38,7 +38,7 @@@ i.e. a C<E<lt>PluginE<nbsp>...E<gt>> bl
  The syntax of this config file is similar to the config file of the famous
  I<Apache> webserver. Each line contains either an option (a key and a list of
  one or more values) or a section-start or -end. Empty lines and everything
 -after a non-quoted hash-symbol (C<#>) is ignored. I<Keys> are unquoted
 +after a non-quoted hash-symbol (C<#>) are ignored. I<Keys> are unquoted
  strings, consisting only of alphanumeric characters and the underscore (C<_>)
  character. Keys are handled case insensitive by I<collectd> itself and all
  plugins included with it. I<Values> can either be an I<unquoted string>, a
@@@ -70,7 -70,7 +70,7 @@@ C<E<lt>B<Plugin> ...E<gt>> block
  
  =item B<BaseDir> I<Directory>
  
 -Sets the base directory. This is the directory beneath all RRD-files are
 +Sets the base directory. This is the directory beneath which all RRD-files are
  created. Possibly more subdirectories are created. This is also the working
  directory for the daemon.
  
@@@ -83,7 -83,7 +83,7 @@@ I<collectd> will be mostly useless
  Only the first B<LoadPlugin> statement or block for a given plugin name has any
  effect. This is useful when you want to split up the configuration into smaller
  files and want each file to be "self contained", i.e. it contains a B<Plugin>
 -block I<and> then appropriate B<LoadPlugin> statement. The downside is that if
 +block I<and> the appropriate B<LoadPlugin> statement. The downside is that if
  you have multiple conflicting B<LoadPlugin> blocks, e.g. when they specify
  different intervals, only one of them (the first one encountered) will take
  effect and all others will be silently ignored.
@@@ -127,13 -127,13 +127,13 @@@ the average user from ever having to de
  =item B<Interval> I<Seconds>
  
  Sets a plugin-specific interval for collecting metrics. This overrides the
 -global B<Interval> setting. If a plugin provides own support for specifying an
 -interval, that setting will take precedence.
 +global B<Interval> setting. If a plugin provides its own support for specifying
 +an interval, that setting will take precedence.
  
  =item B<FlushInterval> I<Seconds>
  
 -Specifies the the interval, in seconds, to call the flush callback if it's
 -defined in this plugin. By default, this is disabled
 +Specifies the interval, in seconds, to call the flush callback if it's
 +defined in this plugin. By default, this is disabled.
  
  =item B<FlushTimeout> I<Seconds>
  
@@@ -159,27 -159,12 +159,27 @@@ plugins that don't provide any configur
  When set to B<true>, various statistics about the I<collectd> daemon will be
  collected, with "collectd" as the I<plugin name>. Defaults to B<false>.
  
 -The "write_queue" I<plugin instance> reports the number of elements currently
 -queued and the number of elements dropped off the queue by the
 -B<WriteQueueLimitLow>/B<WriteQueueLimitHigh> mechanism.
 +The following metrics are reported:
  
 -The "cache" I<plugin instance> reports the number of elements in the value list
 -cache (the cache you can interact with using L<collectd-unixsock(5)>).
 +=over 4
 +
 +=item C<collectd-write_queue/queue_length>
 +
 +The number of metrics currently in the write queue. You can limit the queue
 +length with the B<WriteQueueLimitLow> and B<WriteQueueLimitHigh> options.
 +
 +=item C<collectd-write_queue/derive-dropped>
 +
 +The number of metrics dropped due to a queue length limitation.
 +If this value is non-zero, your system can't handle all incoming metrics and
 +protects itself against overload by dropping metrics.
 +
 +=item C<collectd-cache/cache_size>
 +
 +The number of elements in the metric cache (the cache you can interact with
 +using L<collectd-unixsock(5)>).
 +
 +=back
  
  =item B<Include> I<Path> [I<pattern>]
  
@@@ -208,11 -193,13 +208,11 @@@ I<pattern> may be specified to filter w
  in combination with recursively including a directory to easily be able to
  arbitrarily mix configuration files and other documents (e.g. README files).
  The given example is similar to the first example above but includes all files
 -matching C<*.conf> in any subdirectory of C</etc/collectd.d>:
 -
 -  Include "/etc/collectd.d" "*.conf"
 +matching C<*.conf> in any subdirectory of C</etc/collectd.d>.
  
  =back
  
 -If more than one files are included by a single B<Include> option, the files
 +If more than one file is included by a single B<Include> option, the files
  will be included in lexicographical order (as defined by the C<strcmp>
  function). Thus, you can e.E<nbsp>g. use numbered prefixes to specify the
  order in which the files are loaded.
@@@ -253,7 -240,7 +253,7 @@@ magic! (Assuming you're using the I<RRD
  
  =item B<MaxReadInterval> I<Seconds>
  
 -Read plugin doubles interval between queries after each failed attempt
 +A read plugin doubles the interval between queries after each failed attempt
  to get data.
  
  This options limits the maximum value of the interval. The default value is
@@@ -404,13 -391,13 +404,13 @@@ There are a couple of limitations you s
  
  =over 4
  
 -=item
 +=item *
  
  The I<Type> cannot be left unspecified, because it is not reasonable to add
  apples to oranges. Also, the internal lookup structure won't work if you try
  to group by type.
  
 -=item
 +=item *
  
  There must be at least one unspecified, ungrouped field. Otherwise nothing
  will be aggregated.
@@@ -485,19 -472,19 +485,19 @@@ This will create the files
  
  =over 4
  
 -=item
 +=item *
  
  foo.example.com/cpu-even-average/cpu-idle
  
 -=item
 +=item *
  
  foo.example.com/cpu-even-average/cpu-system
  
 -=item
 +=item *
  
  foo.example.com/cpu-even-average/cpu-user
  
 -=item
 +=item *
  
  ...
  
@@@ -834,15 -821,13 +834,15 @@@ default for backwards compatibility, th
  
  =item B<PersistentConnection> B<true>|B<false>
  
 -By default, the plugin will try to keep the connection to UPS open between
 -reads. Since this appears to be somewhat brittle (I<apcupsd> appears to close
 -the connection due to inactivity quite quickly), the plugin will try to detect
 -this problem and switch to an open-read-close mode in such cases.
 +The plugin is designed to keep the connection to I<apcupsd> open between reads.
 +If plugin poll interval is greater than 15 seconds (hardcoded socket close
 +timeout in I<apcupsd> NIS), then this option is B<false> by default.
  
  You can instruct the plugin to close the connection after each read by setting
 -this option to B<false>.
 +this option to B<false> or force keeping the connection by setting it to B<true>.
 +
 +If I<apcupsd> appears to close the connection due to inactivity quite quickly,
 +the plugin will try to detect this problem and switch to an open-read-close mode.
  
  =back
  
@@@ -1361,32 -1346,6 +1361,32 @@@ at all, B<all> cgroups are selected
  
  =back
  
 +=head2 Plugin C<chrony>
 +
 +The C<chrony> plugin collects ntp data from a B<chronyd> server, such as clock
 +skew and per-peer stratum.
 +
 +For talking to B<chronyd>, it mimics what the B<chronyc> control program does
 +on the wire.
 +
 +Available configuration options for the C<chrony> plugin:
 +
 +=over 4
 +
 +=item B<Host> I<Hostname>
 +
 +Hostname of the host running B<chronyd>. Defaults to B<localhost>.
 +
 +=item B<Port> I<Port>
 +
 +UDP-Port to connect to. Defaults to B<323>.
 +
 +=item B<Timeout> I<Timeout>
 +
 +Connection timeout in seconds. Defaults to B<2>.
 +
 +=back
 +
  =head2 Plugin C<conntrack>
  
  This plugin collects IP conntrack statistics.
@@@ -1407,11 -1366,11 +1407,11 @@@ as Jiffies, using the C<cpu> type. Two 
  
  =over 4
  
 -=item
 +=item *
  
  Sum, per-state, over all CPUs installed in the system; and
  
 -=item
 +=item *
  
  Sum, per-CPU, over all non-idle states of a CPU, creating an "active" state.
  
@@@ -1457,16 -1416,6 +1457,16 @@@ installed) to get the current CPU frequ
  sure B<cpufreqd> (L<http://cpufreqd.sourceforge.net/>) or a similar tool is
  installed and an "cpu governor" (that's a kernel module) is loaded.
  
 +=head2 Plugin C<cpusleep>
 +
 +This plugin doesn't have any options. It reads CLOCK_BOOTTIME and
 +CLOCK_MONOTONIC and reports the difference between these clocks. Since
 +BOOTTIME clock increments while device is suspended and MONOTONIC
 +clock does not, the derivative of the difference between these clocks
 +gives the relative amount of time the device has spent in suspend
 +state. The recorded value is in milliseconds of sleep per seconds of
 +wall clock.
 +
  =head2 Plugin C<csv>
  
  =over 4
@@@ -1487,92 -1436,6 +1487,92 @@@ number
  
  =back
  
 +=head2 cURL Statistics
 +
 +All cURL-based plugins support collection of generic, request-based
 +statistics. These are disabled by default and can be enabled selectively for
 +each page or URL queried from the curl, curl_json, or curl_xml plugins. See
 +the documentation of those plugins for specific information. This section
 +describes the available metrics that can be configured for each plugin. All
 +options are disabled by default.
 +
 +See L<http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html> for more details.
 +
 +=over 4
 +
 +=item B<TotalTime> B<true|false>
 +
 +Total time of the transfer, including name resolving, TCP connect, etc.
 +
 +=item B<NamelookupTime> B<true|false>
 +
 +Time it took from the start until name resolving was completed.
 +
 +=item B<ConnectTime> B<true|false>
 +
 +Time it took from the start until the connect to the remote host (or proxy)
 +was completed.
 +
 +=item B<AppconnectTime> B<true|false>
 +
 +Time it took from the start until the SSL/SSH connect/handshake to the remote
 +host was completed.
 +
 +=item B<PretransferTime> B<true|false>
 +
 +Time it took from the start until just before the transfer begins.
 +
 +=item B<StarttransferTime> B<true|false>
 +
 +Time it took from the start until the first byte was received.
 +
 +=item B<RedirectTime> B<true|false>
 +
 +Time it took for all redirection steps include name lookup, connect,
 +pre-transfer and transfer before final transaction was started.
 +
 +=item B<RedirectCount> B<true|false>
 +
 +The total number of redirections that were actually followed.
 +
 +=item B<SizeUpload> B<true|false>
 +
 +The total amount of bytes that were uploaded.
 +
 +=item B<SizeDownload> B<true|false>
 +
 +The total amount of bytes that were downloaded.
 +
 +=item B<SpeedDownload> B<true|false>
 +
 +The average download speed that curl measured for the complete download.
 +
 +=item B<SpeedUpload> B<true|false>
 +
 +The average upload speed that curl measured for the complete upload.
 +
 +=item B<HeaderSize> B<true|false>
 +
 +The total size of all the headers received.
 +
 +=item B<RequestSize> B<true|false>
 +
 +The total size of the issued requests.
 +
 +=item B<ContentLengthDownload> B<true|false>
 +
 +The content-length of the download.
 +
 +=item B<ContentLengthUpload> B<true|false>
 +
 +The specified size of the upload.
 +
 +=item B<NumConnects> B<true|false>
 +
 +The number of new connections that were created to achieve the transfer.
 +
 +=back
 +
  =head2 Plugin C<curl>
  
  The curl plugin uses the B<libcurl> (L<http://curl.haxx.se/>) to read web pages
@@@ -1673,21 -1536,11 +1673,21 @@@ Beware that requests will get aborted i
  B<Timeout> accordingly if you expect B<MeasureResponseTime> to report such slow
  requests.
  
 +This option is similar to enabling the B<TotalTime> statistic but it's
 +measured by collectd instead of cURL.
 +
  =item B<MeasureResponseCode> B<true>|B<false>
  
  Measure response code for the request. If this setting is enabled, B<Match>
  blocks (see below) are optional. Disabled by default.
  
 +=item B<E<lt>StatisticsE<gt>>
 +
 +One B<Statistics> block can be used to specify cURL statistics to be collected
 +for each request to the remote web site. See the section "cURL Statistics"
 +above for details. If this setting is enabled, B<Match> blocks (see below) are
 +optional.
 +
  =item B<E<lt>MatchE<gt>>
  
  One or more B<Match> blocks that define how to match information in the data
@@@ -1800,12 -1653,6 +1800,12 @@@ URL. By default the global B<Interval> 
  These options behave exactly equivalent to the appropriate options of the
  I<cURL> plugin. Please see there for a detailed description.
  
 +=item B<E<lt>StatisticsE<gt>>
 +
 +One B<Statistics> block can be used to specify cURL statistics to be collected
 +for each request to the remote URL. See the section "cURL Statistics" above
 +for details.
 +
  =back
  
  The following options are valid within B<Key> blocks:
@@@ -1908,12 -1755,6 +1908,12 @@@ Examples
  These options behave exactly equivalent to the appropriate options of the
  I<cURL plugin>. Please see there for a detailed description.
  
 +=item B<E<lt>StatisticsE<gt>>
 +
 +One B<Statistics> block can be used to specify cURL statistics to be collected
 +for each request to the remote URL. See the section "cURL Statistics" above
 +for details.
 +
  =item E<lt>B<XPath> I<XPath-expression>E<gt>
  
  Within each B<URL> block, there must be one or more B<XPath> blocks. Each
@@@ -2411,7 -2252,7 +2411,7 @@@ I<TypeInstance> will be used
  
  =item B<MappedOnly> B<true>|B<false>
  
 -When set to B<true>, only metrics that can be mapped to to a I<type> will be
 +When set to B<true>, only metrics that can be mapped to a I<type> will be
  collected, all other metrics will be ignored. Defaults to B<false>.
  
  =back
@@@ -2641,51 -2482,78 +2641,123 @@@ source, this is optional. Otherwise th
  
  =back
  
 -It waits for data to be available, if none arrives it times out 
+ =head2 Plugin C<gps>
+ The C<gps plugin> connects to gpsd on the host machine.
+ The host, port, timeout and pause are configurable.
+ This is useful if you run an NTP server using a GPS for source and you want to
+ monitor it.
+ Mind your GPS must send $--GSA for having the data reported!
+ The following elements are collected:
+ =over 4
+ =item B<satellites>
+ Number of satellites used for fix (type instance "used") and in view (type
+ instance "visible"). 0 means no GPS satellites are visible.
+ =item B<dilution_of_precision>
+ Vertical and horizontal dilution (type instance "horizontal" or "vertical").
+ It should be between 0 and 3.
+ Look at the documentation of your GPS to know more.
+ =back
+ Synopsis:
+  LoadPlugin gps
+  <Plugin "gps">
+    # Connect to localhost on gpsd regular port:
+    Host "127.0.0.1"
+    Port "2947"
+    # 15 ms timeout
+    Timeout 0.015
+    # PauseConnect of 5 sec. between connection attempts.
+    PauseConnect 5
+  </Plugin>
+ Available configuration options:
+ =over 4
+ =item B<Host> I<Host>
+ The host on which gpsd daemon runs. Defaults to B<localhost>.
+ =item B<Port> I<Port>
+ Port to connect to gpsd on the host machine. Defaults to B<2947>.
+ =item B<Timeout> I<Seconds>
+ Timeout in seconds (default 0.015 sec).
+ The GPS data stream is fetch by the plugin form the daemon.
 -Mind to put a low value gpsd expects value in the micro-seconds area 
++It waits for data to be available, if none arrives it times out
+ and loop for another reading.
 -Value must be between 500 us and 5 sec., if outside that range the 
++Mind to put a low value gpsd expects value in the micro-seconds area
+ (recommended is 500 us) since the waiting function is blocking.
++Value must be between 500 us and 5 sec., if outside that range the
+ default value is applied.
+ This only applies from gpsd release-2.95.
+ =item B<PauseConnect> I<Seconds>
+ Pause to apply between attempts of connection to gpsd in seconds (default 5 sec).
+ =back
 +=head2 Plugin C<grpc>
 +
 +The I<grpc> plugin provides an RPC interface to submit values to or query
 +values from collectd based on the open source gRPC framework. It exposes an
 +end-point for dispatching values to the daemon.
 +
 +The B<gRPC> homepage can be found at L<https://grpc.io/>.
 +
 +=over 4
 +
 +=item B<Listen> I<Host> I<Port>
 +
 +The B<Listen> statement sets the network address to bind to. When multiple
 +statements are specified, the daemon will bind to all of them. If none are
 +specified, it defaults to B<0.0.0.0:50051>.
 +
 +The argument I<Host> may be a hostname, an IPv4 address, or an IPv6 address.
 +
 +Optionally, B<Listen> may be specified as a configuration block which
 +supports the following options:
 +
 +=over 4
 +
 +=item B<EnableSSL> I<true>|I<false>
 +
 +Whether to enable SSL for incoming connections. Default: false.
 +
 +=item B<SSLRootCerts> I<Filename>
 +
 +=item B<SSLServerKey> I<Filename>
 +
 +=item B<SSLServerCert> I<Filename>
 +
 +Filenames specifying SSL certificate and key material to be used with SSL
 +connections.
 +
 +=back
 +
 +=item B<WorkerThreads> I<Num>
 +
 +Number of threads to start for handling incoming connections. The default
 +value is B<5>.
 +
 +=back
 +
  =head2 Plugin C<hddtemp>
  
  To get values from B<hddtemp> collectd connects to B<localhost> (127.0.0.1),
@@@ -2720,7 -2588,7 +2792,7 @@@ a more detailed description see B<Ignor
  
  =item B<IgnoreSelected> I<true>|I<false>
  
 -If no configuration if given, the B<traffic>-plugin will collect data from
 +If no configuration if given, the B<interface>-plugin will collect data from
  all interfaces. This may not be practical, especially for loopback- and
  similar interfaces. Thus, you can use the B<Interface>-option to pick the
  interfaces you're interested in. Sometimes, however, it's easier/preferred
@@@ -2729,46 -2597,6 +2801,46 @@@ do that: By setting B<IgnoreSelected> t
  B<Interface> is inverted: All selected interfaces are ignored and all
  other interfaces are collected.
  
 +It is possible to use regular expressions to match interface names, if the
 +name is surrounded by I</.../> and collectd was compiled with support for
 +regexps. This is useful if there's a need to collect (or ignore) data
 +for a group of interfaces that are similarly named, without the need to
 +explicitly list all of them (especially useful if the list is dynamic).
 +Example:
 +
 + Interface "lo"
 + Interface "/^veth/"
 + Interface "/^tun[0-9]+/"
 + IgnoreSelected "true"
 +
 +This will ignore the loopback interface, all interfaces with names starting
 +with I<veth> and all interfaces with names starting with I<tun> followed by
 +at least one digit.
 +
 +=item B<ReportInactive> I<true>|I<false>
 +
 +When set to I<false>, only interfaces with non-zero traffic will be
 +reported. Note that the check is done by looking into whether a
 +package was sent at any time from boot and the corresponding counter
 +is non-zero. So, if the interface has been sending data in the past
 +since boot, but not during the reported time-interval, it will still
 +be reported.
 +
 +The default value is I<true> and results in collection of the data
 +from all interfaces that are selected by B<Interface> and
 +B<IgnoreSelected> options.
 +
 +=item B<UniqueName> I<true>|I<false>
 +
 +Interface name is not unique on Solaris (KSTAT), interface name is unique
 +only within a module/instance. Following tuple is considered unique:
 +   (ks_module, ks_instance, ks_name)
 +If this option is set to true, interface name contains above three fields
 +separated by an underscore. For more info on KSTAT, visit
 +L<http://docs.oracle.com/cd/E23824_01/html/821-1468/kstat-3kstat.html#REFMAN3Ekstat-3kstat>
 +
 +This option is only available on Solaris.
 +
  =back
  
  =head2 Plugin C<ipmi>
@@@ -2809,13 -2637,9 +2881,13 @@@ a notification is sent
  
  =item B<Chain> I<Table> I<Chain> [I<Comment|Number> [I<Name>]]
  
 -Select the rules to count. If only I<Table> and I<Chain> are given, this plugin
 -will collect the counters of all rules which have a comment-match. The comment
 -is then used as type-instance.
 +=item B<Chain6> I<Table> I<Chain> [I<Comment|Number> [I<Name>]]
 +
 +Select the iptables/ip6tables filter rules to count packets and bytes from.
 +
 +If only I<Table> and I<Chain> are given, this plugin will collect the counters
 +of all rules which have a comment-match. The comment is then used as
 +type-instance.
  
  If I<Comment> or I<Number> is given, only the rule with the matching comment or
  the I<n>th rule will be collected. Again, the comment (or the number) will be
@@@ -3595,38 -3419,6 +3667,38 @@@ Configures the topic(s) to subscribe to
  multi level C<#> wildcards. Defaults to B<collectd/#>, i.e. all topics beneath
  the B<collectd> branch.
  
 +=item B<CACert> I<file>
 +
 +Path to the PEM-encoded CA certificate file. Setting this option enables TLS
 +communication with the MQTT broker, and as such, B<Port> should be the TLS-enabled
 +port of the MQTT broker.
 +A valid TLS configuration requires B<CACert>, B<CertificateFile> and B<CertificateKeyFile>.
 +
 +=item B<CertificateFile> I<file>
 +
 +Path to the PEM-encoded certificate file to use as client certificate when
 +connecting to the MQTT broker.
 +A valid TLS configuration requires B<CACert>, B<CertificateFile> and B<CertificateKeyFile>.
 +
 +=item B<CertificateKeyFile> I<file>
 +
 +Path to the unencrypted PEM-encoded key file corresponding to B<CertificateFile>.
 +A valid TLS configuration requires B<CACert>, B<CertificateFile> and B<CertificateKeyFile>.
 +
 +=item B<TLSProtocol> I<protocol>
 +
 +If configured, this specifies the string protocol version (e.g. C<tlsv1>,
 +C<tlsv1.2>) to use for the TLS connection to the broker. If not set a default
 +version is used which depends on the version of OpenSSL the Mosquitto library
 +was linked against.
 +
 +=item B<CipherSuite> I<ciphersuite>
 +
 +A string describing the ciphers available for use. See L<ciphers(1)> and the
 +C<openssl ciphers> utility for more information. If unset, the default ciphers
 +will be used.
 +
 +
  =back
  
  =head2 Plugin C<mysql>
@@@ -3671,13 -3463,6 +3743,13 @@@ Synopsis
        SlaveStats true
        SlaveNotifications true
      </Database>
 +
 +   <Database galera>
 +      Alias "galera"
 +      Host "localhost"
 +      Socket "/var/run/mysql/mysqld.sock"
 +      WsrepStats true
 +   </Database>
    </Plugin>
  
  A B<Database> block defines one connection to a MySQL database. It accepts a
@@@ -3748,12 -3533,6 +3820,12 @@@ privileges. See the B<User> documentati
  If enabled, the plugin sends a notification if the replication slave I/O and /
  or SQL threads are not running. Defaults to B<false>.
  
 +=item B<WsrepStats> I<true|false>
 + 
 + Enable the collection of wsrep plugin statistics, used in Master-Master
 + replication setups like in MySQL Galera/Percona XtraDB Cluster.
 + User needs only privileges to execute 'SHOW GLOBAL STATUS'
 + 
  =item B<ConnectTimeout> I<Seconds>
  
  Sets the connect timeout for the MySQL client.
@@@ -4697,35 -4476,8 +4769,35 @@@ Default: C<Collectd notify: %s@%s
  
  =back
  
 +=head2 Plugin C<notify_nagios>
 +
 +The I<notify_nagios> plugin writes notifications to Nagios' I<command file> as
 +a I<passive service check result>.
 +
 +Available configuration options:
 +
 +=over 4
 +
 +=item B<CommandFile> I<Path>
 +
 +Sets the I<command file> to write to. Defaults to F</usr/local/nagios/var/rw/nagios.cmd>.
 +
 +=back
 +
  =head2 Plugin C<ntpd>
  
 +The C<ntpd> plugin collects per-peer ntp data such as time offset and time
 +dispersion.
 +
 +For talking to B<ntpd>, it mimics what the B<ntpdc> control program does on
 +the wire - using B<mode 7> specific requests. This mode is deprecated with
 +newer B<ntpd> releases (4.2.7p230 and later). For the C<ntpd> plugin to work
 +correctly with them, the ntp daemon must be explicitly configured to
 +enable B<mode 7> (which is disabled by default). Refer to the I<ntp.conf(5)>
 +manual page for details.
 +
 +Available configuration options for the C<ntpd> plugin:
 +
  =over 4
  
  =item B<Host> I<Hostname>
@@@ -4951,12 -4703,12 +5023,12 @@@ I<mandatory>
  
  =item B<BindDN> I<BindDN>
  
 -Name in the form of an LDAP distinguished name intended to be used for 
 +Name in the form of an LDAP distinguished name intended to be used for
  authentication. Defaults to empty string to establish an anonymous authorization.
  
  =item B<Password> I<Password>
  
 -Password for simple bind authentication. If this option is not set, 
 +Password for simple bind authentication. If this option is not set,
  unauthenticated bind operation is used.
  
  =item B<StartTLS> B<true|false>
@@@ -4980,9 -4732,8 +5052,9 @@@ client configuration mechanisms. See ld
  
  =item B<Timeout> I<Seconds>
  
 -Sets the timeout value for ldap operations. Defaults to B<-1> which results in
 -an infinite timeout.
 +Sets the timeout value for ldap operations, in seconds. By default, the
 +configured B<Interval> is used to set the timeout. Use B<-1> to disable
 +(infinite timeout).
  
  =item B<Version> I<Version>
  
@@@ -5231,13 -4982,6 +5303,13 @@@ Default: B<0.9
  
  Sets the Time-To-Live of generated ICMP packets.
  
 +=item B<Size> I<size>
 +
 +Sets the size of the data payload in ICMP packet to specified I<size> (it
 +will be filled with regular ASCII pattern). If not set, default 56 byte
 +long string is used so that the packet size of an ICMPv4 packet is exactly
 +64 bytes, similar to the behaviour of normal ping(1) command.
 +
  =item B<SourceAddress> I<host>
  
  Sets the source address to use. I<host> may either be a numerical network
@@@ -5345,12 -5089,13 +5417,12 @@@ The B<Query> block defines one databas
  database definition. It accepts a single mandatory argument which specifies
  the name of the query. The names of all queries have to be unique (see the
  B<MinVersion> and B<MaxVersion> options below for an exception to this
 -rule). The following configuration options are available to define the query:
 +rule).
 +
 +In each B<Query> block, there is one or more B<Result> blocks. Multiple
 +B<Result> blocks may be used to extract multiple values from a single query.
  
 -In each B<Query> block, there is one or more B<Result> blocks. B<Result>
 -blocks define how to handle the values returned from the query. They define
 -which column holds which value and how to dispatch that value to the daemon.
 -Multiple B<Result> blocks may be used to extract multiple values from a single
 -query.
 +The following configuration options are available to define the query:
  
  =over 4
  
@@@ -5368,7 -5113,7 +5440,7 @@@ allowed as long as a single non-empty c
  
  The returned lines will be handled separately one after another.
  
 -=item B<Param> I<hostname>|I<database>|I<username>|I<interval>
 +=item B<Param> I<hostname>|I<database>|I<instance>|I<username>|I<interval>
  
  Specify the parameters which should be passed to the SQL query. The parameters
  are referred to in the SQL query as B<$1>, B<$2>, etc. in the same order as
@@@ -5405,34 -5150,6 +5477,34 @@@ specific or global B<Interval> options)
  Please note that parameters are only supported by PostgreSQL's protocol
  version 3 and above which was introduced in version 7.4 of PostgreSQL.
  
 +=item B<PluginInstanceFrom> I<column>
 +
 +Specify how to create the "PluginInstance" for reporting this query results.
 +Only one column is supported. You may concatenate fields and string values in
 +the query statement to get the required results.
 +
 +=item B<MinVersion> I<version>
 +
 +=item B<MaxVersion> I<version>
 +
 +Specify the minimum or maximum version of PostgreSQL that this query should be
 +used with. Some statistics might only be available with certain versions of
 +PostgreSQL. This allows you to specify multiple queries with the same name but
 +which apply to different versions, thus allowing you to use the same
 +configuration in a heterogeneous environment.
 +
 +The I<version> has to be specified as the concatenation of the major, minor
 +and patch-level versions, each represented as two-decimal-digit numbers. For
 +example, version 8.2.3 will become 80203.
 +
 +=back
 +
 +The B<Result> block defines how to handle the values returned from the query.
 +It defines which column holds which value and how to dispatch that value to
 +the daemon.
 +
 +=over 4
 +
  =item B<Type> I<type>
  
  The I<type> name to be used when dispatching the values. The type describes
@@@ -5440,7 -5157,7 +5512,7 @@@ how to handle the data and where to sto
  details on types and their configuration. The number and type of values (as
  selected by the B<ValuesFrom> option) has to match the type of the given name.
  
 -This option is required inside a B<Result> block.
 +This option is mandatory.
  
  =item B<InstancePrefix> I<prefix>
  
@@@ -5476,6 -5193,20 +5548,6 @@@ This option is required inside a B<Resu
  times. If multiple B<ValuesFrom> options are specified, the columns are read
  in the given order.
  
 -=item B<MinVersion> I<version>
 -
 -=item B<MaxVersion> I<version>
 -
 -Specify the minimum or maximum version of PostgreSQL that this query should be
 -used with. Some statistics might only be available with certain versions of
 -PostgreSQL. This allows you to specify multiple queries with the same name but
 -which apply to different versions, thus allowing you to use the same
 -configuration in a heterogeneous environment.
 -
 -The I<version> has to be specified as the concatenation of the major, minor
 -and patch-level versions, each represented as two-decimal-digit numbers. For
 -example, version 8.2.3 will become 80203.
 -
  =back
  
  The following predefined queries are available (the definitions can be found
@@@ -5645,8 -5376,6 +5717,8 @@@ Specify the plugin instance name that s
  name (which is the default, if this option has not been specified). This
  allows to query multiple databases of the same name on the same host (e.g.
  when running multiple database server versions in parallel).
 +The plugin instance name can also be set from the query result using
 +the B<PluginInstanceFrom> option in B<Query> block.
  
  =item B<Host> I<hostname>
  
@@@ -5901,9 -5630,6 +5973,9 @@@ collected for these selected processes 
  (RSS), user- and system-time used, number of processes and number of threads,
  io data (where available) and minor and major pagefaults.
  
 +Some platforms have a limit on the length of process names. I<Name> must stay
 +below this limit.
 +
  =item B<ProcessMatch> I<name> I<regex>
  
  Similar to the B<Process> option this allows to select more detailed
@@@ -6383,12 -6109,6 +6455,12 @@@ few ones. This option enables you to d
  I<true> the effect of B<Sensor> is inverted: All selected sensors are ignored
  and all other sensors are collected.
  
 +=item B<UseLabels> I<true>|I<false>
 +
 +Configures how sensor readings are reported. When set to I<true>, sensor
 +readings are reported using their descriptive label (e.g. "VCore"). When set to
 +I<false> (the default) the sensor name is used ("in0").
 +
  =back
  
  =head2 Plugin C<sigrok>
@@@ -6491,22 -6211,6 +6563,22 @@@ collected. If at least one B<Disk> opti
  set to B<false>, B<only> matching disks will be collected. If B<IgnoreSelected>
  is set to B<true>, all disks are collected B<except> the ones matched.
  
 +=item B<IgnoreSleepMode> B<true>|B<false>
 +
 +Normally, the C<smart> plugin will ignore disks that are reported to be asleep.
 +This option disables the sleep mode check and allows the plugin to collect data
 +from these disks anyway. This is useful in cases where libatasmart mistakenly
 +reports disks as asleep because it has not been updated to incorporate support
 +for newer idle states in the ATA spec.
 +
 +=item B<UseSerial> B<true>|B<false>
 +
 +A disk's kernel name (e.g., sda) can change from one boot to the next. If this
 +option is enabled, the C<smart> plugin will use the disk's serial number (e.g.,
 +HGST_HUH728080ALE600_2EJ8VH8X) instead of the kernel name as the key for
 +storing data. This ensures that the data for a given disk will be kept together
 +even if the kernel name changes.
 +
  =back
  
  =head2 Plugin C<snmp>
@@@ -6553,12 -6257,6 +6625,12 @@@ rate of counters and size of sets will 
  are unchanged. If set to B<True>, the such metrics are not dispatched and
  removed from the internal cache.
  
 +=item B<CounterSum> B<false>|B<true>
 +
 +When enabled, creates a C<count> metric which reports the change since the last
 +read. This option primarily exists for compatibility with the I<statsd>
 +implementation by Etsy.
 +
  =item B<TimerPercentile> I<Percent>
  
  Calculate and dispatch the configured percentile, i.e. compute the latency, so
@@@ -7072,7 -6770,7 +7144,7 @@@ port in numeric form
  =item B<AllPortsSummary> I<true>|I<false>
  
  If this option is set to I<true> a summary of statistics from all connections
 -are collectd. This option defaults to I<false>.
 +are collected. This option defaults to I<false>.
  
  =back
  
@@@ -7167,13 -6865,13 +7239,13 @@@ fails or if you want to disable this fe
  =item B<DigitalTemperatureSensor> I<true>|I<false>
  
  Boolean enabling the collection of the temperature of each core.
 -This option should only be used if the automated detectionfails or 
 +This option should only be used if the automated detectionfails or
  if you want to disable this feature.
  
  =item B<DigitalTemperatureSensor> I<true>|I<false>
  
  Boolean enabling the collection of the temperature of each package.
 -This option should only be used if the automated detectionfails or 
 +This option should only be used if the automated detectionfails or
  if you want to disable this feature.
  
  =item B<TCCActivationTemp> I<Temperature>
@@@ -7244,20 -6942,20 +7316,20 @@@ The following methods are used to find 
  
  =over 4
  
 -=item
 +=item *
  
  Check I</etc/uuid> (or I<UUIDFile>).
  
 -=item
 +=item *
  
  Check for UUID from HAL (L<http://www.freedesktop.org/wiki/Software/hal>) if
  present.
  
 -=item
 +=item *
  
  Check for UUID from C<dmidecode> / SMBIOS.
  
 -=item
 +=item *
  
  Check for UUID from Xen hypervisor.
  
@@@ -7598,14 -7296,6 +7670,14 @@@ Service name or port number to connect 
  
  Protocol to use when connecting to I<Graphite>. Defaults to C<tcp>.
  
 +=item B<ReconnectInterval> I<Seconds>
 +
 +When set to non-zero, forces the connection to the Graphite backend to be
 +closed and re-opend periodically. This behavior is desirable in environments
 +where the connection to the Graphite backend is done through load balancers,
 +for example. When set to zero, the default, the connetion is kept open for as
 +long as possible.
 +
  =item B<LogSendErrors> B<false>|B<true>
  
  If set to B<true> (the default), logs errors when sending data to I<Graphite>.
@@@ -7832,35 -7522,20 +7904,35 @@@ authentication
  
  Password required to load the private key in B<ClientKey>.
  
 +=item B<Header> I<Header>
 +
 +A HTTP header to add to the request.  Multiple headers are added if this option is specified more than once.  Example:
 +
 +  Header "X-Custom-Header: custom_value"
 +
  =item B<SSLVersion> B<SSLv2>|B<SSLv3>|B<TLSv1>|B<TLSv1_0>|B<TLSv1_1>|B<TLSv1_2>
  
  Define which SSL protocol version must be used. By default C<libcurl> will
  attempt to figure out the remote SSL protocol version. See
  L<curl_easy_setopt(3)> for more details.
  
 -=item B<Format> B<Command>|B<JSON>
 +=item B<Format> B<Command>|B<JSON>|B<KAIROSDB>
  
  Format of the output to generate. If set to B<Command>, will create output that
  is understood by the I<Exec> and I<UnixSock> plugins. When set to B<JSON>, will
 -create output in the I<JavaScript Object Notation> (JSON).
 +create output in the I<JavaScript Object Notation> (JSON). When set to KAIROSDB
 +, will create output in the KairosDB format.
  
  Defaults to B<Command>.
  
 +=item B<Metrics> B<true>|B<false>
 +
 +Controls whether I<metrics> are POSTed to this location. Defaults to B<true>.
 +
 +=item B<Notifications> B<false>|B<true>
 +
 +Controls whether I<notifications> are POSTed to this location. Defaults to B<false>.
 +
  =item B<StoreRates> B<true|false>
  
  If set to B<true>, convert counter values to rates. If set to B<false> (the
@@@ -8133,26 -7808,11 +8205,26 @@@ Hostname or address to connect to. Defa
  
  Service name or port number to connect to. Defaults to C<5555>.
  
 -=item B<Protocol> B<UDP>|B<TCP>
 +=item B<Protocol> B<UDP>|B<TCP>|B<TLS>
  
  Specify the protocol to use when communicating with I<Riemann>. Defaults to
  B<TCP>.
  
 +=item B<TLSCertFile> I<Path>
 +
 +When using the B<TLS> protocol, path to a PEM certificate to present
 +to remote host.
 +
 +=item B<TLSCAFile> I<Path>
 +
 +When using the B<TLS> protocol, path to a PEM CA certificate to
 +use to validate the remote hosts's identity.
 +
 +=item B<TLSKeyFile> I<Path>
 +
 +When using the B<TLS> protocol, path to a PEM private key associated
 +with the certificate defined by B<TLSCertFile>.
 +
  =item B<Batch> B<true>|B<false>
  
  If set to B<true> and B<Protocol> is set to B<TCP>,
@@@ -8172,11 -7832,6 +8244,11 @@@ Defaults to tru
  
  Maximum payload size for a riemann packet. Defaults to 8192
  
 +=item B<BatchFlushTimeout> I<seconds>
 +
 +Maximum amount of seconds to wait in between to batch flushes.
 +No timeout by default.
 +
  =item B<StoreRates> B<true>|B<false>
  
  If set to B<true> (the default), convert counter values to rates. If set to
@@@ -8343,14 -7998,6 +8415,14 @@@ attribute for each metric being sent ou
  
  =back
  
 +=head2 Plugin C<xencpu>
 +
 +This plugin collects metrics of hardware CPU load for machine running Xen
 +hypervisor. Load is calculated from 'idle time' value, provided by Xen.
 +Result is reported using the C<percent> type, for each CPU (core).
 +
 +This plugin doesn't have any options (yet).
 +
  =head2 Plugin C<zookeeper>
  
  The I<zookeeper plugin> will collect statistics from a I<Zookeeper> server
@@@ -9248,8 -8895,6 +9320,8 @@@ Available options
  
  =item B<TypeInstance> I<String>
  
 +=item B<MetaDataSet> I<String> I<String>
 +
  Set the appropriate field to the given string. The strings for plugin instance
  and type instance may be empty, the strings for host and plugin may not be
  empty. It's currently not possible to set the type of a value this way.
diff --combined src/gps.c
index 0000000,e43af4a..04de5aa
mode 000000,100644..100644
--- /dev/null
+++ b/src/gps.c
@@@ -1,0 -1,368 +1,368 @@@
 -  ) 
+ /**
+  * collectd - src/gps.c
+  * Copyright (C) 2015  Nicolas JOURDEN
+  *
+  * Permission is hereby granted, free of charge, to any person obtaining a
+  * copy of this software and associated documentation files (the "Software"),
+  * to deal in the Software without restriction, including without limitation
+  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+  * and/or sell copies of the Software, and to permit persons to whom the
+  * Software is furnished to do so, subject to the following conditions:
+  *
+  * The above copyright notice and this permission notice shall be included in
+  * all copies or substantial portions of the Software.
+  *
+  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+  * DEALINGS IN THE SOFTWARE.
+  *
+  * Authors:
+  *   Nicolas JOURDEN <nicolas.jourden at laposte.net>
+  *   Florian octo Forster <octo at collectd.org>
+  *   Marc Fournier <marc.fournier at camptocamp.com>
+  **/
+ #include "collectd.h"
+ #include "common.h"
+ #include "plugin.h"
+ #include "utils_time.h"
+ #include "configfile.h"
+ #define CGPS_TRUE                  1
+ #define CGPS_FALSE                 0
+ #define CGPS_DEFAULT_HOST          "localhost"
+ #define CGPS_DEFAULT_PORT          "2947" /* DEFAULT_GPSD_PORT */
+ #define CGPS_DEFAULT_TIMEOUT       MS_TO_CDTIME_T (15)
+ #define CGPS_DEFAULT_PAUSE_CONNECT TIME_T_TO_CDTIME_T (5)
+ #define CGPS_MAX_ERROR             100
+ #define CGPS_CONFIG                "?WATCH={\"enable\":true,\"json\":true,\"nmea\":false}\r\n"
+ #include <gps.h>
+ #include <pthread.h>
+ typedef struct {
+   char *host;
+   char *port;
+   cdtime_t timeout;
+   cdtime_t pause_connect;
+ } cgps_config_t;
+ typedef struct {
+   gauge_t sats_used;
+   gauge_t sats_visible;
+   gauge_t hdop;
+   gauge_t vdop;
+ } cgps_data_t;
+ static cgps_config_t cgps_config_data;
+ static cgps_data_t cgps_data = {NAN, NAN, NAN, NAN};
+ static pthread_t cgps_thread_id;
+ static pthread_mutex_t  cgps_data_lock = PTHREAD_MUTEX_INITIALIZER;
+ static pthread_mutex_t  cgps_thread_lock = PTHREAD_MUTEX_INITIALIZER;
+ static int cgps_thread_shutdown = CGPS_FALSE;
+ static int cgps_thread_running = CGPS_FALSE;
+ /**
+  * Non blocking pause for the thread.
+  */
+ static int cgps_thread_pause(cdtime_t pTime)
+ {
+   cdtime_t now;
+   now = cdtime ();
+   struct timespec pause_th;
+   CDTIME_T_TO_TIMESPEC (MS_TO_CDTIME_T(10), &pause_th);
+   while (CGPS_TRUE)
+   {
+     if ( (cdtime () - now) > pTime )
+     {
+       break;
+     }
+     pthread_mutex_lock (&cgps_thread_lock);
+     if (cgps_thread_shutdown == CGPS_TRUE)
+     {
+       return CGPS_FALSE;
+     }
+     pthread_mutex_unlock (&cgps_thread_lock);
+     nanosleep (&pause_th, NULL);
+  }
+  return CGPS_TRUE;
+ }
+ /**
+  * Thread reading from gpsd.
+  */
+ static void * cgps_thread (void * pData)
+ {
+   struct gps_data_t gpsd_conn;
+   unsigned int err_count;
+   cgps_thread_running = CGPS_TRUE;
+   while (CGPS_TRUE)
+   {
+     pthread_mutex_lock (&cgps_thread_lock);
+     if (cgps_thread_shutdown == CGPS_TRUE)
+     {
+       goto quit;
+     }
+     pthread_mutex_unlock (&cgps_thread_lock);
+     err_count = 0;
+ #if GPSD_API_MAJOR_VERSION > 4
+     int status = gps_open (cgps_config_data.host, cgps_config_data.port, &gpsd_conn);
+ #else
+     int status = gps_open_r (cgps_config_data.host, cgps_config_data.port, &gpsd_conn);
+ #endif
+     if (status < 0)
+     {
+       WARNING ("gps plugin: connecting to %s:%s failed: %s",
+                cgps_config_data.host, cgps_config_data.port, gps_errstr (status));
+       // Here we make a pause until a new tentative to connect, we check also if
+       // the thread does not need to stop.
+       if (cgps_thread_pause(cgps_config_data.pause_connect) == CGPS_FALSE)
+       {
+         goto quit;
+       }
+       continue;
+     }
+     gps_stream (&gpsd_conn, WATCH_ENABLE | WATCH_JSON | WATCH_NEWSTYLE, NULL);
+     gps_send (&gpsd_conn, CGPS_CONFIG);
+     while (CGPS_TRUE)
+     {
+       pthread_mutex_lock (&cgps_thread_lock);
+       if (cgps_thread_shutdown == CGPS_TRUE)
+       {
+         goto stop;
+       }
+       pthread_mutex_unlock (&cgps_thread_lock);
+ #if GPSD_API_MAJOR_VERSION > 4
+       long timeout_us = CDTIME_T_TO_US (cgps_config_data.timeout);
+       if (!gps_waiting (&gpsd_conn, (int) timeout_us ))
+ #else
+       if (!gps_waiting (&gpsd_conn))
+ #endif
+       {
+         continue;
+       }
+       if (gps_read (&gpsd_conn) == -1)
+       {
+         WARNING ("gps plugin: incorrect data! (err_count: %d)", err_count);
+         err_count++;
+         if (err_count > CGPS_MAX_ERROR)
+         {
+           // Server is not responding ...
+           if (gps_send (&gpsd_conn, CGPS_CONFIG) == -1)
+           {
+             WARNING ("gps plugin: gpsd seems to be down, reconnecting");
+             gps_close (&gpsd_conn);
+             break;
+           }
+           // Server is responding ...
+           else
+           {
+             err_count = 0;
+           }
+         }
+         continue;
+       }
+       pthread_mutex_lock (&cgps_data_lock);
+       // Number of sats in view:
+       cgps_data.sats_used = (gauge_t) gpsd_conn.satellites_used;
+       cgps_data.sats_visible = (gauge_t) gpsd_conn.satellites_visible;
+       // dilution of precision:
+       cgps_data.vdop = NAN;
+       cgps_data.hdop = NAN;
+       if (cgps_data.sats_used > 0)
+       {
+         cgps_data.hdop = gpsd_conn.dop.hdop;
+         cgps_data.vdop = gpsd_conn.dop.vdop;
+       }
+       DEBUG ("gps plugin: %.0f sats used (of %.0f visible), hdop = %.3f, vdop = %.3f",
+              cgps_data.sats_used, cgps_data.sats_visible, cgps_data.hdop, cgps_data.vdop);
+       pthread_mutex_unlock (&cgps_data_lock);
+     }
+   }
+ stop:
+   DEBUG ("gps plugin: thread closing gpsd connection ... ");
+   gps_stream (&gpsd_conn, WATCH_DISABLE, NULL);
+   gps_close (&gpsd_conn);
+ quit:
+   DEBUG ("gps plugin: thread shutting down ... ");
+   cgps_thread_running = CGPS_FALSE;
+   pthread_mutex_unlock (&cgps_thread_lock);
+   pthread_exit (NULL);
+ }
+ /**
+  * Submit a piece of the data.
+  */
+ static void cgps_submit (const char *type, gauge_t value, const char *type_instance)
+ {
+   value_t values[1];
+   value_list_t vl = VALUE_LIST_INIT;
+   values[0].gauge = value;
+   vl.values = values;
+   vl.values_len = 1;
+   sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+   sstrncpy (vl.plugin, "gps", sizeof (vl.plugin));
+   sstrncpy (vl.type, type, sizeof (vl.type));
+   sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
+   plugin_dispatch_values (&vl);
+ }
+ /**
+  * Read the data and submit by piece.
+  */
+ static int cgps_read ()
+ {
+   cgps_data_t data_copy;
+   pthread_mutex_lock (&cgps_data_lock);
+   data_copy = cgps_data;
+   pthread_mutex_unlock (&cgps_data_lock);
+   cgps_submit ("dilution_of_precision", data_copy.hdop, "horizontal");
+   cgps_submit ("dilution_of_precision", data_copy.vdop, "vertical");
+   cgps_submit ("satellites", data_copy.sats_used, "used");
+   cgps_submit ("satellites", data_copy.sats_visible, "visible");
+   return (0);
+ }
+ /**
+  * Read configuration.
+  */
+ static int cgps_config (oconfig_item_t *ci)
+ {
+   int i;
+   for (i = 0; i < ci->children_num; i++)
+   {
+     oconfig_item_t *child = ci->children + i;
+     if (strcasecmp ("Host", child->key) == 0)
+       cf_util_get_string (child, &cgps_config_data.host);
+     else if (strcasecmp ("Port", child->key) == 0)
+       cf_util_get_service (child, &cgps_config_data.port);
+     else if (strcasecmp ("Timeout", child->key) == 0)
+       cf_util_get_cdtime (child, &cgps_config_data.timeout);
+     else if (strcasecmp ("PauseConnect", child->key) == 0)
+       cf_util_get_cdtime (child, &cgps_config_data.pause_connect);
+     else
+       WARNING ("gps plugin: Ignoring unknown config option \"%s\".", child->key);
+   }
+   // Controlling the value for timeout:
+   // If set too high it blocks the reading (> 5 s), too low it gets not reading (< 500 us).
+   // To avoid any issues we replace "out of range" value by the default value.
+   if (
+     cgps_config_data.timeout > TIME_T_TO_CDTIME_T(5)
+     ||
+     cgps_config_data.timeout < US_TO_CDTIME_T(500)
 -    WARNING ("gps plugin: timeout set to %.6f sec. setting to default (%.6f).", 
++  )
+   {
 -  } 
++    WARNING ("gps plugin: timeout set to %.6f sec. setting to default (%.6f).",
+       CDTIME_T_TO_DOUBLE(cgps_config_data.timeout),
+       CDTIME_T_TO_DOUBLE(CGPS_DEFAULT_TIMEOUT)
+     );
+     cgps_config_data.timeout = CGPS_DEFAULT_TIMEOUT;
++  }
+   return (0);
+ }
+ /**
+  * Init.
+  */
+ static int cgps_init (void)
+ {
+   int status;
+   if (cgps_thread_running == CGPS_TRUE)
+   {
+     DEBUG ("gps plugin: error gps thread already running ... ");
+     return 0;
+   }
+   DEBUG ("gps plugin: config{host: \"%s\", port: \"%s\", timeout: %.6f sec., pause connect: %.3f sec.}",
+          cgps_config_data.host, cgps_config_data.port,
+          CDTIME_T_TO_DOUBLE (cgps_config_data.timeout),
+          CDTIME_T_TO_DOUBLE (cgps_config_data.pause_connect));
+   status = plugin_thread_create (&cgps_thread_id, NULL, cgps_thread, NULL);
+   if (status != 0)
+   {
+     ERROR ("gps plugin: pthread_create() failed.");
+     return (-1);
+   }
+   return (0);
+ }
+ /**
+  * Shutdown.
+  */
+ static int cgps_shutdown (void)
+ {
+   void * res;
+   pthread_mutex_lock (&cgps_thread_lock);
+   cgps_thread_shutdown = CGPS_TRUE;
+   pthread_mutex_unlock (&cgps_thread_lock);
+   pthread_join(cgps_thread_id, &res);
+   free(res);
+   // Clean mutex:
+   pthread_mutex_unlock(&cgps_thread_lock);
+   pthread_mutex_destroy(&cgps_thread_lock);
+   pthread_mutex_unlock(&cgps_data_lock);
+   pthread_mutex_destroy(&cgps_data_lock);
+   sfree (cgps_config_data.port);
+   sfree (cgps_config_data.host);
+   return (0);
+ }
+ /**
+  * Register the module.
+  */
+ void module_register (void)
+ {
+   cgps_config_data.host = sstrdup (CGPS_DEFAULT_HOST);
+   cgps_config_data.port = sstrdup (CGPS_DEFAULT_PORT);
+   cgps_config_data.timeout = CGPS_DEFAULT_TIMEOUT;
+   cgps_config_data.pause_connect = CGPS_DEFAULT_PAUSE_CONNECT;
+   plugin_register_complex_config ("gps", cgps_config);
+   plugin_register_init ("gps", cgps_init);
+   plugin_register_read ("gps", cgps_read);
+   plugin_register_shutdown ("gps", cgps_shutdown);
+ }
diff --combined src/types.db
 -absolute              value:ABSOLUTE:0:U
 -apache_bytes          value:DERIVE:0:U
 -apache_connections    value:GAUGE:0:65535
 -apache_idle_workers   value:GAUGE:0:65535
 -apache_requests               value:DERIVE:0:U
 -apache_scoreboard     value:GAUGE:0:65535
 -ath_nodes             value:GAUGE:0:65535
 -ath_stat              value:DERIVE:0:U
 -backends              value:GAUGE:0:65535
 -bitrate                       value:GAUGE:0:4294967295
 -blocked_clients value:GAUGE:0:U
 -bytes                 value:GAUGE:0:U
 -cache_eviction                value:DERIVE:0:U
 -cache_operation               value:DERIVE:0:U
 -cache_ratio           value:GAUGE:0:100
 -cache_result          value:DERIVE:0:U
 -cache_size            value:GAUGE:0:1125899906842623
 -capacity      value:GAUGE:0:U
 -ceph_bytes            value:GAUGE:U:U
 -ceph_latency  value:GAUGE:U:U
 -ceph_rate                     value:DERIVE:0:U
 -changes_since_last_save   value:GAUGE:0:U
 -charge                        value:GAUGE:0:U
 -compression_ratio     value:GAUGE:0:2
 -compression           uncompressed:DERIVE:0:U, compressed:DERIVE:0:U
 -connections           value:DERIVE:0:U
 -conntrack             value:GAUGE:0:4294967295
 -contextswitch         value:DERIVE:0:U
 -count                 value:GAUGE:0:U
 -counter                       value:COUNTER:U:U
 -cpufreq                       value:GAUGE:0:U
 -cpu                   value:DERIVE:0:U
 -current_connections   value:GAUGE:0:U
 -current_sessions      value:GAUGE:0:U
 -current                       value:GAUGE:U:U
 -delay                 value:GAUGE:-1000000:1000000
 -derive                        value:DERIVE:0:U
 -df_complex            value:GAUGE:0:U
 -df_inodes             value:GAUGE:0:U
 -df                    used:GAUGE:0:1125899906842623, free:GAUGE:0:1125899906842623
 -disk_latency          read:GAUGE:0:U, write:GAUGE:0:U
 -disk_merged           read:DERIVE:0:U, write:DERIVE:0:U
 -disk_octets           read:DERIVE:0:U, write:DERIVE:0:U
 -disk_ops_complex      value:DERIVE:0:U
 -disk_ops              read:DERIVE:0:U, write:DERIVE:0:U
 -disk_time             read:DERIVE:0:U, write:DERIVE:0:U
 -disk_io_time          io_time:DERIVE:0:U, weighted_io_time:DERIVE:0:U
 -dns_answer            value:DERIVE:0:U
 -dns_notify            value:DERIVE:0:U
 -dns_octets            queries:DERIVE:0:U, responses:DERIVE:0:U
 -dns_opcode            value:DERIVE:0:U
 -dns_qtype_cached      value:GAUGE:0:4294967295
 -dns_qtype             value:DERIVE:0:U
 -dns_query             value:DERIVE:0:U
 -dns_question          value:DERIVE:0:U
 -dns_rcode             value:DERIVE:0:U
 -dns_reject            value:DERIVE:0:U
 -dns_request           value:DERIVE:0:U
 -dns_resolver          value:DERIVE:0:U
 -dns_response          value:DERIVE:0:U
 -dns_transfer          value:DERIVE:0:U
 -dns_update            value:DERIVE:0:U
 -dns_zops              value:DERIVE:0:U
 -drbd_resource value:DERIVE:0:U
 -duration              seconds:GAUGE:0:U
 -email_check           value:GAUGE:0:U
 -email_count           value:GAUGE:0:U
 -email_size            value:GAUGE:0:U
 -entropy                       value:GAUGE:0:4294967295
 -expired_keys    value:GAUGE:0:U
 -fanspeed              value:GAUGE:0:U
 -file_handles          value:GAUGE:0:U
 -file_size             value:GAUGE:0:U
 -files                 value:GAUGE:0:U
 -flow                  value:GAUGE:0:U
 -fork_rate             value:DERIVE:0:U
 -frequency_offset      value:GAUGE:-1000000:1000000
 -frequency             value:GAUGE:0:U
 -fscache_stat          value:DERIVE:0:U
 -gauge                 value:GAUGE:U:U
 -satellites            value:GAUGE:0:U
 -dilution_of_precision value:GAUGE:0:U
 -hash_collisions               value:DERIVE:0:U
 -http_request_methods  value:DERIVE:0:U
 -http_requests         value:DERIVE:0:U
 -http_response_codes   value:DERIVE:0:U
 -humidity              value:GAUGE:0:100
 -if_collisions         value:DERIVE:0:U
 -if_dropped            rx:DERIVE:0:U, tx:DERIVE:0:U
 -if_errors             rx:DERIVE:0:U, tx:DERIVE:0:U
 -if_multicast          value:DERIVE:0:U
 -if_octets             rx:DERIVE:0:U, tx:DERIVE:0:U
 -if_packets            rx:DERIVE:0:U, tx:DERIVE:0:U
 -if_rx_errors          value:DERIVE:0:U
 -if_rx_octets          value:DERIVE:0:U
 -if_tx_errors          value:DERIVE:0:U
 -if_tx_octets          value:DERIVE:0:U
 -invocations           value:DERIVE:0:U
 -io_octets             rx:DERIVE:0:U, tx:DERIVE:0:U
 -io_packets            rx:DERIVE:0:U, tx:DERIVE:0:U
 -ipt_bytes             value:DERIVE:0:U
 -ipt_packets           value:DERIVE:0:U
 -irq                   value:DERIVE:0:U
 -latency                       value:GAUGE:0:U
 -links                 value:GAUGE:0:U
 -load                  shortterm:GAUGE:0:5000, midterm:GAUGE:0:5000, longterm:GAUGE:0:5000
 -md_disks              value:GAUGE:0:U
 -memcached_command     value:DERIVE:0:U
 -memcached_connections value:GAUGE:0:U
 -memcached_items               value:GAUGE:0:U
 -memcached_octets      rx:DERIVE:0:U, tx:DERIVE:0:U
 -memcached_ops         value:DERIVE:0:U
 -memory                        value:GAUGE:0:281474976710656
 -memory_lua            value:GAUGE:0:281474976710656
 -multimeter            value:GAUGE:U:U
 -mutex_operations      value:DERIVE:0:U
 -mysql_commands                value:DERIVE:0:U
 -mysql_handler         value:DERIVE:0:U
 -mysql_locks           value:DERIVE:0:U
 -mysql_log_position    value:DERIVE:0:U
 -mysql_octets          rx:DERIVE:0:U, tx:DERIVE:0:U
 -mysql_bpool_pages     value:GAUGE:0:U
 -mysql_bpool_bytes     value:GAUGE:0:U
 -mysql_bpool_counters  value:DERIVE:0:U
 -mysql_innodb_data     value:DERIVE:0:U
 -mysql_innodb_dblwr    value:DERIVE:0:U
 -mysql_innodb_log      value:DERIVE:0:U
 -mysql_innodb_pages    value:DERIVE:0:U
 -mysql_innodb_row_lock value:DERIVE:0:U
 -mysql_innodb_rows     value:DERIVE:0:U
 -mysql_select          value:DERIVE:0:U
 -mysql_sort            value:DERIVE:0:U
 -nfs_procedure         value:DERIVE:0:U
 -nginx_connections     value:GAUGE:0:U
 -nginx_requests                value:DERIVE:0:U
 -node_octets           rx:DERIVE:0:U, tx:DERIVE:0:U
 -node_rssi             value:GAUGE:0:255
 -node_stat             value:DERIVE:0:U
 -node_tx_rate          value:GAUGE:0:127
 -objects                       value:GAUGE:0:U
 -operations            value:DERIVE:0:U
 -packets                       value:DERIVE:0:U
 -pending_operations    value:GAUGE:0:U
 -percent                       value:GAUGE:0:100.1
 -percent_bytes         value:GAUGE:0:100.1
 -percent_inodes                value:GAUGE:0:100.1
 -pf_counters           value:DERIVE:0:U
 -pf_limits             value:DERIVE:0:U
 -pf_source             value:DERIVE:0:U
 -pf_states             value:GAUGE:0:U
 -pf_state              value:DERIVE:0:U
 -pg_blks                       value:DERIVE:0:U
 -pg_db_size            value:GAUGE:0:U
 -pg_n_tup_c            value:DERIVE:0:U
 -pg_n_tup_g            value:GAUGE:0:U
 -pg_numbackends                value:GAUGE:0:U
 -pg_scan                       value:DERIVE:0:U
 -pg_xact                       value:DERIVE:0:U
 -ping_droprate         value:GAUGE:0:100
 -ping_stddev           value:GAUGE:0:65535
 -ping                  value:GAUGE:0:65535
 -players                       value:GAUGE:0:1000000
 -power                 value:GAUGE:0:U
 -pressure                      value:GAUGE:0:U
 -protocol_counter      value:DERIVE:0:U
 -ps_code                       value:GAUGE:0:9223372036854775807
 -ps_count              processes:GAUGE:0:1000000, threads:GAUGE:0:1000000
 -ps_cputime            user:DERIVE:0:U, syst:DERIVE:0:U
 -ps_data                       value:GAUGE:0:9223372036854775807
 -ps_disk_octets                read:DERIVE:0:U, write:DERIVE:0:U
 -ps_disk_ops           read:DERIVE:0:U, write:DERIVE:0:U
 -ps_pagefaults         minflt:DERIVE:0:U, majflt:DERIVE:0:U
 -ps_rss                        value:GAUGE:0:9223372036854775807
 -ps_stacksize          value:GAUGE:0:9223372036854775807
 -ps_state              value:GAUGE:0:65535
 -ps_vm                 value:GAUGE:0:9223372036854775807
 -pubsub        value:GAUGE:0:U
 -queue_length          value:GAUGE:0:U
 -records                       value:GAUGE:0:U
 -requests              value:GAUGE:0:U
 -response_time         value:GAUGE:0:U
 -response_code         value:GAUGE:0:U
 -route_etx             value:GAUGE:0:U
 -route_metric          value:GAUGE:0:U
 -routes                        value:GAUGE:0:U
 -segments              value:GAUGE:0:65535
 -serial_octets         rx:DERIVE:0:U, tx:DERIVE:0:U
 -signal_noise          value:GAUGE:U:0
 -signal_power          value:GAUGE:U:0
 -signal_quality                value:GAUGE:0:U
 -smart_poweron         value:GAUGE:0:U
 -smart_powercycles     value:GAUGE:0:U
 -smart_badsectors      value:GAUGE:0:U
 -smart_temperature     value:GAUGE:-300:300
 +absolute                value:ABSOLUTE:0:U
 +apache_bytes            value:DERIVE:0:U
 +apache_connections      value:GAUGE:0:65535
 +apache_idle_workers     value:GAUGE:0:65535
 +apache_requests         value:DERIVE:0:U
 +apache_scoreboard       value:GAUGE:0:65535
 +ath_nodes               value:GAUGE:0:65535
 +ath_stat                value:DERIVE:0:U
 +backends                value:GAUGE:0:65535
 +bitrate                 value:GAUGE:0:4294967295
 +blocked_clients         value:GAUGE:0:U
 +bytes                   value:GAUGE:0:U
 +cache_eviction          value:DERIVE:0:U
 +cache_operation         value:DERIVE:0:U
 +cache_ratio             value:GAUGE:0:100
 +cache_result            value:DERIVE:0:U
 +cache_size              value:GAUGE:0:1125899906842623
 +capacity                value:GAUGE:0:U
 +ceph_bytes              value:GAUGE:U:U
 +ceph_latency            value:GAUGE:U:U
 +ceph_rate               value:DERIVE:0:U
 +changes_since_last_save value:GAUGE:0:U
 +charge                  value:GAUGE:0:U
 +clock_last_meas         value:GAUGE:0:U
 +clock_last_update       value:GAUGE:U:U
 +clock_mode              value:GAUGE:0:U
 +clock_reachability      value:GAUGE:0:U
 +clock_skew_ppm          value:GAUGE:-2:2
 +clock_state             value:GAUGE:0:U
 +clock_stratum           value:GAUGE:0:U
 +compression             uncompressed:DERIVE:0:U, compressed:DERIVE:0:U
 +compression_ratio       value:GAUGE:0:2
 +connections             value:DERIVE:0:U
 +conntrack               value:GAUGE:0:4294967295
 +contextswitch           value:DERIVE:0:U
 +count                   value:GAUGE:0:U
 +counter                 value:COUNTER:U:U
 +cpu                     value:DERIVE:0:U
 +cpufreq                 value:GAUGE:0:U
 +current                 value:GAUGE:U:U
 +current_connections     value:GAUGE:0:U
 +current_sessions        value:GAUGE:0:U
 +delay                   value:GAUGE:-1000000:1000000
 +derive                  value:DERIVE:0:U
 +df                      used:GAUGE:0:1125899906842623, free:GAUGE:0:1125899906842623
 +df_complex              value:GAUGE:0:U
 +df_inodes               value:GAUGE:0:U
++dilution_of_precision   value:GAUGE:0:U
 +disk_io_time            io_time:DERIVE:0:U, weighted_io_time:DERIVE:0:U
 +disk_latency            read:GAUGE:0:U, write:GAUGE:0:U
 +disk_merged             read:DERIVE:0:U, write:DERIVE:0:U
 +disk_octets             read:DERIVE:0:U, write:DERIVE:0:U
 +disk_ops                read:DERIVE:0:U, write:DERIVE:0:U
 +disk_ops_complex        value:DERIVE:0:U
 +disk_time               read:DERIVE:0:U, write:DERIVE:0:U
 +dns_answer              value:DERIVE:0:U
 +dns_notify              value:DERIVE:0:U
 +dns_octets              queries:DERIVE:0:U, responses:DERIVE:0:U
 +dns_opcode              value:DERIVE:0:U
 +dns_qtype               value:DERIVE:0:U
 +dns_qtype_cached        value:GAUGE:0:4294967295
 +dns_query               value:DERIVE:0:U
 +dns_question            value:DERIVE:0:U
 +dns_rcode               value:DERIVE:0:U
 +dns_reject              value:DERIVE:0:U
 +dns_request             value:DERIVE:0:U
 +dns_resolver            value:DERIVE:0:U
 +dns_response            value:DERIVE:0:U
 +dns_transfer            value:DERIVE:0:U
 +dns_update              value:DERIVE:0:U
 +dns_zops                value:DERIVE:0:U
 +drbd_resource           value:DERIVE:0:U
 +duration                seconds:GAUGE:0:U
 +email_check             value:GAUGE:0:U
 +email_count             value:GAUGE:0:U
 +email_size              value:GAUGE:0:U
 +entropy                 value:GAUGE:0:4294967295
 +evicted_keys            value:DERIVE:0:U
 +expired_keys            value:DERIVE:0:U
 +fanspeed                value:GAUGE:0:U
 +file_handles            value:GAUGE:0:U
 +file_size               value:GAUGE:0:U
 +files                   value:GAUGE:0:U
 +flow                    value:GAUGE:0:U
 +fork_rate               value:DERIVE:0:U
 +frequency               value:GAUGE:0:U
 +frequency_error         value:GAUGE:-2:2 
 +frequency_offset        value:GAUGE:-1000000:1000000
 +fscache_stat            value:DERIVE:0:U
 +gauge                   value:GAUGE:U:U
 +hash_collisions         value:DERIVE:0:U
 +http_request_methods    value:DERIVE:0:U
 +http_requests           value:DERIVE:0:U
 +http_response_codes     value:DERIVE:0:U
 +humidity                value:GAUGE:0:100
 +if_collisions           value:DERIVE:0:U
 +if_dropped              rx:DERIVE:0:U, tx:DERIVE:0:U
 +if_errors               rx:DERIVE:0:U, tx:DERIVE:0:U
 +if_multicast            value:DERIVE:0:U
 +if_octets               rx:DERIVE:0:U, tx:DERIVE:0:U
 +if_packets              rx:DERIVE:0:U, tx:DERIVE:0:U
 +if_rx_errors            value:DERIVE:0:U
 +if_rx_octets            value:DERIVE:0:U
 +if_tx_errors            value:DERIVE:0:U
 +if_tx_octets            value:DERIVE:0:U
 +invocations             value:DERIVE:0:U
 +io_octets               rx:DERIVE:0:U, tx:DERIVE:0:U
 +io_packets              rx:DERIVE:0:U, tx:DERIVE:0:U
 +ipt_bytes               value:DERIVE:0:U
 +ipt_packets             value:DERIVE:0:U
 +irq                     value:DERIVE:0:U
 +latency                 value:GAUGE:0:U
 +links                   value:GAUGE:0:U
 +load                    shortterm:GAUGE:0:5000, midterm:GAUGE:0:5000, longterm:GAUGE:0:5000
 +md_disks                value:GAUGE:0:U
 +memcached_command       value:DERIVE:0:U
 +memcached_connections   value:GAUGE:0:U
 +memcached_items         value:GAUGE:0:U
 +memcached_octets        rx:DERIVE:0:U, tx:DERIVE:0:U
 +memcached_ops           value:DERIVE:0:U
 +memory                  value:GAUGE:0:281474976710656
 +memory_lua              value:GAUGE:0:281474976710656
 +memory_throttle_count   value:DERIVE:0:U
 +multimeter              value:GAUGE:U:U
 +mutex_operations        value:DERIVE:0:U
 +mysql_bpool_bytes       value:GAUGE:0:U
 +mysql_bpool_counters    value:DERIVE:0:U
 +mysql_bpool_pages       value:GAUGE:0:U
 +mysql_commands          value:DERIVE:0:U
 +mysql_handler           value:DERIVE:0:U
 +mysql_innodb_data       value:DERIVE:0:U
 +mysql_innodb_dblwr      value:DERIVE:0:U
 +mysql_innodb_log        value:DERIVE:0:U
 +mysql_innodb_pages      value:DERIVE:0:U
 +mysql_innodb_row_lock   value:DERIVE:0:U
 +mysql_innodb_rows       value:DERIVE:0:U
 +mysql_locks             value:DERIVE:0:U
 +mysql_log_position      value:DERIVE:0:U
 +mysql_octets            rx:DERIVE:0:U, tx:DERIVE:0:U
 +mysql_select            value:DERIVE:0:U
 +mysql_sort              value:DERIVE:0:U
 +mysql_sort_merge_passes value:DERIVE:0:U
 +mysql_sort_rows         value:DERIVE:0:U
 +mysql_slow_queries      value:DERIVE:0:U
 +nfs_procedure           value:DERIVE:0:U
 +nginx_connections       value:GAUGE:0:U
 +nginx_requests          value:DERIVE:0:U
 +node_octets             rx:DERIVE:0:U, tx:DERIVE:0:U
 +node_rssi               value:GAUGE:0:255
 +node_stat               value:DERIVE:0:U
 +node_tx_rate            value:GAUGE:0:127
 +objects                 value:GAUGE:0:U
 +operations              value:DERIVE:0:U
 +operations_per_second   value:GAUGE:0:U
 +packets                 value:DERIVE:0:U
 +pending_operations      value:GAUGE:0:U
 +percent                 value:GAUGE:0:100.1
 +percent_bytes           value:GAUGE:0:100.1
 +percent_inodes          value:GAUGE:0:100.1
 +pf_counters             value:DERIVE:0:U
 +pf_limits               value:DERIVE:0:U
 +pf_source               value:DERIVE:0:U
 +pf_state                value:DERIVE:0:U
 +pf_states               value:GAUGE:0:U
 +pg_blks                 value:DERIVE:0:U
 +pg_db_size              value:GAUGE:0:U
 +pg_n_tup_c              value:DERIVE:0:U
 +pg_n_tup_g              value:GAUGE:0:U
 +pg_numbackends          value:GAUGE:0:U
 +pg_scan                 value:DERIVE:0:U
 +pg_xact                 value:DERIVE:0:U
 +ping                    value:GAUGE:0:65535
 +ping_droprate           value:GAUGE:0:100
 +ping_stddev             value:GAUGE:0:65535
 +players                 value:GAUGE:0:1000000
 +power                   value:GAUGE:0:U
 +pressure                value:GAUGE:0:U
 +protocol_counter        value:DERIVE:0:U
 +ps_code                 value:GAUGE:0:9223372036854775807
 +ps_count                processes:GAUGE:0:1000000, threads:GAUGE:0:1000000
 +ps_cputime              user:DERIVE:0:U, syst:DERIVE:0:U
 +ps_data                 value:GAUGE:0:9223372036854775807
 +ps_disk_octets          read:DERIVE:0:U, write:DERIVE:0:U
 +ps_disk_ops             read:DERIVE:0:U, write:DERIVE:0:U
 +ps_pagefaults           minflt:DERIVE:0:U, majflt:DERIVE:0:U
 +ps_rss                  value:GAUGE:0:9223372036854775807
 +ps_stacksize            value:GAUGE:0:9223372036854775807
 +ps_state                value:GAUGE:0:65535
 +ps_vm                   value:GAUGE:0:9223372036854775807
 +pubsub                  value:GAUGE:0:U
 +queue_length            value:GAUGE:0:U
 +records                 value:GAUGE:0:U
 +requests                value:GAUGE:0:U
 +response_code           value:GAUGE:0:U
 +response_time           value:GAUGE:0:U
 +root_delay              value:GAUGE:U:U
 +root_dispersion         value:GAUGE:U:U
 +route_etx               value:GAUGE:0:U
 +route_metric            value:GAUGE:0:U
 +routes                  value:GAUGE:0:U
++satellites              value:GAUGE:0:U
 +segments                value:GAUGE:0:65535
 +serial_octets           rx:DERIVE:0:U, tx:DERIVE:0:U
 +signal_noise            value:GAUGE:U:0
 +signal_power            value:GAUGE:U:0
 +signal_quality          value:GAUGE:0:U
  smart_attribute         current:GAUGE:0:255, worst:GAUGE:0:255, threshold:GAUGE:0:255, pretty:GAUGE:0:U
 -snr                   value:GAUGE:0:U
 -spam_check            value:GAUGE:0:U
 -spam_score            value:GAUGE:U:U
 -spl                   value:GAUGE:U:U
 -swap_io                       value:DERIVE:0:U
 -swap                  value:GAUGE:0:1099511627776
 -tcp_connections               value:GAUGE:0:4294967295
 -temperature           value:GAUGE:U:U
 -threads                       value:GAUGE:0:U
 -time_dispersion               value:GAUGE:-1000000:1000000
 -timeleft              value:GAUGE:0:U
 -time_offset           value:GAUGE:-1000000:1000000
 -total_bytes           value:DERIVE:0:U
 -total_connections     value:DERIVE:0:U
 -total_objects         value:DERIVE:0:U
 -total_operations      value:DERIVE:0:U
 -total_requests                value:DERIVE:0:U
 -total_sessions                value:DERIVE:0:U
 -total_threads         value:DERIVE:0:U
 -total_time_in_ms      value:DERIVE:0:U
 -total_values          value:DERIVE:0:U
 -uptime                        value:GAUGE:0:4294967295
 -users                 value:GAUGE:0:65535
 -vcl                   value:GAUGE:0:65535
 -vcpu                  value:GAUGE:0:U
 -virt_cpu_total                value:DERIVE:0:U
 -virt_vcpu             value:DERIVE:0:U
 -vmpage_action         value:DERIVE:0:U
 -vmpage_faults         minflt:DERIVE:0:U, majflt:DERIVE:0:U
 -vmpage_io             in:DERIVE:0:U, out:DERIVE:0:U
 -vmpage_number         value:GAUGE:0:4294967295
 -volatile_changes      value:GAUGE:0:U
 -voltage_threshold     value:GAUGE:U:U, threshold:GAUGE:U:U
 -voltage                       value:GAUGE:U:U
 -vs_memory             value:GAUGE:0:9223372036854775807
 -vs_processes          value:GAUGE:0:65535
 -vs_threads            value:GAUGE:0:65535
 +smart_badsectors        value:GAUGE:0:U
 +smart_powercycles       value:GAUGE:0:U
 +smart_poweron           value:GAUGE:0:U
 +smart_temperature       value:GAUGE:-300:300
 +snr                     value:GAUGE:0:U
 +spam_check              value:GAUGE:0:U
 +spam_score              value:GAUGE:U:U
 +spl                     value:GAUGE:U:U
 +swap                    value:GAUGE:0:1099511627776
 +swap_io                 value:DERIVE:0:U
 +tcp_connections         value:GAUGE:0:4294967295
 +temperature             value:GAUGE:U:U
 +threads                 value:GAUGE:0:U
 +time_dispersion         value:GAUGE:-1000000:1000000
 +time_offset             value:GAUGE:-1000000:1000000
 +time_offset_ntp         value:GAUGE:-1000000:1000000
 +time_offset_rms         value:GAUGE:-1000000:1000000
 +time_ref                value:GAUGE:0:U
 +timeleft                value:GAUGE:0:U
 +total_bytes             value:DERIVE:0:U
 +total_connections       value:DERIVE:0:U
 +total_objects           value:DERIVE:0:U
 +total_operations        value:DERIVE:0:U
 +total_requests          value:DERIVE:0:U
 +total_sessions          value:DERIVE:0:U
 +total_threads           value:DERIVE:0:U
 +total_time_in_ms        value:DERIVE:0:U
 +total_values            value:DERIVE:0:U
 +uptime                  value:GAUGE:0:4294967295
 +users                   value:GAUGE:0:65535
 +vcl                     value:GAUGE:0:65535
 +vcpu                    value:GAUGE:0:U
 +virt_cpu_total          value:DERIVE:0:U
 +virt_vcpu               value:DERIVE:0:U
 +vmpage_action           value:DERIVE:0:U
 +vmpage_faults           minflt:DERIVE:0:U, majflt:DERIVE:0:U
 +vmpage_io               in:DERIVE:0:U, out:DERIVE:0:U
 +vmpage_number           value:GAUGE:0:4294967295
 +volatile_changes        value:GAUGE:0:U
 +voltage                 value:GAUGE:U:U
 +voltage_threshold       value:GAUGE:U:U, threshold:GAUGE:U:U
 +vs_memory               value:GAUGE:0:9223372036854775807
 +vs_processes            value:GAUGE:0:65535
 +vs_threads              value:GAUGE:0:65535
  
  #
  # Legacy types
  # (required for the v5 upgrade target)
  #
 -arc_counts            demand_data:COUNTER:0:U, demand_metadata:COUNTER:0:U, prefetch_data:COUNTER:0:U, prefetch_metadata:COUNTER:0:U
 -arc_l2_bytes          read:COUNTER:0:U, write:COUNTER:0:U
 -arc_l2_size           value:GAUGE:0:U
 -arc_ratio             value:GAUGE:0:U
 -arc_size              current:GAUGE:0:U, target:GAUGE:0:U, minlimit:GAUGE:0:U, maxlimit:GAUGE:0:U
 -mysql_qcache          hits:COUNTER:0:U, inserts:COUNTER:0:U, not_cached:COUNTER:0:U, lowmem_prunes:COUNTER:0:U, queries_in_cache:GAUGE:0:U
 -mysql_threads         running:GAUGE:0:U, connected:GAUGE:0:U, cached:GAUGE:0:U, created:COUNTER:0:U
 +arc_counts              demand_data:COUNTER:0:U, demand_metadata:COUNTER:0:U, prefetch_data:COUNTER:0:U, prefetch_metadata:COUNTER:0:U
 +arc_l2_bytes            read:COUNTER:0:U, write:COUNTER:0:U
 +arc_l2_size             value:GAUGE:0:U
 +arc_ratio               value:GAUGE:0:U
 +arc_size                current:GAUGE:0:U, target:GAUGE:0:U, minlimit:GAUGE:0:U, maxlimit:GAUGE:0:U
 +mysql_qcache            hits:COUNTER:0:U, inserts:COUNTER:0:U, not_cached:COUNTER:0:U, lowmem_prunes:COUNTER:0:U, queries_in_cache:GAUGE:0:U
 +mysql_threads           running:GAUGE:0:U, connected:GAUGE:0:U, cached:GAUGE:0:U, created:COUNTER:0:U