Code

Merge branch 'collectd-5.5'
authorMarc Fournier <marc.fournier@camptocamp.com>
Fri, 7 Aug 2015 08:14:59 +0000 (10:14 +0200)
committerMarc Fournier <marc.fournier@camptocamp.com>
Fri, 7 Aug 2015 08:14:59 +0000 (10:14 +0200)
1  2 
configure.ac
src/collectd.conf.pod
src/routeros.c

diff --combined configure.ac
index 9c2f32af8177089ee95cbaedf051cf10fcc5d2f1,a7cddb5e7c139f433c23c4e49b0b0d269d7704e2..8129468a1f7dc538d020c3063a13a42a24350a9d
  AM_CONDITIONAL(BUILD_WITH_LIBMONGOC, test "x$with_libmongoc" = "xyes")
  # }}}
  
 +# --with-libmosquitto {{{
 +with_libmosquitto_cppflags=""
 +with_libmosquitto_libs="-lmosquitto"
 +AC_ARG_WITH(libmosquitto, [AS_HELP_STRING([--with-libmosquitto@<:@=PREFIX@:>@], [Path to libmosquitto.])],
 +[
 +      if test "x$withval" != "xno" && test "x$withval" != "xyes"
 +      then
 +              with_libmosquitto_cppflags="-I$withval/include"
 +              with_libmosquitto_libs="-L$withval/lib -lmosquitto"
 +              with_libmosquitto="yes"
 +      else
 +              with_libmosquitto="$withval"
 +      fi
 +],
 +[
 +      with_libmosquitto="yes"
 +])
 +if test "x$with_libmosquitto" = "xyes"
 +then
 +      SAVE_CPPFLAGS="$CPPFLAGS"
 +      CPPFLAGS="$with_libmosquitto_cppflags"
 +
 +      AC_CHECK_HEADERS(mosquitto.h, [with_libmosquitto="yes"], [with_libmosquitto="no (mosquitto.h not found)"])
 +
 +      CPPFLAGS="$SAVE_CPPFLAGS"
 +fi
 +if test "x$with_libmosquitto" = "xyes"
 +then
 +      SAVE_LDFLAGS="$LDFLAGS"
 +      SAVE_CPPFLAGS="$CPPFLAGS"
 +      LDFLAGS="$with_libmosquitto_libs"
 +      CPPFLAGS="$with_libmosquitto_cppflags"
 +
 +      AC_CHECK_LIB(mosquitto, mosquitto_connect, [with_libmosquitto="yes"], [with_libmosquitto="no (libmosquitto not found)"])
 +
 +      LDFLAGS="$SAVE_LDFLAGS"
 +      CPPFLAGS="$SAVE_CPPFLAGS"
 +fi
 +if test "x$with_libmosquitto" = "xyes"
 +then
 +      BUILD_WITH_LIBMOSQUITTO_CPPFLAGS="$with_libmosquitto_cppflags"
 +      BUILD_WITH_LIBMOSQUITTO_LIBS="$with_libmosquitto_libs"
 +      AC_SUBST(BUILD_WITH_LIBMOSQUITTO_CPPFLAGS)
 +      AC_SUBST(BUILD_WITH_LIBMOSQUITTO_LIBS)
 +fi
 +# }}}
 +
  # --with-libmysql {{{
  with_mysql_config="mysql_config"
  with_mysql_cflags=""
  # }}} --with-python
  
  # --with-librabbitmq {{{
- with_librabbitmq_cppflags="-I/usr/local/include"
- with_librabbitmq_ldflags="-L/usr/local/lib"
+ 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"
@@@ -5262,6 -5215,7 +5262,7 @@@ plugin_disk="no
  plugin_drbd="no"
  plugin_entropy="no"
  plugin_ethstat="no"
+ plugin_fhcount="no"
  plugin_fscache="no"
  plugin_interface="no"
  plugin_ipmi="no"
@@@ -5290,7 -5244,6 +5291,7 @@@ plugin_vmem="no
  plugin_vserver="no"
  plugin_wireless="no"
  plugin_zfs_arc="no"
 +plugin_zone="no"
  plugin_zookeeper="no"
  
  # Linux
@@@ -5305,6 -5258,7 +5306,7 @@@ the
        plugin_disk="yes"
        plugin_drbd="yes"
        plugin_entropy="yes"
+       plugin_fhcount="yes"
        plugin_fscache="yes"
        plugin_interface="yes"
        plugin_ipc="yes"
@@@ -5388,7 -5342,6 +5390,7 @@@ the
        plugin_processes="yes"
        plugin_uptime="yes"
        plugin_zfs_arc="yes"
 +      plugin_zone="yes"
  fi
  
  if test "x$with_devinfo$with_kstat" = "xyesyes"
@@@ -5649,7 -5602,7 +5651,7 @@@ AC_PLUGIN([email],       [yes]
  AC_PLUGIN([entropy],     [$plugin_entropy],    [Entropy statistics])
  AC_PLUGIN([ethstat],     [$plugin_ethstat],    [Stats from NIC driver])
  AC_PLUGIN([exec],        [yes],                [Execution of external programs])
- AC_PLUGIN([fhcount],     [yes],                [File handles statistics])
+ AC_PLUGIN([fhcount],     [$plugin_fhcount],    [File handles statistics])
  AC_PLUGIN([filecount],   [yes],                [Count files in directories])
  AC_PLUGIN([fscache],     [$plugin_fscache],    [fscache statistics])
  AC_PLUGIN([gmond],       [$with_libganglia],   [Ganglia plugin])
@@@ -5679,7 -5632,6 +5681,7 @@@ AC_PLUGIN([memcached],   [yes]
  AC_PLUGIN([memory],      [$plugin_memory],     [Memory usage])
  AC_PLUGIN([mic],         [$with_mic],          [Intel Many Integrated Core stats])
  AC_PLUGIN([modbus],      [$with_libmodbus],    [Modbus plugin])
 +AC_PLUGIN([mqtt],        [$with_libmosquitto], [MQTT output plugin])
  AC_PLUGIN([multimeter],  [$plugin_multimeter], [Read multimeter values])
  AC_PLUGIN([mysql],       [$with_libmysql],     [MySQL statistics])
  AC_PLUGIN([netapp],      [$with_libnetapp],    [NetApp plugin])
@@@ -5755,7 -5707,6 +5757,7 @@@ AC_PLUGIN([write_sensu], [yes]
  AC_PLUGIN([write_tsdb],  [yes],                [TSDB output plugin])
  AC_PLUGIN([xmms],        [$with_libxmms],      [XMMS statistics])
  AC_PLUGIN([zfs_arc],     [$plugin_zfs_arc],    [ZFS ARC statistics])
 +AC_PLUGIN([zone],        [$plugin_zone],       [Solaris container statistics])
  AC_PLUGIN([zookeeper],   [yes],              [Zookeeper statistics])
  
  dnl Default configuration file
@@@ -5960,7 -5911,6 +5962,7 @@@ Configuration
      libmnl  . . . . . . . $with_libmnl
      libmodbus . . . . . . $with_libmodbus
      libmongoc . . . . . . $with_libmongoc
 +    libmosquitto  . . . . $with_libmosquitto
      libmysql  . . . . . . $with_libmysql
      libnetapp . . . . . . $with_libnetapp
      libnetsnmp  . . . . . $with_libnetsnmp
      memory  . . . . . . . $enable_memory
      mic . . . . . . . . . $enable_mic
      modbus  . . . . . . . $enable_modbus
 +    mqtt  . . . . . . . . $enable_mqtt
      multimeter  . . . . . $enable_multimeter
      mysql . . . . . . . . $enable_mysql
      netapp  . . . . . . . $enable_netapp
      write_tsdb  . . . . . $enable_write_tsdb
      xmms  . . . . . . . . $enable_xmms
      zfs_arc . . . . . . . $enable_zfs_arc
 +    zone  . . . . . . . . $enable_zone
      zookeeper . . . . . . $enable_zookeeper
  
  EOF
diff --combined src/collectd.conf.pod
index bd39295e54deac93f7b5aff5ff5dd4135542a487,ba2136554a64236d16b4b1eda08c4b4f229e07d5..aaeeaf419b703913392ef5e78448ffa76fc451dc
@@@ -130,15 -130,6 +130,15 @@@ Sets a plugin-specific interval for col
  global B<Interval> setting. If a plugin provides own support for specifying an
  interval, that setting will take precedence.
  
 +=item B<FlushInterval> I<Seconds>
 +
 +Specifies the the interval, in seconds, to call the flush callback if it's
 +defined in this plugin. By default, this is disabled
 +
 +=item B<FlushTimeout> I<Seconds>
 +
 +Specifies the value of the timeout argument of the flush callback.
 +
  =back
  
  =item B<AutoLoadPlugin> B<false>|B<true>
@@@ -513,9 -504,7 +513,9 @@@ are disabled by default
  The I<AMQP 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.
 +possibly filtering out messages.
 +
 +B<Synopsis:>
  
   <Plugin "amqp">
     # Send values to an AMQP broker
@@@ -813,22 -802,12 +813,22 @@@ B<apcupsd> can handle it
  
  TCP-Port to connect to. Defaults to B<3551>.
  
 -=item B<ReportSeconds> B<true|false>
 +=item B<ReportSeconds> B<true>|B<false>
  
  If set to B<true>, the time reported in the C<timeleft> metric will be
  converted to seconds. This is the recommended setting. If set to B<false>, the
  default for backwards compatibility, the time will be reported in minutes.
  
 +=item B<PersistentConnection> B<true>|B<false>
 +
 +By default, the plugin will try to keep the connection to UPS open between
 +reads. Since this appears to be somewhat brittle (I<apcupsd> appears to close
 +the connection due to inactivity quite quickly), the plugin will try to detect
 +this problem and switch to an open-read-close mode in such cases.
 +
 +You can instruct the plugin to close the connection after each read by setting
 +this option to B<false>.
 +
  =back
  
  =head2 Plugin C<aquaero>
@@@ -2288,7 -2267,7 +2288,7 @@@ expected from them. This is documented 
  =head2 Plugin C<fhcount>
  
  The C<fhcount> plugin provides statistics about used, unused and total number of
- file handles.
+ file handles on Linux.
  
  The I<fhcount plugin> provides the following configuration options:
  
@@@ -3235,114 -3214,6 +3235,114 @@@ B<Collect> option is mandatory
  
  =back
  
 +=head2 Plugin C<mqtt>
 +
 +The I<MQTT plugin> can send metrics to MQTT (B<Publish> blocks) and receive
 +values from MQTT (B<Subscribe> blocks).
 +
 +B<Synopsis:>
 +
 + <Plugin mqtt>
 +   <Publish "name">
 +     Host "mqtt.example.com"
 +     Prefix "collectd"
 +   </Publish>
 +   <Subscribe "name">
 +     Host "mqtt.example.com"
 +     Topic "collectd/#"
 +   </Subscribe>
 + </Plugin>
 +
 +The plugin's configuration is in B<Publish> and/or B<Subscribe> blocks,
 +configuring the sending and receiving direction respectively. The plugin will
 +register a write callback named C<mqtt/I<name>> where I<name> is the string
 +argument given to the B<Publish> block. Both types of blocks share many but not
 +all of the following options. If an option is valid in only one of the blocks,
 +it will be mentioned explicitly.
 +
 +B<Options:>
 +
 +=over 4
 +
 +=item B<Host> I<Hostname>
 +
 +Hostname of the MQTT broker to connect to.
 +
 +=item B<Port> I<Service>
 +
 +Port number or service name of the MQTT broker to connect to.
 +
 +=item B<User> I<UserName>
 +
 +Username used when authenticating to the MQTT broker.
 +
 +=item B<Password> I<Password>
 +
 +Password used when authenticating to the MQTT broker.
 +
 +=item B<ClientId> I<ClientId>
 +
 +MQTT client ID to use. Defaults to the hostname used by I<collectd>.
 +
 +=item B<QoS> [B<0>-B<2>]
 +
 +Sets the I<Quality of Service>, with the values C<0>, C<1> and C<2> meaning:
 +
 +=over 4
 +
 +=item B<0>
 +
 +At most once
 +
 +=item B<1>
 +
 +At least once
 +
 +=item B<2>
 +
 +Exactly once
 +
 +=back
 +
 +In B<Publish> blocks, this option determines the QoS flag set on outgoing
 +messages and defaults to B<0>. In B<Subscribe> blocks, determines the maximum
 +QoS setting the client is going to accept and defaults to B<2>. If the QoS flag
 +on a message is larger than the maximum accepted QoS of a subscriber, the
 +message's QoS will be downgraded.
 +
 +=item B<Prefix> I<Prefix> (Publish only)
 +
 +This plugin will use one topic per I<value list> which will looks like a path.
 +I<Prefix> is used as the first path element and defaults to B<collectd>.
 +
 +An example topic name would be:
 +
 + collectd/cpu-0/cpu-user
 +
 +=item B<Retain> B<false>|B<true> (Publish only)
 +
 +Controls whether the MQTT broker will retain (keep a copy of) the last message
 +sent to each topic and deliver it to new subscribers. Defaults to B<false>.
 +
 +=item B<StoreRates> B<true>|B<false> (Publish only)
 +
 +Controls whether C<DERIVE> and C<COUNTER> metrics are converted to a I<rate>
 +before sending. Defaults to B<true>.
 +
 +=item B<CleanSession> B<true>|B<false> (Subscribe only)
 +
 +Controls whether the MQTT "cleans" the session up after the subscriber
 +disconnects or if it maintains the subscriber's subscriptions and all messages
 +that arrive while the subscriber is disconnected. Defaults to B<true>.
 +
 +=item B<Topic> I<TopicName> (Subscribe only)
 +
 +Configures the topic(s) to subscribe to. You can use the single level C<+> and
 +multi level C<#> wildcards. Defaults to B<collectd/#>, i.e. all topics beneath
 +the B<collectd> branch.
 +
 +=back
 +
  =head2 Plugin C<mysql>
  
  The C<mysql plugin> requires B<mysqlclient> to be installed. It connects to
@@@ -4623,16 -4494,6 +4623,16 @@@ The following options are accepted with
  Sets the URL to use to connect to the I<OpenLDAP> server. This option is
  I<mandatory>.
  
 +=item B<BindDN> I<BindDN>
 +
 +Name in the form of an LDAP distinguished name intended to be used for 
 +authentication. Defaults to empty string to establish an anonymous authorization.
 +
 +=item B<Password> I<Password>
 +
 +Password for simple bind authentication. If this option is not set, 
 +unauthenticated bind operation is used.
 +
  =item B<StartTLS> B<true|false>
  
  Defines whether TLS must be used when connecting to the I<OpenLDAP> server.
@@@ -5561,10 -5422,6 +5561,10 @@@ dispatched to the daemon using the spec
  allows to "group" several processes together. I<name> must not contain
  slashes.
  
 +=item B<CollectContextSwitch> I<Boolean>
 +
 +Collect context switch of the process.
 +
  =back
  
  =head2 Plugin C<protocols>
@@@ -7608,18 -7465,14 +7608,18 @@@ Synopsis
          Host "localhost"
          Port "6379"
          Timeout 1000
 +        Prefix "collectd/"
 +        Database 1
      </Node>
    </Plugin>
  
  Values are submitted to I<Sorted Sets>, using the metric name as the key, and
  the timestamp as the score. Retrieving a date range can then be done using the
 -C<ZRANGEBYSCORE> I<Redis> command. Additionnally, all the identifiers of these
 -I<Sorted Sets> are kept in a I<Set> called C<collectd/values> and can be
 -retrieved using the C<SMEMBERS> I<Redis> command. See
 +C<ZRANGEBYSCORE> I<Redis> command. Additionally, all the identifiers of these
 +I<Sorted Sets> are kept in a I<Set> called C<collectd/values> (or
 +C<${prefix}/values> if the B<Prefix> option was specified) and can be retrieved
 +using the C<SMEMBERS> I<Redis> command. You can specify the database to use 
 +with the B<Database> parameter (default is C<0>). See
  L<http://redis.io/commands#sorted_set> and L<http://redis.io/commands#set> for
  details.
  
@@@ -7635,9 -7488,9 +7635,9 @@@ options are available
  =item B<Node> I<Nodename>
  
  The B<Node> block identifies a new I<Redis> node, that is a new I<Redis>
 -instance running in an specified host and port. The name for node is a
 +instance running on a specified host and port. The node name is a
  canonical identifier which is used as I<plugin instance>. It is limited to
 -64E<nbsp>characters in length.
 +51E<nbsp>characters in length.
  
  =item B<Host> I<Hostname>
  
@@@ -7654,17 -7507,6 +7654,17 @@@ that numerical port numbers must be giv
  
  The B<Timeout> option sets the socket connection timeout, in milliseconds.
  
 +=item B<Prefix> I<Prefix>
 +
 +Prefix used when constructing the name of the I<Sorted Sets> and the I<Set>
 +containing all metrics. Defaults to C<collectd/>, so metrics will have names
 +like C<collectd/cpu-0/cpu-user>. When setting this to something different, it
 +is recommended but not required to include a trailing slash in I<Prefix>.
 +
 +=item B<Database> I<Index>
 +
 +This index selects the redis database to use for writing operations. Defaults to C<0>.
 +
  =back
  
  =head2 Plugin C<write_riemann>
diff --combined src/routeros.c
index 400ee42b64fcd294106f8681dfee3d3d9e77a0d1,4863d7c082b1e8297b48152c379dc6a4701b0a1d..667c2fa581722e00ef01161e385d6e13d0c4e36a
@@@ -331,7 -331,7 +331,7 @@@ static int cr_config_router (oconfig_it
    router_data = malloc (sizeof (*router_data));
    if (router_data == NULL)
      return (-1);
-   memset (router_data, 0, sizeof (router_data));
+   memset (router_data, 0, sizeof (*router_data));
    router_data->connection = NULL;
    router_data->node = NULL;
    router_data->service = NULL;
    user_data.free_func = (void *) cr_free_data;
    if (status == 0)
      status = plugin_register_complex_read (/* group = */ NULL, read_name,
 -      cr_read, /* interval = */ NULL, &user_data);
 +      cr_read, /* interval = */ 0, &user_data);
  
    if (status != 0)
      cr_free_data (router_data);