Merge branch 'ar/lpar'
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 6 Nov 2010 08:40:05 +0000 (09:40 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 6 Nov 2010 08:40:05 +0000 (09:40 +0100)
1  2 
configure.in
src/Makefile.am
src/types.db

diff --combined configure.in
  if test "x$with_perfstat" = "xyes"
  then
         AC_DEFINE(HAVE_PERFSTAT, 1, [Define to 1 if you have the 'perfstat' library (-lperfstat)])
+        # struct members pertaining to donation have been added to libperfstat somewhere between AIX5.3ML5 and AIX5.3ML9
+        AC_CHECK_MEMBER([perfstat_partition_type_t.b.donate_enabled], [], [], [[#include <libperfstat.h]])
+        if test "x$av_cv_member_perfstat_partition_type_t_b_donate_enabled" = "xyes"
+        then
+               AC_DEFINE(PERFSTAT_SUPPORTS_DONATION, 1, [Define to 1 if your version of the 'perfstat' library supports donation])
+        fi
  fi
  AM_CONDITIONAL(BUILD_WITH_PERFSTAT, test "x$with_perfstat" = "xyes")
  
  fi
  # }}} --with-python
  
 +# --with-librabbitmq {{{
 +with_librabbitmq_cppflags=""
 +with_librabbitmq_ldflags=""
 +AC_ARG_WITH(librabbitmq, [AS_HELP_STRING([--with-librabbitmq@<:@=PREFIX@:>@], [Path to librabbitmq.])],
 +[
 +      if test "x$withval" != "xno" && test "x$withval" != "xyes"
 +      then
 +              with_librabbitmq_cppflags="-I$withval/include"
 +              with_librabbitmq_ldflags="-L$withval/lib"
 +              with_librabbitmq="yes"
 +      else
 +              with_librabbitmq="$withval"
 +      fi
 +],
 +[
 +      with_librabbitmq="yes"
 +])
 +if test "x$with_librabbitmq" = "xyes"
 +then
 +      SAVE_CPPFLAGS="$CPPFLAGS"
 +      CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
 +
 +      AC_CHECK_HEADERS(amqp.h, [with_librabbitmq="yes"], [with_librabbitmq="no (amqp.h not found)"])
 +
 +      CPPFLAGS="$SAVE_CPPFLAGS"
 +fi
 +if test "x$with_librabbitmq" = "xyes"
 +then
 +      SAVE_CPPFLAGS="$CPPFLAGS"
 +      SAVE_LDFLAGS="$LDFLAGS"
 +      CPPFLAGS="$CPPFLAGS $with_librabbitmq_cppflags"
 +      LDFLAGS="$LDFLAGS $with_librabbitmq_ldflags"
 +
 +      AC_CHECK_LIB(rabbitmq, amqp_basic_publish, [with_librabbitmq="yes"], [with_librabbitmq="no (Symbol 'amqp_basic_publish' not found)"])
 +
 +      CPPFLAGS="$SAVE_CPPFLAGS"
 +      LDFLAGS="$SAVE_LDFLAGS"
 +fi
 +if test "x$with_librabbitmq" = "xyes"
 +then
 +      BUILD_WITH_LIBRABBITMQ_CPPFLAGS="$with_librabbitmq_cppflags"
 +      BUILD_WITH_LIBRABBITMQ_LDFLAGS="$with_librabbitmq_ldflags"
 +      BUILD_WITH_LIBRABBITMQ_LIBS="-lrabbitmq"
 +      AC_SUBST(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
 +      AC_SUBST(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
 +      AC_SUBST(BUILD_WITH_LIBRABBITMQ_LIBS)
 +      AC_DEFINE(HAVE_LIBRABBITMQ, 1, [Define if librabbitmq is present and usable.])
 +fi
 +AM_CONDITIONAL(BUILD_WITH_LIBRABBITMQ, test "x$with_librabbitmq" = "xyes")
 +# }}}
 +
  # --with-librouteros {{{
  AC_ARG_WITH(librouteros, [AS_HELP_STRING([--with-librouteros@<:@=PREFIX@:>@], [Path to librouteros.])],
  [
@@@ -4385,7 -4340,6 +4391,7 @@@ the
  fi
  if test "x$have_sysctlbyname" = "xyes"
  then
 +      plugin_contextswitch="yes"
        plugin_cpu="yes"
        plugin_memory="yes"
        plugin_tcpconns="yes"
@@@ -4513,7 -4467,6 +4519,7 @@@ AC_ARG_ENABLE([all-plugins]
  
  m4_divert_once([HELP_ENABLE], [])
  
 +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])
@@@ -4548,6 -4501,7 +4554,7 @@@ AC_PLUGIN([java],        [$with_java]
  AC_PLUGIN([libvirt],     [$plugin_libvirt],    [Virtual machine statistics])
  AC_PLUGIN([load],        [$plugin_load],       [System load])
  AC_PLUGIN([logfile],     [yes],                [File logging plugin])
+ AC_PLUGIN([lpar],        [$with_perfstat],     [AIX logical partitions 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])
@@@ -4813,7 -4767,6 +4820,7 @@@ Configuration
      libperl . . . . . . . $with_libperl
      libpq . . . . . . . . $with_libpq
      libpthread  . . . . . $with_libpthread
 +    librabbitmq . . . . . $with_librabbitmq
      librouteros . . . . . $with_librouteros
      librrd  . . . . . . . $with_librrd
      libsensors  . . . . . $with_libsensors
      perl  . . . . . . . . $with_perl_bindings
  
    Modules:
 +    amqp    . . . . . . . $enable_amqp
      apache  . . . . . . . $enable_apache
      apcups  . . . . . . . $enable_apcups
      apple_sensors . . . . $enable_apple_sensors
      libvirt . . . . . . . $enable_libvirt
      load  . . . . . . . . $enable_load
      logfile . . . . . . . $enable_logfile
+     lpar... . . . . . . . $enable_lpar
      madwifi . . . . . . . $enable_madwifi
      match_empty_counter . $enable_match_empty_counter
      match_hashed  . . . . $enable_match_hashed
diff --combined src/Makefile.am
@@@ -123,18 -123,6 +123,18 @@@ pkglib_LTLIBRARIES 
  BUILT_SOURCES = 
  CLEANFILES = 
  
 +if BUILD_PLUGIN_AMQP
 +pkglib_LTLIBRARIES += amqp.la
 +amqp_la_SOURCES = amqp.c \
 +                utils_cmd_putval.c utils_cmd_putval.h \
 +                utils_format_json.c utils_format_json.h
 +amqp_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBRABBITMQ_LDFLAGS)
 +amqp_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBRABBITMQ_CPPFLAGS)
 +amqp_la_LIBADD = $(BUILD_WITH_LIBRABBITMQ_LIBS)
 +collectd_LDADD += "-dlopen" amqp.la
 +collectd_DEPENDENCIES += amqp.la
 +endif
 +
  if BUILD_PLUGIN_APACHE
  pkglib_LTLIBRARIES += apache.la
  apache_la_SOURCES = apache.c
@@@ -524,6 -512,15 +524,15 @@@ collectd_LDADD += "-dlopen" logfile.l
  collectd_DEPENDENCIES += logfile.la
  endif
  
+ if BUILD_PLUGIN_LPAR
+ pkglib_LTLIBRARIES += lpar.la
+ lpar_la_SOURCES = lpar.c
+ lpar_la_LDFLAGS = -module -avoid-version
+ collectd_LDADD += "-dlopen" lpar.la
+ collectd_DEPENDENCIES += lpar.la
+ lpar_la_LIBADD = -lperfstat
+ endif
  if BUILD_PLUGIN_MADWIFI
  pkglib_LTLIBRARIES += madwifi.la
  madwifi_la_SOURCES = madwifi.c madwifi.h
diff --combined src/types.db
@@@ -28,7 -28,6 +28,7 @@@ cpufreq                       value:GAUGE:0:
  cpu                   value:COUNTER:0:4294967295
  current                       value:GAUGE:U:U
  current_connections   value:GAUGE:0:U
 +current_sessions      value:GAUGE:0:U
  delay                 seconds:GAUGE:-1000000:1000000
  derive                        value:DERIVE:0:U
  df                    used:GAUGE:0:1125899906842623, free:GAUGE:0:1125899906842623
@@@ -166,6 -165,7 +166,7 @@@ total_time_in_ms   value:DERIVE:0:
  total_values          value:DERIVE:0:U
  uptime                        value:GAUGE:0:4294967295
  users                 users:GAUGE:0:65535
+ vcpu                  value:GAUGE:0:U
  virt_cpu_total                ns:COUNTER:0:256000000000
  virt_vcpu             ns:COUNTER:0:1000000000
  vmpage_action         value:COUNTER:0:4294967295