Merge branch 'collectd-4.7'
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Mon, 11 May 2009 20:24:58 +0000 (22:24 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Mon, 11 May 2009 20:24:58 +0000 (22:24 +0200)
ChangeLog
README
bindings/Makefile.am
bindings/java/Makefile.am [new file with mode: 0644]
configure.in
contrib/README
src/collectd.conf.in
src/collectd.conf.pod
src/memcachec.c
version-gen.sh

index 9d85ff0..3fdf0ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-2009-05-01, Version 4.7.0
+2009-05-11, Version 4.7.0
        * apache plugin: Support to query multiple servers has been added.
          Thanks to Amit Gupta for the patch.
        * apache plugin: Handling of lighttpd's scoreboard statistics has been
        * uptime plugin: The new uptime plugin can collect the server's
          uptime. Thanks to Marco Chiappero for the patch.
 
+2009-05-09, Version 4.5.4
+       * Build system, various plugins: Many build fixes for FreeBSD,
+         OpenBSD, NetBSD, Solaris and Mac OS X. Big thanks to Doug MacEachern
+         for many fixes and providing a build system for many platforms,
+         Ulf Zimmermann for providing a FreeBSD system and Simon Kuhnle for
+         providing an OpenBSD system.
+       * collectd: Fix a potential race condition when creating directories.
+       * battery plugin: Don't complain about a missing directory every
+         interval.
+       * dns plugin: Slight portability fixes.
+       * exec plugin: Allow executed programs to close STDERR. Thanks to
+         Thorsten von Eicken for reporting this problem.
+       * irq plugin: Fix handling of overflowing 32-bit counters. Thanks to
+         Tomasz Pala for the patch.
+       * perl plugin: Portability build-fixes. Thanks to Doug MacEachern for
+         the patch.
+       * rrdtool plugin: Fix a possible race condition: If the network plugin
+         is initialized and dispatches a value before the rrdtool plugin is
+         initialized, the daemon may crash.
+       * memory plugin: Fix a potential problem under Solaris.
+
 2009-03-18, Version 4.6.2
        * collectd: Some Solaris utility code has been improved.
        * filter subsystem: Allow `Chains' without default targets.
diff --git a/README b/README
index e47493a..c3a5940 100644 (file)
--- a/README
+++ b/README
@@ -82,6 +82,9 @@ Features
     - filecount
       Count the number of files in directories.
 
+    - fscache
+      Linux file-system based caching framework statistics.
+
     - gmond
       Receive multicast traffic from Ganglia instances.
 
@@ -121,6 +124,9 @@ Features
       Motherboard sensors: temperature, fanspeed and voltage information,
       using mbmon(1).
 
+    - memcachec
+      Query and parse data from a memcache daemon (memcached).
+
     - memcached
       Statistics of the memcached distributed caching system.
       <http://www.danga.com/memcached/>
@@ -213,6 +219,9 @@ Features
     - swap
       Pages swapped out onto harddisk or whatever is called `swap' by the OS..
 
+    - table
+      Parse table-like structured files.
+
     - tail
       Follows (tails) logfiles, parses them by lines and submits matched
       values.
@@ -232,6 +241,9 @@ Features
     - thermal
       Linux ACPI thermal zone information.
 
+    - uptime
+      System uptime statistics.
+
     - users
       Users currently logged in.
 
@@ -434,6 +446,12 @@ Prerequisites
     For the `notify_email' plugin.
     <http://www.stafford.uklinux.net/libesmtp/>
 
+  * libganglia (optional)
+    Used by the `gmond' plugin to process data received from Ganglia.
+
+  * libgcrypt (optional)
+    Used by the `network' plugin for encryption and authentication.
+
   * libhal (optional)
     If present, the uuid plugin will check for UUID from HAL.
     <http://hal.freedesktop.org/>
@@ -448,6 +466,9 @@ Prerequisites
     used by the Java plugin to execute Java bytecode. See “Configuring with
     libjvm” below.
 
+  * libmemcached (optional)
+    Used by the `memcachec' plugin to connect to a memcache daemon.
+
   * libmysqlclient (optional)
     Unsurprisingly used by the `mysql' plugin.
     <http://dev.mysql.com/>
@@ -538,10 +559,16 @@ Configuring / Compiling / Installing
   will be enabled). To enable a plugin, install missing dependencies (see
   section `Prerequisites' above) and rerun `configure'. If you specify the
   `--enable-<plugin>' configure option, the script will fail if the depen-
-  dencies for the specified plugin are not met. If you specify the
-  `--disable-<plugin>' configure option, the plugin will not be built. Both
-  options are meant for package maintainers and should not be used in everyday
-  situations.
+  dencies for the specified plugin are not met. In that case you can force the
+  plugin to be built using the `--enable-<plugin>=force' configure option.
+  This will most likely fail though unless you're working in a very unusual
+  setup and you really know what you're doing. If you specify the
+  `--disable-<plugin>' configure option, the plugin will not be built. If you
+  specify the `--enable-all-plugins' or `--disable-all-plugins' configure
+  options, all plugins will be enabled or disabled respectively by default.
+  Explicitly enabling or disabling a plugin overwrites the default for the
+  specified plugin. These options are meant for package maintainers and should
+  not be used in everyday situations.
 
   By default, collectd will be installed into `/opt/collectd'. You can adjust
   this setting by specifying the `--prefix' configure option - see INSTALL for
index 620389f..fb68657 100644 (file)
@@ -1,3 +1,9 @@
+SUBDIRS =
+
+if BUILD_WITH_JAVA
+SUBDIRS += java
+endif
+
 EXTRA_DIST = perl/Collectd.pm perl/Makefile.PL perl/Collectd/Makefile.PL \
                perl/Collectd/Unixsock.pm
 
diff --git a/bindings/java/Makefile.am b/bindings/java/Makefile.am
new file mode 100644 (file)
index 0000000..668335a
--- /dev/null
@@ -0,0 +1,35 @@
+EXTRA_DIST = org/collectd/api/CollectdConfigInterface.java \
+            org/collectd/api/CollectdFlushInterface.java \
+            org/collectd/api/CollectdInitInterface.java \
+            org/collectd/api/Collectd.java \
+            org/collectd/api/CollectdLogInterface.java \
+            org/collectd/api/CollectdMatchFactoryInterface.java \
+            org/collectd/api/CollectdMatchInterface.java \
+            org/collectd/api/CollectdNotificationInterface.java \
+            org/collectd/api/CollectdReadInterface.java \
+            org/collectd/api/CollectdShutdownInterface.java \
+            org/collectd/api/CollectdTargetFactoryInterface.java \
+            org/collectd/api/CollectdTargetInterface.java \
+            org/collectd/api/CollectdWriteInterface.java \
+            org/collectd/api/DataSet.java \
+            org/collectd/api/DataSource.java \
+            org/collectd/api/Notification.java \
+            org/collectd/api/OConfigItem.java \
+            org/collectd/api/OConfigValue.java \
+            org/collectd/api/PluginData.java \
+            org/collectd/api/ValueList.java
+
+java-build-stamp: org/collectd/api/*.java
+       $(JAVAC) -d "." "$(srcdir)/org/collectd/api"/*.java
+       touch "$@"
+
+all-local: java-build-stamp
+
+install-exec-local: java-build-stamp
+       mkdir -p "$(pkgdatadir)/java/org/collectd/api"
+       $(INSTALL) -m 644 "org/collectd/api"/*.class \
+               "$(DESTDIR)$(pkgdatadir)/java/org/collectd/api/"
+
+clean-local:
+       rm -f "org/collectd/api"/*.class
+       rm -f "java-build-stamp"
index 1d9ef93..c9d7629 100644 (file)
@@ -1481,6 +1481,7 @@ with_java_home="$JAVA_HOME"
 with_java_vmtype="client"
 with_java_cflags=""
 with_java_libs=""
+JAVAC="$JAVAC"
 AC_ARG_WITH(java, [AS_HELP_STRING([--with-java@<:@=PREFIX@:>@], [Path to Java home.])],
 [
        if test "x$withval" = "xno"
@@ -1528,6 +1529,19 @@ then
                else
                        AC_MSG_RESULT([not found])
                fi
+
+               if test "x$JAVAC" = "x"
+               then
+                       AC_MSG_CHECKING([for javac])
+                       TMPDIR=`find -L "$with_java_home" -name javac | head -n 1`
+                       if test "x$TMPDIR" != "x"
+                       then
+                               JAVAC="$TMPDIR"
+                               AC_MSG_RESULT([$JAVAC])
+                       else
+                               AC_MSG_RESULT([not found])
+                       fi
+               fi
        else if test "x$with_java_home" != "x"
        then
                AC_MSG_WARN([JAVA_HOME: No such directory: $with_java_home])
@@ -1546,6 +1560,24 @@ if test "x$JAVA_LDFLAGS" != "x"
 then
        AC_MSG_NOTICE([Building with JAVA_LDFLAGS set to: $JAVA_LDFLAGS])
 fi
+if test "x$JAVAC" = "x"
+then
+       with_javac_path="$PATH"
+       if test "x$with_java_home" != "x"
+       then
+               with_javac_path="$with_java_home:with_javac_path"
+               if test -d "$with_java_home/bin"
+               then
+                       with_javac_path="$with_java_home/bin:with_javac_path"
+               fi
+       fi
+
+       AC_PATH_PROG(JAVAC, javac, [], "$with_javac_path")
+fi
+if test "x$JAVAC" = "x"
+then
+       with_java="no (javac not found)"
+fi
 
 SAVE_CPPFLAGS="$CPPFLAGS"
 SAVE_CFLAGS="$CFLAGS"
@@ -3242,28 +3274,42 @@ AC_DEFUN(
   [AC_PLUGIN],
   [
     enable_plugin="no"
+    force="no"
     AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
     [
      if test "x$enableval" = "xyes"
      then
             enable_plugin="yes"
-     else
-            enable_plugin="no"
-     fi
-    ],
-    [
-     if test "x$2" = "xyes"
+     else if test "x$enableval" = "xforce"
      then
             enable_plugin="yes"
+            force="yes"
      else
             enable_plugin="no"
-     fi
+     fi; fi
+    ],
+    [
+        if test "x$enable_all_plugins" = "xauto"
+        then
+            if test "x$2" = "xyes"
+            then
+                    enable_plugin="yes"
+            else
+                    enable_plugin="no"
+            fi
+        else
+            enable_plugin="$enable_all_plugins"
+        fi
     ])
     if test "x$enable_plugin" = "xyes"
     then
-           if test "x$2" = "xyes"
+           if test "x$2" = "xyes" || test "x$force" = "xyes"
            then
                    AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
+                   if test "x$2" != "xyes"
+                   then
+                           dependency_warning="yes"
+                   fi
            else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
                    dependency_error="yes"
                    enable_plugin="no (dependency error)"
@@ -3281,7 +3327,9 @@ AC_COLLECTD([debug],     [enable],  [feature], [debugging])
 AC_COLLECTD([daemon],    [disable], [feature], [daemon mode])
 AC_COLLECTD([getifaddrs],[enable],  [feature], [getifaddrs under Linux])
 
+dependency_warning="no"
 dependency_error="no"
+
 plugin_ascent="no"
 plugin_battery="no"
 plugin_bind="no"
@@ -3531,6 +3579,24 @@ fi
 m4_divert_once([HELP_ENABLE], [
 collectd plugins:])
 
+AC_ARG_ENABLE([all-plugins],
+               AC_HELP_STRING([--enable-all-plugins],
+                               [enable all plugins (auto by def)]),
+               [
+                if test "x$enableval" = "xyes"
+                then
+                        enable_all_plugins="yes"
+                else if test "x$enableval" = "xauto"
+                then
+                        enable_all_plugins="auto"
+                else
+                        enable_all_plugins="no"
+                fi; fi
+               ],
+               [enable_all_plugins="auto"])
+
+m4_divert_once([HELP_ENABLE], [])
+
 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])
@@ -3551,6 +3617,7 @@ AC_PLUGIN([email],       [yes],                [EMail statistics])
 AC_PLUGIN([entropy],     [$plugin_entropy],    [Entropy statistics])
 AC_PLUGIN([exec],        [yes],                [Execution of external programs])
 AC_PLUGIN([filecount],   [yes],                [Count files in directories])
+AC_PLUGIN([fscache],     [$plugin_fscache],    [fscache statistics])
 AC_PLUGIN([gmond],       [$with_libganglia],   [Ganglia plugin])
 AC_PLUGIN([hddtemp],     [yes],                [Query hddtempd])
 AC_PLUGIN([interface],   [$plugin_interface],  [Interface traffic statistics])
@@ -3574,7 +3641,6 @@ AC_PLUGIN([mysql],       [$with_libmysql],     [MySQL statistics])
 AC_PLUGIN([netlink],     [$with_libnetlink],   [Enhanced Linux network statistics])
 AC_PLUGIN([network],     [yes],                [Network communication plugin])
 AC_PLUGIN([nfs],         [$plugin_nfs],        [NFS statistics])
-AC_PLUGIN([fscache],     [$plugin_fscache],    [fscache statistics])
 AC_PLUGIN([nginx],       [$with_libcurl],      [nginx statistics])
 AC_PLUGIN([notify_desktop], [$with_libnotify], [Desktop notifications])
 AC_PLUGIN([notify_email], [$with_libesmtp],    [Email notifier])
@@ -3749,7 +3815,7 @@ AC_SUBST(LCC_VERSION_STRING)
 
 AC_CONFIG_FILES(src/libcollectdclient/lcc_features.h)
 
-AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libiptc/Makefile src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile)
+AC_OUTPUT(Makefile src/Makefile src/collectd.conf src/libiptc/Makefile 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"
@@ -3836,6 +3902,7 @@ Configuration:
     entropy . . . . . . . $enable_entropy
     exec  . . . . . . . . $enable_exec
     filecount . . . . . . $enable_filecount
+    fscache . . . . . . . $enable_fscache
     gmond . . . . . . . . $enable_gmond
     hddtemp . . . . . . . $enable_hddtemp
     interface . . . . . . $enable_interface
@@ -3859,7 +3926,6 @@ Configuration:
     netlink . . . . . . . $enable_netlink
     network . . . . . . . $enable_network
     nfs . . . . . . . . . $enable_nfs
-    fscache . . . . . . . $enable_fscache
     nginx . . . . . . . . $enable_nginx
     notify_desktop  . . . $enable_notify_desktop
     notify_email  . . . . $enable_notify_email
@@ -3903,7 +3969,11 @@ Configuration:
 EOF
 
 if test "x$dependency_error" = "xyes"; then
-       AC_MSG_ERROR("Some plugins are missing dependencies - see above summary for details")
+       AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
+fi
+
+if test "x$dependency_warning" = "xyes"; then
+       AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
 fi
 
 # vim: set fdm=marker :
index 01b9e2c..119d866 100644 (file)
@@ -11,6 +11,19 @@ resolution and 2200 rows (~6 hours). This will make hourly statistics much more
 interesting. Please note that no sanity- checking whatsoever is performed. You
 can seriously fuck up your RRD files if you don't know what you're doing.
 
+collectd-network.py
+-------------------
+
+  This Python module by Adrian Perez implements the collectd network protocol
+in pure Python. It currently supports to receive data and notifications from
+collectd.
+
+collectd-unixsock.py
+--------------------
+
+  This Python module by Clay Loveless provides an interface to collect's
+unixsock plugin.
+
 collectd2html.pl
 ----------------
   This script by Vincent Stehlé will search for RRD files in
index 2e2237f..c69b816 100644 (file)
@@ -70,6 +70,7 @@ FQDNLookup   true
 #@BUILD_PLUGIN_ENTROPY_TRUE@LoadPlugin entropy
 #@BUILD_PLUGIN_EXEC_TRUE@LoadPlugin exec
 #@BUILD_PLUGIN_FILECOUNT_TRUE@LoadPlugin filecount
+#@BUILD_PLUGIN_FSCACHE_TRUE@LoadPlugin fscache
 #@BUILD_PLUGIN_GMOND_TRUE@LoadPlugin gmond
 #@BUILD_PLUGIN_HDDTEMP_TRUE@LoadPlugin hddtemp
 @BUILD_PLUGIN_INTERFACE_TRUE@@BUILD_PLUGIN_INTERFACE_TRUE@LoadPlugin interface
@@ -81,6 +82,7 @@ FQDNLookup   true
 #@BUILD_PLUGIN_LIBVIRT_TRUE@LoadPlugin libvirt
 @BUILD_PLUGIN_LOAD_TRUE@@BUILD_PLUGIN_LOAD_TRUE@LoadPlugin load
 #@BUILD_PLUGIN_MBMON_TRUE@LoadPlugin mbmon
+#@BUILD_PLUGIN_MEMCACHEC_TRUE@LoadPlugin memcachec
 #@BUILD_PLUGIN_MEMCACHED_TRUE@LoadPlugin memcached
 @BUILD_PLUGIN_MEMORY_TRUE@@BUILD_PLUGIN_MEMORY_TRUE@LoadPlugin memory
 #@BUILD_PLUGIN_MULTIMETER_TRUE@LoadPlugin multimeter
@@ -108,10 +110,12 @@ FQDNLookup   true
 #@BUILD_PLUGIN_SERIAL_TRUE@LoadPlugin serial
 #@BUILD_PLUGIN_SNMP_TRUE@LoadPlugin snmp
 #@BUILD_PLUGIN_SWAP_TRUE@LoadPlugin swap
+#@BUILD_PLUGIN_TABLE_TRUE@LoadPlugin table
 #@BUILD_PLUGIN_TAIL_TRUE@LoadPlugin tail
 #@BUILD_PLUGIN_TAPE_TRUE@LoadPlugin tape
 #@BUILD_PLUGIN_TCPCONNS_TRUE@LoadPlugin tcpconns
 #@BUILD_PLUGIN_TEAMSPEAK2_TRUE@LoadPlugin teamspeak2
+#@BUILD_PLUGIN_TED_TRUE@LoadPlugin ted
 #@BUILD_PLUGIN_THERMAL_TRUE@LoadPlugin thermal
 #@BUILD_PLUGIN_UNIXSOCK_TRUE@LoadPlugin unixsock
 #@BUILD_PLUGIN_UPTIME_TRUE@LoadPlugin uptime
@@ -345,6 +349,19 @@ FQDNLookup   true
 #      Port "411"
 #</Plugin>
 
+#<Plugin memcachec>
+#      <Page "plugin_instance">
+#              Server "localhost"
+#              Key "page_key"
+#              <Match>
+#                      Regex "(\\d+) bytes sent"
+#                      DSType CounterAdd
+#                      Type "ipt_octets"
+#                      Instance "type_instance"
+#              </Match>
+#      </Page>
+#</Plugin>
+
 #<Plugin memcached>
 #      Host "127.0.0.1"
 #      Port "11211"
@@ -590,6 +607,25 @@ FQDNLookup   true
 #   </Host>
 #</Plugin>
 
+#<Plugin "table">
+#      <Table "/proc/slabinfo">
+#              Instance "slabinfo"
+#              Separator " "
+#              <Result>
+#                      Type gauge
+#                      InstancePrefix "active_objs"
+#                      InstancesFrom 0
+#                      ValuesFrom 1
+#              </Result>
+#              <Result>
+#                      Type gauge
+#                      InstancePrefix "objperslab"
+#                      InstancesFrom 0
+#                      ValuesFrom 4
+#              </Result>
+#      </Table>
+#</Plugin>
+
 #<Plugin "tail">
 #  <File "/var/log/exim4/mainlog">
 #    Instance "exim"
@@ -620,6 +656,11 @@ FQDNLookup   true
 #      Server "8767"
 #</Plugin>
 
+#<Plugin ted>
+#      Device "/dev/ttyUSB0"
+#      Retries 0
+#</Plugin>
+
 #<Plugin thermal>
 #      ForceUseProcfs false
 #      Device "THRM"
index 0f8160f..2386312 100644 (file)
@@ -1455,6 +1455,57 @@ TCP-Port to connect to. Defaults to B<411>.
 
 =back
 
+=head2 Plugin C<memcachec>
+
+The C<memcachec plugin> connects to a memcached server, queries one or more
+given I<pages> and parses the returned data according to user specification.
+The I<matches> used are the same as the matches used in the C<curl> and C<tail>
+plugins.
+
+In order to talk to the memcached server, this plugin uses the I<libmemcached>
+library. Please note that there is another library with a very similar name,
+libmemcache (notice the missing `d'), which is not applicable.
+
+Synopsis of the configuration:
+
+ <Plugin "memcachec">
+   <Page "plugin_instance">
+     Server "localhost"
+     Key "page_key"
+     <Match>
+       Regex "(\\d+) bytes sent"
+       DSType CounterAdd
+       Type "ipt_octets"
+       Instance "type_instance"
+     </Match>
+   </Page>
+ </Plugin>
+
+The configuration options are:
+
+=over 4
+
+=item E<lt>B<Page> I<Name>E<gt>
+
+Each B<Page> block defines one I<page> to be queried from the memcached server.
+The block requires one string argument which is used as I<plugin instance>.
+
+=item B<Server> I<Address>
+
+Sets the server address to connect to when querying the page. Must be inside a
+B<Page> block.
+
+=item B<Key> I<Key>
+
+When connected to the memcached server, asks for the page I<Key>.
+
+=item E<lt>B<Match>E<gt>
+
+Match blocks define which strings to look for and how matches substrings are
+interpreted. For a description of match blocks, please see L<"Plugin tail">.
+
+=back
+
 =head2 Plugin C<memcached>
 
 The C<memcached plugin> connects to a memcached server and queries statistics
index 0868a9c..451a853 100644 (file)
@@ -339,7 +339,7 @@ static int cmc_config_add_page (oconfig_item_t *ci) /* {{{ */
       break;
   } /* for (i = 0; i < ci->children_num; i++) */
 
-  /* Additionial sanity checks and libCURL initialization. */
+  /* Additionial sanity checks and libmemcached initialization. */
   while (status == 0)
   {
     if (page->server == NULL)
index a1dcaa7..99bcb7e 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-DEFAULT_VERSION="4.6.2.git"
+DEFAULT_VERSION="4.7.0.git"
 
 VERSION="$( git describe 2> /dev/null | sed -e 's/^collectd-//' )"