Merge branch 'sp/amqp'
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 6 Nov 2010 08:04:39 +0000 (09:04 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 6 Nov 2010 08:04:39 +0000 (09:04 +0100)
1  2 
README
configure.in
src/Makefile.am
src/collectd.conf.in
src/collectd.conf.pod

diff --combined README
--- 1/README
--- 2/README
+++ b/README
@@@ -235,10 -235,6 +235,10 @@@ Feature
        collectd without the need to start a heavy interpreter every interval.
        See collectd-python(5) for details.
  
 +    - redis
 +      The redis plugin gathers information from a redis server, including:
 +      uptime, used memory, total connections etc.
 +
      - routeros
        Query interface and wireless registration statistics from RouterOS.
  
    * Output can be written or sent to various destinations by the following
      plugins:
  
+     - amqp
+       Sends JSON-encoded data to an Advanced Message Queuing Protocol (AMQP)
+       server, such as RabbitMQ.
      - csv
        Write to comma separated values (CSV) files. This needs lots of
        diskspace but is extremely portable and can be analysed with almost
@@@ -511,10 -511,6 +515,10 @@@ Prerequisite
    * libclntsh (optional)
      Used by the `oracle' plugin.
  
 +  * libcredis (optional)
 +    Used by the redis plugin. Please note that you require a 0.2.2 version
 +    or higher. <http://code.google.com/p/credis/>
 +
    * libcurl (optional)
      If you want to use the `apache', `ascent', `curl', `nginx', or `write_http'
      plugin.
      Used by the `python' plugin. Currently, only 2.3 ≦ Python < 3 is supported.
      <http://www.python.org/>
  
+   * librabbitmq (optional; also called “rabbitmq-c”)
+     Used by the AMQP plugin for AMQP connections, for example to RabbitMQ.
+     <http://hg.rabbitmq.com/rabbitmq-c/>
    * librouteros (optional)
      Used by the `routeros' plugin to connect to a device running `RouterOS'.
      <http://verplant.org/librouteros/>
diff --combined configure.in
  fi
  AM_CONDITIONAL(BUILD_WITH_LIBKVM_OPENFILES, test "x$with_kvm_openfiles" = "xyes")
  
 +# --with-libcredis {{{
 +AC_ARG_WITH(libcredis, [AS_HELP_STRING([--with-libcredis@<:@=PREFIX@:>@], [Path to libcredis.])],
 +[
 + if test "x$withval" = "xyes"
 + then
 +       with_libcredis="yes"
 + else if test "x$withval" = "xno"
 + then
 +       with_libcredis="no"
 + else
 +       with_libcredis="yes"
 +       LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS -I$withval/include"
 +       LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS -L$withval/lib"
 + fi; fi
 +],
 +[with_libcredis="yes"])
 +
 +SAVE_CPPFLAGS="$CPPFLAGS"
 +SAVE_LDFLAGS="$LDFLAGS"
 +
 +CPPFLAGS="$CPPFLAGS $LIBCREDIS_CPPFLAGS"
 +LDFLAGS="$LDFLAGS $LIBCREDIS_LDFLAGS"
 +
 +if test "x$with_libcredis" = "xyes"
 +then
 +      if test "x$LIBCREDIS_CPPFLAGS" != "x"
 +      then
 +              AC_MSG_NOTICE([libcredis CPPFLAGS: $LIBCREDIS_CPPFLAGS])
 +      fi
 +      AC_CHECK_HEADERS(credis.h,
 +      [with_libcredis="yes"],
 +      [with_libcredis="no ('credis.h' not found)"])
 +fi
 +if test "x$with_libcredis" = "xyes"
 +then
 +      if test "x$LIBCREDIS_LDFLAGS" != "x"
 +      then
 +              AC_MSG_NOTICE([libcredis LDFLAGS: $LIBCREDIS_LDFLAGS])
 +      fi
 +      AC_CHECK_LIB(credis, credis_info,
 +      [with_libcredis="yes"],
 +      [with_libcredis="no (symbol 'credis_info' not found)"])
 +
 +fi
 +
 +CPPFLAGS="$SAVE_CPPFLAGS"
 +LDFLAGS="$SAVE_LDFLAGS"
 +
 +if test "x$with_libcredis" = "xyes"
 +then
 +      BUILD_WITH_LIBCREDIS_CPPFLAGS="$LIBCREDIS_CPPFLAGS"
 +      BUILD_WITH_LIBCREDIS_LDFLAGS="$LIBCREDIS_LDFLAGS"
 +      AC_SUBST(BUILD_WITH_LIBCREDIS_CPPFLAGS)
 +      AC_SUBST(BUILD_WITH_LIBCREDIS_LDFLAGS)
 +fi
 +AM_CONDITIONAL(BUILD_WITH_LIBCREDIS, test "x$with_libcredis" = "xyes")
 +# }}}
 +
  # --with-libcurl {{{
  with_curl_config="curl-config"
  with_curl_cflags=""
  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.])],
  [
@@@ -4334,7 -4327,6 +4385,7 @@@ the
  fi
  if test "x$have_sysctlbyname" = "xyes"
  then
 +      plugin_contextswitch="yes"
        plugin_cpu="yes"
        plugin_memory="yes"
        plugin_tcpconns="yes"
@@@ -4462,6 -4454,7 +4513,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])
@@@ -4531,7 -4524,6 +4583,7 @@@ AC_PLUGIN([powerdns],    [yes]
  AC_PLUGIN([processes],   [$plugin_processes],  [Process statistics])
  AC_PLUGIN([protocols],   [$plugin_protocols],  [Protocol (IP, TCP, ...) statistics])
  AC_PLUGIN([python],      [$with_python],       [Embed a Python interpreter])
 +AC_PLUGIN([redis],       [$with_libcredis],    [Redis plugin])
  AC_PLUGIN([routeros],    [$with_librouteros],  [RouterOS plugin])
  AC_PLUGIN([rrdcached],   [$librrd_rrdc_update], [RRDTool output plugin])
  AC_PLUGIN([rrdtool],     [$with_librrd],       [RRDTool output plugin])
@@@ -4562,7 -4554,6 +4614,7 @@@ AC_PLUGIN([vmem],        [$plugin_vmem]
  AC_PLUGIN([vserver],     [$plugin_vserver],    [Linux VServer statistics])
  AC_PLUGIN([wireless],    [$plugin_wireless],   [Wireless statistics])
  AC_PLUGIN([write_http],  [$with_libcurl],      [HTTP output plugin])
 +AC_PLUGIN([write_redis], [$with_libcredis],    [Redis output plugin])
  AC_PLUGIN([xmms],        [$with_libxmms],      [XMMS statistics])
  AC_PLUGIN([zfs_arc],     [$plugin_zfs_arc],    [ZFS ARC statistics])
  
@@@ -4737,7 -4728,6 +4789,7 @@@ Configuration
    Libraries:
      libcurl . . . . . . . $with_libcurl
      libdbi  . . . . . . . $with_libdbi
 +    libcredis . . . . . . $with_libcredis
      libesmtp  . . . . . . $with_libesmtp
      libganglia  . . . . . $with_libganglia
      libgcrypt . . . . . . $with_libgcrypt
      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
      processes . . . . . . $enable_processes
      protocols . . . . . . $enable_protocols
      python  . . . . . . . $enable_python
 +    redis . . . . . . . . $enable_redis
      routeros  . . . . . . $enable_routeros
      rrdcached . . . . . . $enable_rrdcached
      rrdtool . . . . . . . $enable_rrdtool
      vserver . . . . . . . $enable_vserver
      wireless  . . . . . . $enable_wireless
      write_http  . . . . . $enable_write_http
 +    write_redis . . . . . $enable_write_redis
      xmms  . . . . . . . . $enable_xmms
      zfs_arc . . . . . . . $enable_zfs_arc
  
diff --combined src/Makefile.am
@@@ -21,7 -21,7 +21,7 @@@ AM_CPPFLAGS += -DPLUGINDIR='"${pkglibdi
  AM_CPPFLAGS += -DPKGDATADIR='"${pkgdatadir}"'
  
  sbin_PROGRAMS = collectd collectdmon
 -bin_PROGRAMS = collectd-nagios collectd-flush
 +bin_PROGRAMS = collectd-nagios collectdctl
  
  collectd_SOURCES = collectd.c collectd.h \
                   common.c common.h \
@@@ -106,16 -106,16 +106,16 @@@ collectd_nagios_LDADD += libcollectdcli
  collectd_nagios_DEPENDENCIES = libcollectdclient/libcollectdclient.la
  
  
 -collectd_flush_SOURCES = collectd-flush.c
 -collectd_flush_LDADD =
 +collectdctl_SOURCES = collectdctl.c
 +collectdctl_LDADD =
  if BUILD_WITH_LIBSOCKET
 -collectd_flush_LDADD += -lsocket
 +collectdctl_LDADD += -lsocket
  endif
  if BUILD_AIX
 -collectd_flush_LDADD += -lm
 +collectdctl_LDADD += -lm
  endif
 -collectd_flush_LDADD += libcollectdclient/libcollectdclient.la
 -collectd_flush_DEPENDENCIES = libcollectdclient/libcollectdclient.la
 +collectdctl_LDADD += libcollectdclient/libcollectdclient.la
 +collectdctl_DEPENDENCIES = libcollectdclient/libcollectdclient.la
  
  
  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
@@@ -898,16 -910,6 +910,16 @@@ collectd_LDADD += "-dlopen" protocols.l
  collectd_DEPENDENCIES += protocols.la
  endif
  
 +if BUILD_PLUGIN_REDIS
 +pkglib_LTLIBRARIES += redis.la
 +redis_la_SOURCES = redis.c
 +redis_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBCREDIS_LDFLAGS)
 +redis_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCREDIS_CPPFLAGS)
 +redis_la_LIBADD = -lcredis
 +collectd_LDADD += "-dlopen" redis.la
 +collectd_DEPENDENCIES += redis.la
 +endif
 +
  if BUILD_PLUGIN_ROUTEROS
  pkglib_LTLIBRARIES += routeros.la
  routeros_la_SOURCES = routeros.c
@@@ -1223,16 -1225,6 +1235,16 @@@ endi
  collectd_DEPENDENCIES += write_http.la
  endif
  
 +if BUILD_PLUGIN_WRITE_REDIS
 +pkglib_LTLIBRARIES += write_redis.la
 +write_redis_la_SOURCES = write_redis.c
 +write_redis_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_LIBCREDIS_LDFLAGS)
 +write_redis_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBCREDIS_CPPFLAGS)
 +write_redis_la_LIBADD = -lcredis
 +collectd_LDADD += "-dlopen" write_redis.la
 +collectd_DEPENDENCIES += write_redis.la
 +endif
 +
  if BUILD_PLUGIN_XMMS
  pkglib_LTLIBRARIES += xmms.la
  xmms_la_SOURCES = xmms.c
@@@ -1257,7 -1249,6 +1269,7 @@@ dist_man_MANS = collectd.1 
                collectd.conf.5 \
                collectd-email.5 \
                collectd-exec.5 \
 +              collectdctl.1 \
                collectd-java.5 \
                collectdmon.1 \
                collectd-nagios.1 \
@@@ -1274,7 -1265,6 +1286,7 @@@ EXTRA_DIST = types.db pinba.prot
  EXTRA_DIST +=   collectd.conf.pod \
                collectd-email.pod \
                collectd-exec.pod \
 +              collectdctl.pod \
                collectd-java.pod \
                collectdmon.pod \
                collectd-nagios.pod \
diff --combined src/collectd.conf.in
@@@ -52,6 -52,7 +52,7 @@@
  # to missing dependencies or because they have been deactivated explicitly.  #
  ##############################################################################
  
+ #@BUILD_PLUGIN_AMQP_TRUE@LoadPlugin amqp
  #@BUILD_PLUGIN_APACHE_TRUE@LoadPlugin apache
  #@BUILD_PLUGIN_APCUPS_TRUE@LoadPlugin apcups
  #@BUILD_PLUGIN_APPLE_SENSORS_TRUE@LoadPlugin apple_sensors
  #@BUILD_PLUGIN_PROCESSES_TRUE@LoadPlugin processes
  #@BUILD_PLUGIN_PROTOCOLS_TRUE@LoadPlugin protocols
  #@BUILD_PLUGIN_PYTHON_TRUE@LoadPlugin python
 +#@BUILD_PLUGIN_REDIS_TRUE@LoadPlugin redis
  #@BUILD_PLUGIN_ROUTEROS_TRUE@LoadPlugin routeros
  #@BUILD_PLUGIN_RRDCACHED_TRUE@LoadPlugin rrdcached
  @LOAD_PLUGIN_RRDTOOL@LoadPlugin rrdtool
  #@BUILD_PLUGIN_VSERVER_TRUE@LoadPlugin vserver
  #@BUILD_PLUGIN_WIRELESS_TRUE@LoadPlugin wireless
  #@BUILD_PLUGIN_WRITE_HTTP_TRUE@LoadPlugin write_http
 +#@BUILD_PLUGIN_WRITE_REDIS_TRUE@LoadPlugin write_redis
  #@BUILD_PLUGIN_XMMS_TRUE@LoadPlugin xmms
  #@BUILD_PLUGIN_ZFS_ARC_TRUE@LoadPlugin zfs_arc
  
  # ription of those options is available in the collectd.conf(5) manual page. #
  ##############################################################################
  
+ #<Plugin "amqp">
+ #  <Publish "name">
+ #    Host "localhost"
+ #    Port "5672"
+ #    VHost "/"
+ #    User "guest"
+ #    Password "guest"
+ #    Exchange "amq.fanout"
+ #    RoutingKey "collectd"
+ #    Persistent false
+ #    StoreRates false
+ #  </Publish>
+ #</Plugin>
  #<Plugin apache>
 -#     URL "http://localhost/status?auto"
 -#     User "www-user"
 -#     Password "secret"
 -#     CACert "/etc/ssl/ca.crt"
 +#  <Instance "local">
 +#    URL "http://localhost/status?auto"
 +#    User "www-user"
 +#    Password "secret"
 +#    CACert "/etc/ssl/ca.crt"
 +#  </Instance>
  #</Plugin>
  
  #<Plugin apcups>
  #     </Module>
  #</Plugin>
  
 +#<Plugin redis>
 +#   <Node example>
 +#      Host "redis.example.com"
 +#      Port "6379"
 +#      Timeout 2000
 +#   </Node>
 +#</Plugin>
 +
  #<Plugin routeros>
  #     <Router>
  #             Host "router.example.com"
  #     </URL>
  #</Plugin>
  
 +#<Plugin write_redis>
 +#     <Node "example">
 +#             Host "localhost"
 +#             Port "6379"
 +#             Timeout 1000
 +#     </Node>
 +#</Plugin>
 +
  ##############################################################################
  # Filter configuration                                                       #
  #----------------------------------------------------------------------------#
diff --combined src/collectd.conf.pod
@@@ -57,33 -57,6 +57,33 @@@ directory for the daemon
  Loads the plugin I<Plugin>. There must be at least one such line or B<collectd>
  will be mostly useless.
  
 +Starting with collectd 4.9, this may also be a block in which further options
 +affecting the behavior of B<LoadPlugin> may be specified. The following
 +options are allowed inside a B<LoadPlugin> block:
 +
 +  <LoadPlugin perl>
 +    Globals true
 +  </LoadPlugin>
 +
 +=over 4
 +
 +=item B<Globals> B<true|false>
 +
 +If enabled, collectd will export all global symbols of the plugin (and of all
 +libraries loaded as dependencies of the plugin) and, thus, makes those symbols
 +available for resolving unresolved symbols in subsequently loaded plugins if
 +that is supported by your system. By default, this is disabled.
 +
 +This is useful (or possibly even required), e.E<nbsp>g., when loading a plugin
 +that embeds some scripting language into the daemon (e.E<nbsp>g. the C<perl>
 +or C<python> plugins). Scripting languages usually provide means to load
 +extensions written in C. Those extensions require symbols provided by the
 +interpreter, which is loaded as a dependency of the respective collectd
 +plugin. See the documentation of those plugins (e.E<nbsp>g.,
 +L<collectd-perl(5)> or L<collectd-python(5)>) for details.
 +
 +=back
 +
  =item B<Include> I<Path>
  
  If I<Path> points to a file, includes that file. If I<Path> points to a
@@@ -181,6 -154,143 +181,143 @@@ A list of all plugins and a short summa
  F<README> file shipped with the sourcecode and hopefully binary packets as
  well.
  
+ =head2 Plugin C<amqp>
+ The I<AMQMP plugin> can be used to communicate with other instances of
+ I<collectd> or third party applications using an AMQP message broker. Values
+ are sent to or received from the broker, which handles routing, queueing and
+ possibly filtering or messages.
+  <Plugin "amqp">
+    # Send values to an AMQP broker
+    <Publish "some_name">
+      Host "localhost"
+      Port "5672"
+      VHost "/"
+      User "guest"
+      Password "guest"
+      Exchange "amq.fanout"
+  #   ExchangeType "fanout"
+  #   RoutingKey "collectd"
+  #   Persistent false
+  #   Format "command"
+  #   StoreRates false
+    </Publish>
+    
+    # Receive values from an AMQP broker
+    <Subscribe "some_name">
+      Host "localhost"
+      Port "5672"
+      VHost "/"
+      User "guest"
+      Password "guest"
+      Exchange "amq.fanout"
+  #   ExchangeType "fanout"
+  #   Queue "queue_name"
+  #   RoutingKey "collectd.#"
+    </Subscribe>
+  </Plugin>
+ The plugin's configuration consists of a number of I<Publish> and I<Subscribe>
+ blocks, which configure sending and receiving of values respectively. The two
+ blocks are very similar, so unless otherwise noted, an option can be used in
+ either block. The name given in the blocks starting tag is only used for
+ reporting messages, but may be used to support I<flushing> of certain
+ I<Publish> blocks in the future.
+ =over 4
+ =item B<Host> I<Host>
+ Hostname or IP-address of the AMQP broker. Defaults to the default behavior of
+ the underlying communications library, I<rabbitmq-c>, which is "localhost".
+ =item B<Port> I<Port>
+ Service name or port number on which the AMQP broker accepts connections. This
+ argument must be a string, even if the numeric form is used. Defaults to
+ "5672".
+ =item B<VHost> I<VHost>
+ Name of the I<virtual host> on the AMQP broker to use. Defaults to "/".
+ =item B<User> I<User>
+ =item B<Password> I<Password>
+ Credentials used to authenticate to the AMQP broker. By default "guest"/"guest"
+ is used.
+ =item B<Exchange> I<Exchange>
+ In I<Publish> blocks, this option specifies the I<exchange> to send values to.
+ By default, "amq.fanout" will be used.
+ In I<Subscribe> blocks this option is optional. If given, a I<binding> between
+ the given exchange and the I<queue> is created, using the I<routing key> if
+ configured. See the B<Queue> and B<RoutingKey> options below.
+ =item B<ExchangeType> I<Type>
+ If given, the plugin will try to create the configured I<exchange> with this
+ I<type> after connecting. When in a I<Subscribe> block, the I<queue> will then
+ be bound to this exchange.
+ =item B<Queue> I<Queue> (Subscribe only)
+ Configures the I<queue> name to subscribe to. If no queue name was configures
+ explicitly, a unique queue name will be created by the broker.
+ =item B<RoutingKey> I<Key>
+ In I<Publish> blocks, this configures the routing key to set on all outgoing
+ messages. If not given, the routing key will be computed from the I<identifier>
+ of the value. The host, plugin, type and the two instances are concatenated
+ together using dots as the separator and all containing dots replaced with
+ slashes. For example "collectd.host/example/com.cpu.0.cpu.user". This makes it
+ possible to receive only specific values using a "topic" exchange.
+ In I<Subscribe> blocks, configures the I<routing key> used when creating a
+ I<binding> between an I<exchange> and the I<queue>. The usual wildcards can be
+ used to filter messages when using a "topic" exchange. If you're only
+ interested in CPU statistics, you could use the routing key "collectd.*.cpu.#"
+ for example.
+ =item B<Persistent> B<true>|B<false> (Publish only)
+ Selects the I<delivery method> to use. If set to B<true>, the I<persistent>
+ mode will be used, i.e. delivery is guaranteed. If set to B<false> (the
+ default), the I<transient> delivery mode will be used, i.e. messages may be
+ lost due to high load, overflowing queues or similar issues.
+ =item B<Format> B<Command>|B<JSON> (Publish only)
+ Selects the format in which messages are sent to the broker. If set to
+ B<Command> (the default), values are sent as C<PUTVAL> commands which are
+ identical to the syntax used by the I<Exec> and I<UnixSock plugins>. In this
+ case, the C<Content-Type> header field will be set to C<text/collectd>.
+ If set to B<JSON>, the values are encoded in the I<JavaScript Object Notation>,
+ an easy and straight forward exchange format. The C<Content-Type> header field
+ will be set to C<application/json>.
+ A subscribing client I<should> use the C<Content-Type> header field to
+ determine how to decode the values. Currently, the I<AMQP plugin> itself can
+ only decode the B<Command> format.
+ =item B<StoreRates> B<true>|B<false> (Publish only)
+ Determines whether or not C<COUNTER>, C<DERIVE> and C<ABSOLUTE> data sources
+ are converted to a I<rate> (i.e. a C<GAUGE> value). If set to B<false> (the
+ default), no conversion is performed. Otherwise the conversion is performed
+ using the internal value cache.
+ Please note that currently this option is only used if the B<Format> option has
+ been set to B<JSON>.
+ =back
  =head2 Plugin C<apache>
  
  To configure the C<apache>-plugin you first need to configure the Apache
@@@ -199,25 -309,7 +336,25 @@@ Since its C<mod_status> module is very 
  also supported. It introduces a new field, called C<BusyServers>, to count the
  number of currently connected clients. This field is also supported.
  
 -The following options are accepted by the C<apache>-plugin:
 +The configuration of the I<Apache> plugin consists of one or more
 +C<E<lt>InstanceE<nbsp>/E<gt>> blocks. Each block requires one string argument
 +as the instance name. For example:
 +
 + <Plugin "apache">
 +   <Instance "www1">
 +     URL "http://www1.example.com/mod_status?auto"
 +   </Instance>
 +   <Instance "www2">
 +     URL "http://www2.example.com/mod_status?auto"
 +   </Instance>
 + </Plugin>
 +
 +The instance name will be used as the I<plugin instance>. To emulate the old
 +(versionE<nbsp>4) behavior, you can use an empty string (""). In order for the
 +plugin to work correctly, each instance name must be unique. This is not
 +enforced by the plugin and it is your responsibility to ensure it.
 +
 +The following options are accepted within each I<Instance> block:
  
  =over 4
  
  
  Sets the URL of the C<mod_status> output. This needs to be the output generated
  by C<ExtendedStatus on> and it needs to be the machine readable output
 -generated by appending the C<?auto> argument.
 +generated by appending the C<?auto> argument. This option is I<mandatory>.
  
  =item B<User> I<Username>
  
@@@ -2626,7 -2718,7 +2763,7 @@@ operating systems
  =item B<MaxPacketSize> I<1024-65535>
  
  Set the maximum size for datagrams received over the network. Packets larger
 -than this will be truncated.
 +than this will be truncated. Defaults to 1452E<nbsp>bytes.
  
  =item B<Forward> I<true|false>
  
@@@ -3270,6 -3362,11 +3407,6 @@@ allowed as long as a single non-empty c
  
  The returned lines will be handled separately one after another.
  
 -=item B<Query> I<sql query statement>
 -
 -This is a deprecated synonym for B<Statement>. It will be removed in version 5
 -of collectd.
 -
  =item B<Param> I<hostname>|I<database>|I<username>|I<interval>
  
  Specify the parameters which should be passed to the SQL query. The parameters
@@@ -3345,6 -3442,21 +3482,6 @@@ This option is required inside a B<Resu
  times. If multiple B<ValuesFrom> options are specified, the columns are read
  in the given order.
  
 -=item B<Column> I<type> [I<type instance>]
 -
 -This is a deprecated alternative to a B<Result> block. It will be removed in
 -version 5 of collectd. It is equivalent to the following B<Result> block:
 -
 -  <Result>
 -    Type I<type>
 -    InstancePrefix I<type instance>
 -    ValuesFrom I<name of the x. column>
 -  </Result>
 -
 -The order of the B<Column> options defines which columns of the query result
 -should be used. The first option specifies the data found in the first column,
 -the second option that of the second column, and so on.
 -
  =item B<MinVersion> I<version>
  
  =item B<MaxVersion> I<version>
@@@ -3359,6 -3471,13 +3496,6 @@@ The I<version> has to be specified as t
  and patch-level versions, each represented as two-decimal-digit numbers. For
  example, version 8.2.3 will become 80203.
  
 -=item B<MinPGVersion> I<version>
 -
 -=item B<MaxPGVersion> I<version>
 -
 -These are deprecated synonyms for B<MinVersion> and B<MaxVersion>
 -respectively. They will be removed in version 5 of collectd.
 -
  =back
  
  The following predefined queries are available (the definitions can be found
@@@ -3769,52 -3888,6 +3906,52 @@@ Defaults to B<false>
  
  =back
  
 +=head2 Plugin C<redis>
 +
 +The I<Redis plugin> connects to one or more Redis servers and gathers
 +information about each server's state. For each server there is a I<Node> block
 +which configures the connection parameters for this node.
 +
 +  <Plugin redis>
 +    <Node "example">
 +        Host "localhost"
 +        Port "6379"
 +        Timeout 2000
 +    </Node>
 +  </Plugin>
 +
 +The information shown in the synopsis above is the I<default configuration>
 +which is used by the plugin if no configuration is present.
 +
 +=over 4
 +
 +=item B<Node> I<Nodename>
 +
 +The B<Node> block identifies a new Redis node, that is a new Redis instance
 +running in an specified host and port. The name for node is a canonical
 +identifier which is used as I<plugin instance>. It is limited to
 +64E<nbsp>characters in length.
 +
 +=item B<Host> I<Hostname>
 +
 +The B<Host> option is the hostname or IP-address where the Redis instance is
 +running on.
 +
 +=item B<Port> I<Port>
 +
 +The B<Port> option is the TCP port on which the Redis instance accepts
 +connections. Either a service name of a port number may be given. Please note
 +that numerical port numbers must be given as a string, too.
 +
 +=item B<Timeout> I<Timeout in miliseconds>
 +
 +The B<Timeout> option set the socket timeout for node response. Since the Redis
 +read function is blocking, you should keep this value as low as possible. Keep
 +in mind that the sum of all B<Timeout> values for all B<Nodes> should be lower
 +than B<Interval> defined globally.
 +
 +=back
 +
  =head2 Plugin C<rrdcached>
  
  The C<rrdcached> plugin uses the RRDtool accelerator daemon, L<rrdcached(1)>,
@@@ -4211,37 -4284,25 +4348,37 @@@ Use the last number found
  
  =item B<CounterSet>
  
 -The matched number is a counter. Simply sets the internal counter to this
 -value.
 +=item B<DeriveSet>
 +
 +=item B<AbsoluteSet>
 +
 +The matched number is a counter. Simply I<sets> the internal counter to this
 +value. Variants exist for C<COUNTER>, C<DERIVE>, and C<ABSOLUTE> data sources.
  
  =item B<CounterAdd>
  
 -Add the matched value to the internal counter.
 +=item B<DeriveAdd>
 +
 +Add the matched value to the internal counter. In case of B<DeriveAdd>, the
 +matched number may be negative, which will effectively subtract from the
 +internal counter.
  
  =item B<CounterInc>
  
 -Increase the internal counter by one. This B<DSType> is the only one that does
 -not use the matched subexpression, but simply counts the number of matched
 +=item B<DeriveInc>
 +
 +Increase the internal counter by one. These B<DSType> are the only ones that do
 +not use the matched subexpression, but simply count the number of matched
  lines. Thus, you may use a regular expression without submatch in this case.
  
  =back
  
  As you'd expect the B<Gauge*> types interpret the submatch as a floating point
 -number, using L<strtod(3)>. The B<CounterSet> and B<CounterAdd> interpret the
 -submatch as an integer using L<strtoll(3)>. B<CounterInc> does not use the
 -submatch at all and it may be omitted in this case.
 +number, using L<strtod(3)>. The B<Counter*> and B<AbsoluteSet> types interpret
 +the submatch as an unsigned integer using L<strtoull(3)>. The B<Derive*> types
 +interpret the submatch as a signed integer using L<strtoll(3)>. B<CounterInc>
 +and B<DeriveInc> do not use the submatch at all and it may be omitted in this
 +case.
  
  =item B<Type> I<Type>