Merge branch 'collectd-5.0'
authorFlorian Forster <octo@collectd.org>
Sat, 28 Jan 2012 11:26:51 +0000 (12:26 +0100)
committerFlorian Forster <octo@collectd.org>
Sat, 28 Jan 2012 11:26:51 +0000 (12:26 +0100)
1  2 
configure.in
src/Makefile.am
src/collectd.conf.in

diff --combined configure.in
@@@ -389,18 -389,36 +389,36 @@@ AC_CHECK_HEADERS(linux/netdevice.h, []
  ])
  
  # For ipvs module
+ have_linux_ip_vs_h="no"
  have_net_ip_vs_h="no"
  have_ip_vs_h="no"
+ ip_vs_h_needs_kernel_cflags="no"
  if test "x$ac_system" = "xLinux"
  then
-       SAVE_CFLAGS="$CFLAGS"
-       CFLAGS="$CFLAGS $KERNEL_CFLAGS"
+       AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
        AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
        AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
  
-       CFLAGS="$SAVE_CFLAGS"
+       if test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono" && test -d "$KERNEL_DIR"
+       then
+               SAVE_CFLAGS="$CFLAGS"
+               CFLAGS="$CFLAGS $KERNEL_CFLAGS"
+               AC_MSG_NOTICE([Did not find ip_vs.h. Trying again using headers from $KERNEL_DIR.])
+               AC_CHECK_HEADERS(linux/ip_vs.h, [have_linux_ip_vs_h="yes"])
+               AC_CHECK_HEADERS(net/ip_vs.h, [have_net_ip_vs_h="yes"])
+               AC_CHECK_HEADERS(ip_vs.h, [have_ip_vs_h="yes"])
+               if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
+               then
+                       ip_vs_h_needs_kernel_cflags="yes"
+               fi
+               CFLAGS="$SAVE_CFLAGS"
+       fi
  fi
+ AM_CONDITIONAL(IP_VS_H_NEEDS_KERNEL_CFLAGS, test "x$ip_vs_h_needs_kernel_cflags" = "xyes")
  
  # For quota module
  AC_CHECK_HEADERS(sys/ucred.h, [], [],
@@@ -1241,7 -1259,6 +1259,7 @@@ AC_CHECK_MEMBERS([kstat_io_t.nwritten, 
  #
  # Checks for libraries begin here
  #
 +
  with_libresolv="yes"
  AC_CHECK_LIB(resolv, res_search,
  [
@@@ -1766,16 -1783,21 +1784,16 @@@ AM_CONDITIONAL(BUILD_WITH_LIBGCRYPT, te
  # }}}
  
  # --with-libiptc {{{
 -with_own_libiptc="no"
  AC_ARG_WITH(libiptc, [AS_HELP_STRING([--with-libiptc@<:@=PREFIX@:>@], [Path to libiptc.])],
  [
 -      if test "x$withval" = "xshipped"
 -      then
 -              with_own_libiptc="yes"
 -              with_libiptc="yes"
 -      else if test "x$withval" != "xno" && test "x$withval" != "xyes"
 +      if test "x$withval" != "xno" && test "x$withval" != "xyes"
        then
                LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS -I$withval/include"
                LIBIPTC_LDFLAGS="$LIBIPTC_LDFLAGS -L$withval/lib"
                with_libiptc="yes"
        else
                with_libiptc="$withval"
 -      fi; fi
 +      fi
  ],
  [
        if test "x$ac_system" = "xLinux"
@@@ -1790,37 -1812,72 +1808,37 @@@ SAVE_LDFLAGS="$LDFLAGS
  CPPFLAGS="$CPPFLAGS $LIBIPTC_CPPFLAGS"
  LDFLAGS="$LDFLAGS $LIBIPTC_LDFLAGS"
  # check whether the header file for libiptc is available.
 -if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
 +if test "x$with_libiptc" = "xyes"
  then
        AC_CHECK_HEADERS(libiptc/libiptc.h,
 -      [
 -              AC_DEFINE(HAVE_LIBIPTC_LIBIPTC_H, 1, [Define to 1 if you have the <libiptc/libiptc.h> header file.])
 -      ],
 -      [
 -              with_libiptc="yes"
 -              with_own_libiptc="yes"
 -      ])
 +                       [with_libiptc="yes"],
 +                       [with_libiptc="no (libiptc/libiptc.h not found)"])
  fi
 -if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
 +if test "x$with_libiptc" = "xyes"
  then
        AC_CHECK_HEADERS(libiptc/libip6tc.h,
 -      [
 -              AC_DEFINE(HAVE_LIBIPTC_LIBIP6TC_H, 1, [Define to 1 if you have the <libiptc/libip6tc.h> header file.])
 -      ],
 -      [
 -              with_libiptc="yes"
 -              with_own_libiptc="yes"
 -      ])
 +                       [with_libiptc="yes"],
 +                       [with_libiptc="no (libiptc/libip6tc.h not found)"])
  fi
  # If the header file is available, check for the required type declaractions.
  # They may be missing in old versions of libiptc. In that case, they will be
  # declared in the iptables plugin.
 -if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
 +if test "x$with_libiptc" = "xyes"
  then
        AC_CHECK_TYPES([iptc_handle_t, ip6tc_handle_t], [], [],
        [
 -#if OWN_LIBIPTC
 -# include "$srcdir/src/owniptc/libiptc.h"
 -# include "$srcdir/src/owniptc/libip6tc.h"
 -#else
 -# include <libiptc/libiptc.h>
 -# include <libiptc/libip6tc.h>
 -#endif
 +#include <libiptc/libiptc.h>
 +#include <libiptc/libip6tc.h>
        ])
  fi
  # Check for the iptc_init symbol in the library.
 -if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xno"
 +if test "x$with_libiptc" = "xyes"
  then
        AC_CHECK_LIB(iptc, iptc_init,
 -      [
 -              AC_DEFINE(HAVE_LIBIPTC, 1, [Define to 1 if you have the iptc library (-liptc).])
 -      ],
 -      [
 -              with_libiptc="yes"
 -              with_own_libiptc="yes"
 -      ],
 -      [-lip4tc -lip6tc])
 -fi
 -# The system wide version failed for some reason. Check if we have the required
 -# headers to build the shipped version.
 -if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
 -then
 -      AC_CHECK_HEADERS(linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h linux/netfilter/x_tables.h, [],
 -      [
 -              with_libiptc="no (Linux iptables headers not found)"
 -              with_own_libiptc="no"
 -      ],
 -      [
 -#include "$srcdir/src/owniptc/ipt_kernel_headers.h"
 -      ])
 +                   [with_libiptc="yes"],
 +                   [with_libiptc="no (symbol 'iptc_init' not found)"])
  fi
  AM_CONDITIONAL(BUILD_WITH_LIBIPTC, test "x$with_libiptc" = "xyes")
 -AM_CONDITIONAL(BUILD_WITH_OWN_LIBIPTC, test "x$with_own_libiptc" = "xyes")
  if test "x$with_libiptc" = "xyes"
  then
        BUILD_WITH_LIBIPTC_CPPFLAGS="$LIBIPTC_CPPFLAGS"
        AC_SUBST(BUILD_WITH_LIBIPTC_CPPFLAGS)
        AC_SUBST(BUILD_WITH_LIBIPTC_LDFLAGS)
  fi
 -if test "x$with_own_libiptc" = "xyes"
 -then
 -      AC_DEFINE(OWN_LIBIPTC, 1, [Define to 1 if we use the shipped iptc library.])
 -fi
  CPPFLAGS="$SAVE_CPPFLAGS"
  LDFLAGS="$SAVE_LDFLAGS"
  # }}}
  fi
  # }}}
  
 +# --with-libmongoc {{{
 +AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path to libmongoc.])],
 +[
 + if test "x$withval" = "xyes"
 + then
 +       with_libmongoc="yes"
 + else if test "x$withval" = "xno"
 + then
 +       with_libmongoc="no"
 + else
 +       with_libmongoc="yes"
 +       LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
 +       LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
 + fi; fi
 +],
 +[with_libmongoc="yes"])
 +
 +SAVE_CPPFLAGS="$CPPFLAGS"
 +SAVE_LDFLAGS="$LDFLAGS"
 +
 +CPPFLAGS="$CPPFLAGS $LIBMONGOC_CPPFLAGS"
 +LDFLAGS="$LDFLAGS $LIBMONGOC_LDFLAGS"
 +
 +if test "x$with_libmongoc" = "xyes"
 +then
 +      if test "x$LIBMONGOC_CPPFLAGS" != "x"
 +      then
 +              AC_MSG_NOTICE([libmongoc CPPFLAGS: $LIBMONGOC_CPPFLAGS])
 +      fi
 +      AC_CHECK_HEADERS(mongo.h,
 +      [with_libmongoc="yes"],
 +      [with_libmongoc="no ('mongo.h' not found)"],
 +[#if HAVE_STDINT_H
 +# define MONGO_HAVE_STDINT 1
 +#else
 +# define MONGO_USE_LONG_LONG_INT 1
 +#endif
 +])
 +fi
 +if test "x$with_libmongoc" = "xyes"
 +then
 +      if test "x$LIBMONGOC_LDFLAGS" != "x"
 +      then
 +              AC_MSG_NOTICE([libmongoc LDFLAGS: $LIBMONGOC_LDFLAGS])
 +      fi
 +      AC_CHECK_LIB(mongoc, mongo_run_command,
 +      [with_libmongoc="yes"],
 +      [with_libmongoc="no (symbol 'mongo_run_command' not found)"])
 +fi
 +
 +CPPFLAGS="$SAVE_CPPFLAGS"
 +LDFLAGS="$SAVE_LDFLAGS"
 +
 +if test "x$with_libmongoc" = "xyes"
 +then
 +      BUILD_WITH_LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS"
 +      BUILD_WITH_LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS"
 +      AC_SUBST(BUILD_WITH_LIBMONGOC_CPPFLAGS)
 +      AC_SUBST(BUILD_WITH_LIBMONGOC_LDFLAGS)
 +fi
 +AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
 +# }}}
 +
  # --with-libmysql {{{
  with_mysql_config="mysql_config"
  with_mysql_cflags=""
@@@ -4403,7 -4401,7 +4421,7 @@@ the
        plugin_vserver="yes"
        plugin_wireless="yes"
  
-       if test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
+       if test "x$have_linux_ip_vs_h" = "xyes" || test "x$have_net_ip_vs_h" = "xyes" || test "x$have_ip_vs_h" = "xyes"
        then
                plugin_ipvs="yes"
        fi
  fi
  
  # AIX
 +
 +if test "x$ac_system" = "xAIX"
 +then
 +        plugin_tcpconns="yes"
 +fi
 +
  if test "x$with_perfstat" = "xyes"
  then
        plugin_cpu="yes"
@@@ -4743,7 -4735,6 +4761,7 @@@ AC_PLUGIN([vserver],     [$plugin_vserv
  AC_PLUGIN([wireless],    [$plugin_wireless],   [Wireless statistics])
  AC_PLUGIN([write_http],  [$with_libcurl],      [HTTP output plugin])
  AC_PLUGIN([write_redis], [$with_libcredis],    [Redis output plugin])
 +AC_PLUGIN([write_mongodb], [$with_libmongoc],  [MongoDB output plugin])
  AC_PLUGIN([xmms],        [$with_libxmms],      [XMMS statistics])
  AC_PLUGIN([zfs_arc],     [$plugin_zfs_arc],    [ZFS ARC statistics])
  
@@@ -4829,11 -4820,16 +4847,16 @@@ AC_SUBST(LOAD_PLUGIN_CSV
  
  dnl ip_vs.h
  if test "x$ac_system" = "xLinux" \
-       && test "x$have_net_ip_vs_h$have_ip_vs_h" = "xnono"
+       && test "x$have_linux_ip_vs_h$have_net_ip_vs_h$have_ip_vs_h" = "xnonono"
  then
        enable_ipvs="$enable_ipvs (ip_vs.h not found)"
  fi
  
+ if test "x$ip_vs_h_needs_kernel_cflags" = "xyes"
+ then
+       enable_ipvs="$enable_ipvs (needs $KERNEL_CFLAGS)"
+ fi
  dnl Perl bindings
  AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
  [
@@@ -4881,7 -4877,7 +4904,7 @@@ AC_SUBST(LCC_VERSION_STRING
  
  AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
  
 -AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/owniptc/Makefile src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile)
 +AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile)
  
  if test "x$with_librrd" = "xyes" \
        && test "x$librrd_threadsafe" != "xyes"
@@@ -4889,6 -4885,11 +4912,6 @@@ the
        with_librrd="yes (warning: librrd is not thread-safe)"
  fi
  
 -if test "x$with_libiptc" = "xyes" && test "x$with_own_libiptc" = "xyes"
 -then
 -      with_libiptc="yes (shipped version)"
 -fi
 -
  if test "x$with_libperl" = "xyes"
  then
        with_libperl="yes (version `$perl_interpreter -MConfig -e 'print $Config{version};'`)"
@@@ -5065,7 -5066,6 +5088,7 @@@ Configuration
      wireless  . . . . . . $enable_wireless
      write_http  . . . . . $enable_write_http
      write_redis . . . . . $enable_write_redis
 +    write_mongodb . . . . $enable_write_mongodb
      xmms  . . . . . . . . $enable_xmms
      zfs_arc . . . . . . . $enable_zfs_arc
  
diff --combined src/Makefile.am
@@@ -1,4 -1,7 +1,4 @@@
  SUBDIRS = libcollectdclient
 -if BUILD_WITH_OWN_LIBIPTC
 -SUBDIRS += owniptc
 -endif
  if BUILD_WITH_OWN_LIBOCONFIG
  SUBDIRS += liboconfig
  endif
@@@ -437,7 -440,12 +437,7 @@@ pkglib_LTLIBRARIES += iptables.l
  iptables_la_SOURCES = iptables.c
  iptables_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBIPTC_CPPFLAGS)
  iptables_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBIPTC_LDFLAGS)
 -if BUILD_WITH_OWN_LIBIPTC
 -iptables_la_LIBADD  = owniptc/libiptc.la
 -iptables_la_DEPENDENCIES = owniptc/libiptc.la
 -else
  iptables_la_LIBADD = -liptc
 -endif
  collectd_LDADD += "-dlopen" iptables.la
  collectd_DEPENDENCIES += iptables.la
  endif
@@@ -455,7 -463,9 +455,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)
+ endif
  ipvs_la_LDFLAGS = -module -avoid-version
  collectd_LDADD += "-dlopen" ipvs.la
  collectd_DEPENDENCIES += ipvs.la
@@@ -1243,16 -1253,6 +1245,16 @@@ endi
  collectd_DEPENDENCIES += write_http.la
  endif
  
 +if BUILD_PLUGIN_WRITE_MONGODB
 +pkglib_LTLIBRARIES += write_mongodb.la
 +write_mongodb_la_SOURCES = write_mongodb.c
 +write_mongodb_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBMONGOC_CPPFLAGS)
 +write_mongodb_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBMONGOC_LDFLAGS)
 +write_mongodb_la_LIBADD = -lmongoc
 +collectd_LDADD += "-dlopen" write_mongodb.la
 +collectd_DEPENDENCIES += write_mongodb.la
 +endif
 +
  if BUILD_PLUGIN_WRITE_REDIS
  pkglib_LTLIBRARIES += write_redis.la
  write_redis_la_SOURCES = write_redis.c
diff --combined src/collectd.conf.in
  #@BUILD_PLUGIN_WIRELESS_TRUE@LoadPlugin wireless
  #@BUILD_PLUGIN_WRITE_HTTP_TRUE@LoadPlugin write_http
  #@BUILD_PLUGIN_WRITE_REDIS_TRUE@LoadPlugin write_redis
 +#@BUILD_PLUGIN_WRITE_MONGO_TRUE@LoadPlugin write_mongo
  #@BUILD_PLUGIN_XMMS_TRUE@LoadPlugin xmms
  #@BUILD_PLUGIN_ZFS_ARC_TRUE@LoadPlugin zfs_arc
  
  #   </Host>
  #</Plugin>
  
 +#<Plugin "swap">
 +#     ReportByDevice false
 +#</Plugin>
 +
  #<Plugin "table">
  #     <Table "/proc/slabinfo">
  #             Instance "slabinfo"
  #     </Node>
  #</Plugin>
  
 +#<Plugin write_mongo>
 +#     <Node "example">
 +#             Host "localhost"
 +#             Port "27017"
 +#             Timeout 1000
 +#     </Node>
 +#</Plugin>
 +
  ##############################################################################
  # Filter configuration                                                       #
  #----------------------------------------------------------------------------#
  #@BUILD_PLUGIN_TARGET_REPLACE_TRUE@LoadPlugin target_replace
  #@BUILD_PLUGIN_TARGET_SCALE_TRUE@LoadPlugin target_scale
  #@BUILD_PLUGIN_TARGET_SET_TRUE@LoadPlugin target_set
+ #@BUILD_PLUGIN_TARGET_V5UPGRADE_TRUE@LoadPlugin target_v5upgrade
  
  #----------------------------------------------------------------------------#
  # The following block demonstrates the default behavior if no filtering is   #