Merge remote branch 'tokkee/sh/collectd-4.7' into collectd-4.7
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Mon, 11 May 2009 14:18:22 +0000 (16:18 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Mon, 11 May 2009 14:18:22 +0000 (16:18 +0200)
README
configure.in
src/collectd.conf.in
src/memcachec.c

diff --git a/README b/README
index 83e431e..ee7163c 100644 (file)
--- a/README
+++ b/README
@@ -553,10 +553,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 e37a8ab..7b82b8b 100644 (file)
@@ -3223,28 +3223,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)"
@@ -3262,7 +3276,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"
@@ -3506,6 +3522,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])
@@ -3876,7 +3910,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 a6073b9..4cbaca8 100644 (file)
@@ -317,6 +317,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"
@@ -563,20 +576,20 @@ FQDNLookup   true
 #</Plugin>
 
 #<Plugin "table">
-#      <Table"/proc/slabinfo">
-#              Instance"slabinfo"
-#              Separator""
+#      <Table "/proc/slabinfo">
+#              Instance "slabinfo"
+#              Separator " "
 #              <Result>
-#                      Typegauge
-#                      InstancePrefix"active_objs"
-#                      InstancesFrom0
-#                      ValuesFrom1
+#                      Type gauge
+#                      InstancePrefix "active_objs"
+#                      InstancesFrom 0
+#                      ValuesFrom 1
 #              </Result>
 #              <Result>
-#                      Typegauge
-#                      InstancePrefix"objperslab"
-#                      InstancesFrom0
-#                      ValuesFrom4
+#                      Type gauge
+#                      InstancePrefix "objperslab"
+#                      InstancesFrom 0
+#                      ValuesFrom 4
 #              </Result>
 #      </Table>
 #</Plugin>
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)