Merge branch 'master' into ff/java
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Wed, 18 Feb 2009 17:46:40 +0000 (18:46 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Wed, 18 Feb 2009 17:46:40 +0000 (18:46 +0100)
1  2 
configure.in
src/Makefile.am
src/collectd.conf.pod

diff --combined configure.in
  fi
  # }}}
  
 +# --with-java {{{
 +with_java_home="$JAVA_HOME"
 +with_java_vmtype="client"
 +with_java_cflags=""
 +with_java_libs=""
 +AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
 +[
 +      if test "x$withval" = "xno"
 +      then
 +              with_java="no"
 +      else if test "x$withval" = "xyes"
 +      then
 +              with_java="yes"
 +      else
 +              with_java_home="$withval"
 +              with_java="yes"
 +      fi; fi
 +],
 +[with_java="yes"])
 +if test "x$with_java" = "xyes"
 +then
 +      if test -d "$with_java_home"
 +      then
 +              if test -d "$with_java_home/include"
 +              then
 +                      JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$with_java_home/include"
 +              else
 +                      JAVA_CPPFLAGS="$JAVA_CPPFLAGS -I$with_java_home"
 +              fi
 +              
 +              if test -d "$with_java_home/lib"
 +              then
 +                      JAVA_LDFLAGS="$JAVA_LDFLAGS -L$with_java_home/lib"
 +              else
 +                      JAVA_LDFLAGS="$JAVA_LDFLAGS -L$with_java_home"
 +              fi
 +      else if test "x$with_java_home" != "x"
 +      then
 +              AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
 +      fi; fi
 +fi
 +
 +if test "x$JAVA_CPPFLAGS" != "x"
 +then
 +      AC_MSG_NOTICE([Building with JAVA_CPPFLAGS set to: $JAVA_CPPFLAGS])
 +fi
 +if test "x$JAVA_CFLAGS" != "x"
 +then
 +      AC_MSG_NOTICE([Building with JAVA_CFLAGS set to: $JAVA_CFLAGS])
 +fi
 +if test "x$JAVA_LDFLAGS" != "x"
 +then
 +      AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
 +fi
 +
 +SAVE_CPPFLAGS="$CPPFLAGS"
 +SAVE_CFLAGS="$CFLAGS"
 +SAVE_LDFLAGS="$LDFLAGS"
 +CPPFLAGS="$CPPFLAGS $JAVA_CPPFLAGS"
 +CFLAGS="$CFLAGS $JAVA_CFLAGS"
 +LDFLAGS="$LDFLAGS $JAVA_LDFLAGS"
 +
 +if test "x$with_java" = "xyes"
 +then
 +      AC_CHECK_HEADERS(jni.h, [], [with_java="no (jni.h not found)"])
 +fi
 +if test "x$with_java" = "xyes"
 +then
 +      AC_CHECK_LIB(jvm, JNI_CreateJavaVM,
 +      [with_java="yes"],
 +      [with_java="no (libjvm not found)"],
 +      [$JAVA_LIBS])
 +fi
 +if test "x$with_java" = "xyes"
 +then
 +      JAVA_LIBS="$JAVA_LIBS -ljvm"
 +      AC_MSG_NOTICE([Building with JAVA_LIBS set to: $JAVA_LIBS])
 +fi
 +
 +CPPFLAGS="$SAVE_CPPFLAGS"
 +CFLAGS="$SAVE_CFLAGS"
 +LDFLAGS="$SAVE_LDFLAGS"
 +
 +AC_SUBST(JAVA_CPPFLAGS)
 +AC_SUBST(JAVA_CFLAGS)
 +AC_SUBST(JAVA_LDFLAGS)
 +AC_SUBST(JAVA_LIBS)
 +AM_CONDITIONAL(BUILD_WITH_JAVA, test "x$with_java" = "xyes")
 +# }}}
 +
  # --with-libmysql {{{
  with_mysql_config="mysql_config"
  with_mysql_cflags=""
@@@ -1853,78 -1763,6 +1853,6 @@@ AC_DEFINE_UNQUOTED(COLLECT_LIBPCAP, [$c
  AM_CONDITIONAL(BUILD_WITH_LIBPCAP, test "x$with_libpcap" = "xyes")
  # }}}
  
- # --with-libpcre {{{
- with_pcre_config="pcre-config"
- with_pcre_cflags=""
- with_pcre_libs=""
- AC_ARG_WITH(libpcre, [AS_HELP_STRING([--with-libpcre@<:@=PREFIX@:>@],
-       [Path to libpcre.])],
-       [
-               if test "x$withval" = "xno"
-               then
-                       with_libpcre="no"
-               else if test "x$withval" = "xyes"
-               then
-                       with_libpcre="yes"
-               else
-                       if test -f "$withval" && test -x "$withval"
-                       then
-                               with_pcre_config="$withval"
-                       else if test -x "$withval/bin/pcre-config"
-                       then
-                               with_pcre_config="$withval/bin/pcre-config"
-                       fi; fi
-                       with_libpcre="yes"
-               fi; fi
-       ],
-       [
-               with_libpcre="yes"
-       ])
- if test "x$with_libpcre" = "xyes"
- then
-       with_pcre_cflags=`$with_pcre_config --cflags 2>/dev/null`
-       pcre_config_status=$?
-       if test $pcre_config_status -ne 0
-       then
-               with_libpcre="no ($with_pcre_config failed)"
-       else
-               SAVE_CPPFLAGS="$CPPFLAGS"
-               CPPFLAGS="$CPPFLAGS $with_pcre_cflags"
-               AC_CHECK_HEADERS(pcre.h, [], [with_libpcre="no (pcre.h not found)"], [])
-               CPPFLAGS="$SAVE_CPPFLAGS"
-       fi
- fi
- if test "x$with_libpcre" = "xyes"
- then
-       with_pcre_libs=`$with_pcre_config --libs 2>/dev/null`
-       pcre_config_status=$?
-       if test $pcre_config_status -ne 0
-       then
-               with_libpcre="no ($with_pcre_config failed)"
-       else
-               AC_CHECK_LIB(pcre, pcre_compile,
-                       [with_libpcre="yes"],
-                       [with_libpcre="no (symbol 'pcre_compile' not found)"],
-                       [$with_pcre_libs])
-       fi
- fi
- if test "x$with_libpcre" = "xyes"
- then
-       BUILD_WITH_LIBPCRE_CFLAGS="$with_pcre_cflags"
-       BUILD_WITH_LIBPCRE_LIBS="$with_pcre_libs"
-       AC_SUBST(BUILD_WITH_LIBPCRE_CFLAGS)
-       AC_SUBST(BUILD_WITH_LIBPCRE_LIBS)
- fi
- AM_CONDITIONAL(BUILD_WITH_LIBPCRE, test "x$with_libpcre" = "xyes")
- # }}}
  # --with-libperl {{{
  perl_interpreter="perl"
  AC_ARG_WITH(libperl, [AS_HELP_STRING([--with-libperl@<:@=PREFIX@:>@], [Path to libperl.])],
@@@ -3224,7 -3062,6 +3152,7 @@@ AC_PLUGIN([ipmi],        [$plugin_ipmi]
  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([libvirt],     [$plugin_libvirt],    [Virtual machine statistics])
  AC_PLUGIN([load],        [$plugin_load],       [System load])
  AC_PLUGIN([logfile],     [yes],                [File logging plugin])
@@@ -3370,7 -3207,6 +3298,7 @@@ Configuration
      libesmtp  . . . . . . $with_libesmtp
      libiokit  . . . . . . $with_libiokit
      libiptc . . . . . . . $with_libiptc
 +    libjvm  . . . . . . . $with_java
      libkstat  . . . . . . $with_kstat
      libkvm  . . . . . . . $with_libkvm
      libmysql  . . . . . . $with_libmysql
      libopenipmi . . . . . $with_libopenipmipthread
      liboping  . . . . . . $with_liboping
      libpcap . . . . . . . $with_libpcap
-     libpcre . . . . . . . $with_libpcre
      libperl . . . . . . . $with_libperl
      libpq . . . . . . . . $with_libpq
      libpthread  . . . . . $with_libpthread
      iptables  . . . . . . $enable_iptables
      ipvs  . . . . . . . . $enable_ipvs
      irq . . . . . . . . . $enable_irq
 +    java  . . . . . . . . $enable_java
      libvirt . . . . . . . $enable_libvirt
      load  . . . . . . . . $enable_load
      logfile . . . . . . . $enable_logfile
diff --combined src/Makefile.am
@@@ -378,17 -378,6 +378,17 @@@ collectd_LDADD += "-dlopen" irq.l
  collectd_DEPENDENCIES += irq.la
  endif
  
 +if BUILD_PLUGIN_JAVA
 +pkglib_LTLIBRARIES += java.la
 +java_la_SOURCES = java.c
 +java_la_CPPFLAGS = $(AM_CPPFLAGS) $(JAVA_CPPFLAGS)
 +java_la_CFLAGS = $(AM_CFLAGS) $(JAVA_CFLAGS)
 +java_la_LDFLAGS = -module -avoid-version $(JAVA_LDFLAGS)
 +java_la_LIBADD = $(JAVA_LIBS)
 +collectd_LDADD += "-dlopen" java.la
 +collectd_DEPENDENCIES += java.la
 +endif
 +
  if BUILD_PLUGIN_LIBVIRT
  pkglib_LTLIBRARIES += libvirt.la
  libvirt_la_SOURCES = libvirt.c
@@@ -425,9 -414,7 +425,7 @@@ endi
  if BUILD_PLUGIN_MATCH_REGEX
  pkglib_LTLIBRARIES += match_regex.la
  match_regex_la_SOURCES = match_regex.c
- match_regex_la_CPPFLAGS = $(BUILD_WITH_LIBPCRE_CFLAGS)
- match_regex_la_LDFLAGS = -module -avoid-version \
-               $(BUILD_WITH_LIBPCRE_LIBS)
+ match_regex_la_LDFLAGS = -module -avoid-version
  collectd_LDADD += "-dlopen" match_regex.la
  collectd_DEPENDENCIES += match_regex.la
  endif
diff --combined src/collectd.conf.pod
@@@ -959,97 -959,6 +959,6 @@@ Controls whether or not to recurse int
  
  =back
  
- =head2 Plugin C<filter_pcre>
- This plugin allows you to filter and rewrite value lists based on
- Perl-compatible regular expressions whose syntax and semantics are as close as
- possible to those of the Perl 5 language. See L<pcre(3)> for details.
-   <Plugin filter_pcre>
-     <RegEx>
-       Host "^mail\d+$"
-       Plugin "^tcpconns$"
-       TypeInstance "^SYN_"
-       Action NoWrite
-     </RegEx>
-     <RegEx>
-       Plugin "^sensors$"
-       PluginInstance "^Some Weird Sensor Chip Name Prefix"
-       SubstitutePluginInstance "foo"
-     </RegEx>
-   </Plugin>
- The configuration consists of one or more C<RegEx> blocks, each of which
- specifies a regular expression identifying a set of value lists and how to
- handle successful matches. A value list keeps the values of a single data-set
- and is identified by the tuple (host, plugin, plugin instance, type, type
- instance). The plugin and type instances are optional components. If they are
- missing they are treated as empty strings. Within those blocks, the following
- options are recognized:
- =over 4
- =item B<Host> I<regex>
- =item B<Plugin> I<regex>
- =item B<PluginInstance> I<regex>
- =item B<Type> I<regex>
- =item B<TypeInstance> I<regex>
- Specifies the regular expression for each component of the identifier. If any
- of these options is missing it is interpreted as a pattern which matches any
- string. All five components of a value list have to match the appropriate
- regular expression to trigger the specified action.
- =item B<Action> I<NoWrite>|I<NoThresholdCheck>|I<Ignore>
- Specify how to handle successful matches:
- =over 4
- =item B<NoWrite>
- Do not send the value list to any output (a.k.a. write) plugins.
- =item B<NoThresholdCheck>
- Skip threshold checking for this value list.
- =item B<Ignore>
- Completely ignore this value list.
- =back
- Two or more actions may be combined by specifying multiple B<Action> options.
- =item B<SubstituteHost> I<replacement>
- =item B<SubstitutePlugin> I<replacement>
- =item B<SubstitutePluginInstance> I<replacement>
- =item B<SubstituteType> I<replacement>
- =item B<SubstituteTypeInstance> I<replacement>
- Upon a successful match, the matching substring will be replaced by the
- specified I<replacement> text. These options require that an appropriate regex
- has been specified before, e.E<nbsp>g. B<SubstituteHost> requires that the
- B<Host> option has been specified before.
- B<Note>: It is not recommended to modify the type unless you really know what
- you are doing. The type is used to identify the data-set definition of the
- dispatched values.
- =back
  =head2 Plugin C<hddtemp>
  
  To get values from B<hddtemp> collectd connects to B<localhost> (127.0.0.1),
@@@ -1174,57 -1083,6 +1083,57 @@@ and all other interrupts are collected
  
  =back
  
 +=head2 Plugin C<java>
 +
 +Synopsis:
 +
 + <Plugin "java">
 +   JVMArg "-verbose:jni"
 +   JVMArg "-Djava.class.path=/opt/collectd/lib/collectd/bindings/java"
 +   LoadPlugin "org.collectd.java.Foobar"
 +   # FIXME: The following is planned, but not finished!
 +   <Plugin "org.collectd.java.Foobar">
 +     # To be parsed by the plugin
 +   </Plugin>
 + </Plugin>
 +
 +Available config options:
 +
 +=over 4
 +
 +=item B<JVMArg> I<Argument>
 +
 +Argument that is to be passed to the I<Java Virtual Machine> (JVM). This works
 +exactly the way the arguments to the I<java> binary on the command line work.
 +Execute C<javaE<nbsp>--help> for details.
 +
 +=item B<LoadPlugin> I<JavaClass>
 +
 +Instantiates a new I<JavaClass> object. The following methods of this class are
 +used when available:
 +
 +=over 4
 +
 +=item *
 +
 +public int B<Init> ()
 +
 +=item *
 +
 +public int B<Read> ()
 +
 +=item *
 +
 +public int B<Write> (org.collectd.protocol.ValueList vl)
 +
 +=item *
 +
 +public int B<Shutdown> ()
 +
 +=back
 +
 +=back
 +
  =head2 Plugin C<libvirt>
  
  This plugin allows CPU, disk and network load to be collected for virtualized
@@@ -3660,7 -3518,6 +3569,6 @@@ L<hddtemp(8)>
  L<iptables(8)>,
  L<kstat(3KSTAT)>,
  L<mbmon(1)>,
- L<pcre(3)>,
  L<psql(1)>,
  L<regex(7)>,
  L<rrdtool(1)>,