Merge remote-tracking branch 'github/pr/1054'
authorFlorian Forster <octo@collectd.org>
Thu, 28 May 2015 12:09:35 +0000 (14:09 +0200)
committerFlorian Forster <octo@collectd.org>
Thu, 28 May 2015 12:09:35 +0000 (14:09 +0200)
1  2 
configure.ac
src/Makefile.am
src/collectd.conf.in

diff --combined configure.ac
@@@ -589,44 -589,13 +589,44 @@@ AC_CHECK_HEADERS(net/pfvar.h
  have_termios_h="no"
  AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
  
 +# For the turbostat plugin
 +have_asm_msrindex_h="no"
 +AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"])
 +
 +if test "x$have_asm_msrindex_h" = "xyes"
 +then
 +  AC_CACHE_CHECK([whether asm/msr-index.h has MSR_CORE_C3_RESIDENCY],
 +                 [c_cv_have_usable_asm_msrindex_h],
 +                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
 +[[[
 +#include<asm/msr-index.h>
 +]]],
 +[[[
 +int y = MSR_CORE_C3_RESIDENCY;
 +return(y);
 +]]]
 +  )],
 +                 [c_cv_have_usable_asm_msrindex_h="yes"],
 +                 [c_cv_have_usable_asm_msrindex_h="no"],
 +                                  )
 +                 )
 +fi
 +
 +have_cpuid_h="no"
 +AC_CHECK_HEADERS(cpuid.h, [have_cpuid_h="yes"])
 +
 +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
  
  #
@@@ -3760,7 -3729,6 +3760,7 @@@ AC_ARG_WITH(librdkafka, [AS_HELP_STRING
    then
      with_librdkafka_cppflags="-I$withval/include"
      with_librdkafka_ldflags="-L$withval/lib"
 +    with_librdkafka_rpath="$withval/lib"
      with_librdkafka="yes"
    else
      with_librdkafka="$withval"
  SAVE_CPPFLAGS="$CPPFLAGS"
  SAVE_LDFLAGS="$LDFLAGS"
  
 +CPPFLAGS="$CPPFLAGS $with_librdkafka_cppflags"
 +LDFLAGS="$LDFLAGS $with_librdkafka_ldflags"
 +
  if test "x$with_librdkafka" = "xyes"
  then
        AC_CHECK_HEADERS(librdkafka/rdkafka.h, [with_librdkafka="yes"], [with_librdkafka="no (librdkafka/rdkafka.h not found)"])
@@@ -3790,12 -3755,7 +3790,12 @@@ if test "x$with_librdkafka" = "xyes
  then
        BUILD_WITH_LIBRDKAFKA_CPPFLAGS="$with_librdkafka_cppflags"
        BUILD_WITH_LIBRDKAFKA_LDFLAGS="$with_librdkafka_ldflags"
 -      BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
 +      if test "x$with_librdkafka_rpath" != "x"
 +      then
 +              BUILD_WITH_LIBRDKAFKA_LIBS="-Wl,-rpath,$with_librdkafka_rpath -lrdkafka"
 +      else
 +              BUILD_WITH_LIBRDKAFKA_LIBS="-lrdkafka"
 +      fi
        AC_SUBST(BUILD_WITH_LIBRDKAFKA_CPPFLAGS)
        AC_SUBST(BUILD_WITH_LIBRDKAFKA_LDFLAGS)
        AC_SUBST(BUILD_WITH_LIBRDKAFKA_LIBS)
@@@ -5186,7 -5146,6 +5186,7 @@@ plugin_tape="no
  plugin_tcpconns="no"
  plugin_ted="no"
  plugin_thermal="no"
 +plugin_turbostat="no"
  plugin_uptime="no"
  plugin_users="no"
  plugin_virt="no"
@@@ -5194,6 -5153,7 +5194,7 @@@ plugin_vmem="no
  plugin_vserver="no"
  plugin_wireless="no"
  plugin_zfs_arc="no"
+ plugin_zone="no"
  plugin_zookeeper="no"
  
  # Linux
        then
                plugin_ipvs="yes"
        fi
 +      if test "x$c_cv_have_usable_asm_msrindex_h" = "xyes" && test "x$have_cpuid_h" = "xyes"
 +      then
 +              plugin_turbostat="yes"
 +      fi
  fi
  
  if test "x$ac_system" = "xOpenBSD"
  if test "x$with_kstat" = "xyes"
  then
        plugin_nfs="yes"
 +      plugin_processes="yes"
        plugin_uptime="yes"
        plugin_zfs_arc="yes"
+       plugin_zone="yes"
  fi
  
  if test "x$with_devinfo$with_kstat" = "xyesyes"
@@@ -5551,7 -5507,6 +5553,7 @@@ AC_PLUGIN([email],       [yes]
  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],     [yes],                [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])
@@@ -5635,7 -5590,6 +5637,7 @@@ AC_PLUGIN([ted],         [$plugin_ted]
  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])
@@@ -5656,6 -5610,7 +5658,7 @@@ AC_PLUGIN([write_sensu], [yes]
  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])
  
  dnl Default configuration file
@@@ -5929,7 -5884,6 +5932,7 @@@ Configuration
      entropy . . . . . . . $enable_entropy
      ethstat . . . . . . . $enable_ethstat
      exec  . . . . . . . . $enable_exec
 +    fhcount . . . . . . . $enable_fhcount
      filecount . . . . . . $enable_filecount
      fscache . . . . . . . $enable_fscache
      gmond . . . . . . . . $enable_gmond
      thermal . . . . . . . $enable_thermal
      threshold . . . . . . $enable_threshold
      tokyotyrant . . . . . $enable_tokyotyrant
 +    turbostat . . . . . . $enable_turbostat
      unixsock  . . . . . . $enable_unixsock
      uptime  . . . . . . . $enable_uptime
      users . . . . . . . . $enable_users
      write_tsdb  . . . . . $enable_write_tsdb
      xmms  . . . . . . . . $enable_xmms
      zfs_arc . . . . . . . $enable_zfs_arc
+     zone  . . . . . . . . $enable_zone
      zookeeper . . . . . . $enable_zookeeper
  
  EOF
diff --combined src/Makefile.am
@@@ -23,14 -23,6 +23,14 @@@ AM_CPPFLAGS += -DPKGDATADIR='"${pkgdata
  
  AUTOMAKE_OPTIONS = subdir-objects
  
 +noinst_LTLIBRARIES = libmount.la liblookup.la
 +
 +libmount_la_SOURCES = utils_mount.c utils_mount.h
 +libmount_la_LIBADD = daemon/libcommon.la
 +
 +liblookup_la_SOURCES = utils_vl_lookup.c utils_vl_lookup.h
 +liblookup_la_LIBADD = daemon/libavltree.la daemon/libcommon.la
 +
  sbin_PROGRAMS = collectdmon
  bin_PROGRAMS = collectd-nagios collectdctl collectd-tg
  
@@@ -63,9 -55,10 +63,9 @@@ endi
  collectdctl_LDADD += libcollectdclient/libcollectdclient.la
  collectdctl_DEPENDENCIES = libcollectdclient/libcollectdclient.la
  
 -collectd_tg_SOURCES = collectd-tg.c \
 -                    daemon/utils_heap.c daemon/utils_heap.h
 +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 =
 +collectd_tg_LDADD = daemon/libheap.la
  if BUILD_WITH_LIBSOCKET
  collectd_tg_LDADD += -lsocket
  endif
@@@ -190,9 -183,9 +190,9 @@@ endi
  if BUILD_PLUGIN_CGROUPS
  pkglib_LTLIBRARIES += cgroups.la
  cgroups_la_SOURCES = cgroups.c \
 -                   utils_ignorelist.c utils_ignorelist.h \
 -                   utils_mount.c utils_mount.h
 +                   utils_ignorelist.c utils_ignorelist.h
  cgroups_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 +cgroups_la_LIBADD = libmount.la
  endif
  
  if BUILD_PLUGIN_CONNTRACK
@@@ -290,9 -283,9 +290,9 @@@ endi
  if BUILD_PLUGIN_DF
  pkglib_LTLIBRARIES += df.la
  df_la_SOURCES = df.c \
 -              utils_ignorelist.c utils_ignorelist.h \
 -              utils_mount.c utils_mount.h
 +              utils_ignorelist.c utils_ignorelist.h
  df_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 +df_la_LIBADD = libmount.la
  endif
  
  if BUILD_PLUGIN_DISK
@@@ -366,12 -359,6 +366,12 @@@ ethstat_la_SOURCES = ethstat.
  ethstat_la_LDFLAGS = $(PLUGIN_LDFLAGS)
  endif
  
 +if BUILD_PLUGIN_FHCOUNT
 +pkglib_LTLIBRARIES += fhcount.la
 +fhcount_la_SOURCES = fhcount.c
 +fhcount_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 +endif
 +
  if BUILD_PLUGIN_FILECOUNT
  pkglib_LTLIBRARIES += filecount.la
  filecount_la_SOURCES = filecount.c
@@@ -1089,12 -1076,6 +1089,12 @@@ tokyotyrant_la_LIBADD += -lsocke
  endif
  endif
  
 +if BUILD_PLUGIN_TURBOSTAT
 +pkglib_LTLIBRARIES += turbostat.la
 +turbostat_la_SOURCES = turbostat.c
 +turbostat_la_LDFLAGS = $(PLUGIN_LDFLAGS)
 +endif
 +
  if BUILD_PLUGIN_UNIXSOCK
  pkglib_LTLIBRARIES += unixsock.la
  unixsock_la_SOURCES = unixsock.c \
@@@ -1207,7 -1188,6 +1207,7 @@@ write_kafka_la_SOURCES = write_kafka.c 
                          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)
  endif
@@@ -1288,6 -1268,13 +1288,13 @@@ endi
  
  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
  dist_man_MANS = collectd.1 \
                collectd.conf.5 \
                collectd-email.5 \
@@@ -1380,12 -1367,49 +1387,12 @@@ uninstall-hook
        rm -f $(DESTDIR)$(sysconfdir)/collectd.conf
        rm -f $(DESTDIR)$(pkgdatadir)/postgresql_default.conf;
  
 -check_PROGRAMS = test_common test_utils_avltree test_utils_heap test_utils_mount test_utils_vl_lookup
 -
 -test_common_SOURCES = tests/test_common.c \
 -                      daemon/common.h daemon/common.c \
 -                      tests/macros.h \
 -                      tests/mock/plugin.c \
 -                      tests/mock/utils_cache.c \
 -                      tests/mock/utils_time.c
 -test_common_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
 -test_common_LDFLAGS = -export-dynamic
 -test_common_LDADD =
 -
 -test_utils_avltree_SOURCES = tests/test_utils_avltree.c \
 -                             daemon/utils_avltree.c daemon/utils_avltree.h
 -test_utils_avltree_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
 -test_utils_avltree_LDFLAGS = -export-dynamic
 -test_utils_avltree_LDADD =
 -
 -test_utils_heap_SOURCES = tests/test_utils_heap.c \
 -                          daemon/utils_heap.c daemon/utils_heap.h
 -test_utils_heap_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
 -test_utils_heap_LDFLAGS = -export-dynamic
 -test_utils_heap_LDADD =
 -
 -test_utils_mount_SOURCES = tests/test_utils_mount.c \
 -                           utils_mount.c utils_mount.h \
 -                           daemon/common.c daemon/common.h \
 -                           tests/mock/plugin.c \
 -                           tests/mock/utils_cache.c \
 -                           tests/mock/utils_time.c
 -test_utils_mount_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
 -test_utils_mount_LDFLAGS = -export-dynamic
 -test_utils_mount_LDADD =
 -
 -test_utils_vl_lookup_SOURCES = tests/test_utils_vl_lookup.c \
 -                               utils_vl_lookup.h utils_vl_lookup.c \
 -                               daemon/utils_avltree.c daemon/utils_avltree.h \
 -                               daemon/common.c daemon/common.h \
 -                               tests/mock/plugin.c \
 -                               tests/mock/utils_cache.c \
 -                               tests/mock/utils_time.c
 -test_utils_vl_lookup_CPPFLAGS = $(AM_CPPFLAGS) $(LTDLINCL)
 -test_utils_vl_lookup_LDFLAGS = -export-dynamic
 -test_utils_vl_lookup_LDADD =
 -
 -TESTS = test_common test_utils_avltree test_utils_heap test_utils_mount test_utils_vl_lookup
 +check_PROGRAMS = test_utils_mount test_utils_vl_lookup
 +
 +test_utils_mount_SOURCES = utils_mount_test.c testing.h
 +test_utils_mount_LDADD = libmount.la daemon/libplugin_mock.la
 +
 +test_utils_vl_lookup_SOURCES = utils_vl_lookup_test.c testing.h
 +test_utils_vl_lookup_LDADD = liblookup.la daemon/libplugin_mock.la
 +
 +TESTS = test_utils_mount test_utils_vl_lookup
diff --combined src/collectd.conf.in
  #@BUILD_PLUGIN_ENTROPY_TRUE@LoadPlugin entropy
  #@BUILD_PLUGIN_ETHSTAT_TRUE@LoadPlugin ethstat
  #@BUILD_PLUGIN_EXEC_TRUE@LoadPlugin exec
 +#@BUILD_PLUGIN_FHCOUNT_TRUE@LoadPlugin fhcount
  #@BUILD_PLUGIN_FILECOUNT_TRUE@LoadPlugin filecount
  #@BUILD_PLUGIN_FSCACHE_TRUE@LoadPlugin fscache
  #@BUILD_PLUGIN_GMOND_TRUE@LoadPlugin gmond
  #@BUILD_PLUGIN_TED_TRUE@LoadPlugin ted
  #@BUILD_PLUGIN_THERMAL_TRUE@LoadPlugin thermal
  #@BUILD_PLUGIN_TOKYOTYRANT_TRUE@LoadPlugin tokyotyrant
 +#@BUILD_PLUGIN_TURBOSTAT_TRUE@LoadPlugin turbostat
  #@BUILD_PLUGIN_UNIXSOCK_TRUE@LoadPlugin unixsock
  #@BUILD_PLUGIN_UPTIME_TRUE@LoadPlugin uptime
  #@BUILD_PLUGIN_USERS_TRUE@LoadPlugin users
  #@BUILD_PLUGIN_WRITE_TSDB_TRUE@LoadPlugin write_tsdb
  #@BUILD_PLUGIN_XMMS_TRUE@LoadPlugin xmms
  #@BUILD_PLUGIN_ZFS_ARC_TRUE@LoadPlugin zfs_arc
+ #@BUILD_PLUGIN_ZONE_TRUE@LoadPlugin zone
  #@BUILD_PLUGIN_ZOOKEEPER_TRUE@LoadPlugin zookeeper
  
  ##############################################################################
  #     NotificationExec "user:group" "/path/to/exec"
  #</Plugin>
  
 +#<Plugin fhcount>
 +#     ValuesAbsolute true
 +#     ValuesPercentage false
 +#</Plugin>
 +
  #<Plugin filecount>
  #     <Directory "/path/to/dir">
  #             Instance "foodir"
  #     Port "1978"
  #</Plugin>
  
 +#<Plugin turbostat>
 +##    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
 +##    - 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'
 +##    In the last two cases, please open a bug request
 +#
 +#     TCCActivationTemp "100"
 +#     CoreCstates "392"
 +#     PackageCstates "396"
 +#     SystemManagementInterrupt true
 +#     DigitalTemperatureSensor true
 +#     PackageThermalManagement true
 +#     RunningAveragePowerLimit "7"    
 +#</Plugin>
 +
  #<Plugin unixsock>
  #     SocketFile "@prefix@/var/run/@PACKAGE_NAME@-unixsock"
  #     SocketGroup "collectd"