Merge branch 'collectd-5.5'
authorMarc Fournier <marc.fournier@camptocamp.com>
Thu, 21 Jan 2016 20:29:18 +0000 (21:29 +0100)
committerMarc Fournier <marc.fournier@camptocamp.com>
Thu, 21 Jan 2016 20:29:18 +0000 (21:29 +0100)
1  2 
src/collectd.conf.in
src/collectd.conf.pod
src/virt.c

diff --combined src/collectd.conf.in
  @BUILD_PLUGIN_MEMORY_TRUE@@BUILD_PLUGIN_MEMORY_TRUE@LoadPlugin memory
  #@BUILD_PLUGIN_MIC_TRUE@LoadPlugin mic
  #@BUILD_PLUGIN_MODBUS_TRUE@LoadPlugin modbus
 +#@BUILD_PLUGIN_MQTT_TRUE@LoadPlugin mqtt
  #@BUILD_PLUGIN_MULTIMETER_TRUE@LoadPlugin multimeter
  #@BUILD_PLUGIN_MYSQL_TRUE@LoadPlugin mysql
  #@BUILD_PLUGIN_NETAPP_TRUE@LoadPlugin netapp
  #@BUILD_PLUGIN_NGINX_TRUE@LoadPlugin nginx
  #@BUILD_PLUGIN_NOTIFY_DESKTOP_TRUE@LoadPlugin notify_desktop
  #@BUILD_PLUGIN_NOTIFY_EMAIL_TRUE@LoadPlugin notify_email
 +#@BUILD_PLUGIN_NOTIFY_NAGIOS_TRUE@LoadPlugin notify_nagios
  #@BUILD_PLUGIN_NTPD_TRUE@LoadPlugin ntpd
  #@BUILD_PLUGIN_NUMA_TRUE@LoadPlugin numa
  #@BUILD_PLUGIN_NUT_TRUE@LoadPlugin nut
  #@BUILD_PLUGIN_WRITE_TSDB_TRUE@LoadPlugin write_tsdb
  #@BUILD_PLUGIN_XMMS_TRUE@LoadPlugin xmms
  #@BUILD_PLUGIN_ZFS_ARC_TRUE@LoadPlugin zfs_arc
 +#@BUILD_PLUGIN_ZONE_TRUE@LoadPlugin zone
  #@BUILD_PLUGIN_ZOOKEEPER_TRUE@LoadPlugin zookeeper
  
  ##############################################################################
  #     Host "localhost"
  #     Port "3551"
  #     ReportSeconds true
 +#     PersistentConnection true
  #</Plugin>
  
  #<Plugin aquaero>
  #     FSType "ext3"
  #     IgnoreSelected false
  #     ReportByDevice false
- #     ReportReserved false
  #     ReportInodes false
  #     ValuesAbsolute true
  #     ValuesPercentage false
  #<Plugin interface>
  #     Interface "eth0"
  #     IgnoreSelected false
 +#     UniqueName false
  #</Plugin>
  
  #<Plugin ipmi>
  #     </Host>
  #</Plugin>
  
 +#<Plugin mqtt>
 +#     <Publish "name">
 +#             Host "localhost"
 +#             Port 1883
 +#             ClientId "localhost"
 +#             User "user"
 +#             Password "secret"
 +#             QoS 0
 +#             Prefix "collectd"
 +#             StoreRates true
 +#             Retain false
 +#             CACert "/etc/ssl/ca.crt"
 +#             CertificateFile "/etc/ssl/client.crt"
 +#             CertificateKeyFile "/etc/ssl/client.pem"
 +#             TLSProtocol "tlsv1.2"
 +#             CipherSuite "ciphers"
 +#     </Publish>
 +#     <Subscribe "name">
 +#             Host "localhost"
 +#             Port 1883
 +#             ClientId "localhost"
 +#             User "user"
 +#             Password "secret"
 +#             QoS 2
 +#             Topic "collectd/#"
 +#             CleanSession true
 +#     </Subscribe>
 +#</Plugin>
 +
  #<Plugin mysql>
  #     <Database db_name>
  #             Host "database.serv.er"
  #     Recipient "email2@domain2.com"
  #</Plugin>
  
 +#<Plugin notify_nagios>
 +#     CommandFile "/usr/local/nagios/var/rw/nagios.cmd"
 +#</Plugin>
 +
  #<Plugin ntpd>
  #     Host "localhost"
  #     Port 123
  #  DeleteTimers   false
  #  DeleteGauges   false
  #  DeleteSets     false
 +#  CounterSum     false
  #  TimerPercentile 90.0
  #  TimerPercentile 95.0
  #  TimerPercentile 99.0
  #    Host "localhost"
  #    Port "2003"
  #    Protocol "tcp"
 +#    ReconnectInterval 0
  #    LogSendErrors true
  #    Prefix "collectd"
  #    Postfix "collectd"
  #             Host "localhost"
  #             Port "6379"
  #             Timeout 1000
 +#             Prefix "collectd/"
  #     </Node>
  #</Plugin>
  
diff --combined src/collectd.conf.pod
@@@ -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>
@@@ -528,9 -519,7 +528,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
@@@ -828,22 -817,12 +828,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>
@@@ -1842,7 -1821,6 +1842,7 @@@ than those of other plugins. It usuall
      </Query>
      <Database "product_information">
        Driver "mysql"
 +      Interval 120
        DriverOption "host" "localhost"
        DriverOption "username" "collectd"
        DriverOption "password" "aZo6daiw"
@@@ -2022,11 -2000,6 +2022,11 @@@ the daemon. Other than that, that name 
  
  =over 4
  
 +=item B<Interval> I<Interval>
 +
 +Sets the interval (in seconds) in which the values will be collected from this
 +database. By default the global B<Interval> setting will be used.
 +
  =item B<Driver> I<Driver>
  
  Specifies the driver to use to connect to the database. In many cases those
@@@ -2540,17 -2513,23 +2540,34 @@@ do that: By setting B<IgnoreSelected> t
  B<Interface> is inverted: All selected interfaces are ignored and all
  other interfaces are collected.
  
+ It is possible to use regular expressions to match interface names, if the
+ name is surrounded by I</.../> and collectd was compiled with support for
+ regexps. This is useful if there's a need to collect (or ignore) data
+ for a group of interfaces that are similarly named, without the need to
+ explicitly list all of them (especially useful if the list is dynamic).
+ Example:
+  Interface "lo"
+  Interface "/^veth/"
+  Interface "/^tun[0-9]+/"
+  IgnoreSelected "true"
+ This will ignore the loopback interface, all interfaces with names starting
+ with I<veth> and all interfaces with names starting with I<tun> followed by
+ at least one digit.
 +=item B<UniqueName> I<true>|I<false>
 +
 +Interface name is not unique on Solaris (KSTAT), interface name is unique 
 +only within a module/instance. Following tuple is considered unique: 
 +   (ks_module, ks_instance, ks_name)
 +If this option is set to true, interface name contains above three fields
 +separated by an underscore. For more info on KSTAT, visit
 +L<http://docs.oracle.com/cd/E23824_01/html/821-1468/kstat-3kstat.html#REFMAN3Ekstat-3kstat>
 +
 +This option is only available on Solaris.
 +
  =back
  
  =head2 Plugin C<ipmi>
@@@ -3271,146 -3250,6 +3288,146 @@@ 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.
 +
 +=item B<CACert> I<file>
 +
 +Path to the PEM-encoded CA certificate file. Setting this option enables TLS
 +communication with the MQTT broker, and as such, B<Port> should be the TLS-enabled
 +port of the MQTT broker.
 +A valid TLS configuration requires B<CACert>, B<CertificateFile> and B<CertificateKeyFile>.
 +
 +=item B<CertificateFile> I<file>
 +
 +Path to the PEM-encoded certificate file to use as client certificate when
 +connecting to the MQTT broker.
 +A valid TLS configuration requires B<CACert>, B<CertificateFile> and B<CertificateKeyFile>.
 +
 +=item B<CertificateKeyFile> I<file>
 +
 +Path to the unencrypted PEM-encoded key file corresponding to B<CertificateFile>.
 +A valid TLS configuration requires B<CACert>, B<CertificateFile> and B<CertificateKeyFile>.
 +
 +=item B<TLSProtocol> I<protocol>
 +
 +If configured, this specifies the string protocol version (e.g. C<tlsv1>,
 +C<tlsv1.2>) to use for the TLS connection to the broker. If not set a default
 +version is used which depends on the version of OpenSSL the Mosquitto library
 +was linked against.
 +
 +=item B<CipherSuite> I<ciphersuite>
 +
 +A string describing the ciphers available for use. See L<ciphers(1)> and the
 +C<openssl ciphers> utility for more information. If unset, the default ciphers
 +will be used.
 +
 +
 +=back
 +
  =head2 Plugin C<mysql>
  
  The C<mysql plugin> requires B<mysqlclient> to be installed. It connects to
@@@ -4466,21 -4305,6 +4483,21 @@@ Default: C<Collectd notify: %s@%s
  
  =back
  
 +=head2 Plugin C<notify_nagios>
 +
 +The I<notify_nagios> plugin writes notifications to Nagios' I<command file> as
 +a I<passive service check result>.
 +
 +Available configuration options:
 +
 +=over 4
 +
 +=item B<CommandFile> I<Path>
 +
 +Sets the I<command file> to write to. Defaults to F</usr/local/nagios/var/rw/nagios.cmd>.
 +
 +=back
 +
  =head2 Plugin C<ntpd>
  
  =over 4
@@@ -4706,16 -4530,6 +4723,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.
@@@ -4987,13 -4801,6 +5004,13 @@@ Default: B<0.9
  
  Sets the Time-To-Live of generated ICMP packets.
  
 +=item B<Size> I<size>
 +
 +Sets the size of the data payload in ICMP packet to specified I<size> (it
 +will be filled with regular ASCII pattern). If not set, default 56 byte
 +long string is used so that the packet size of an ICMPv4 packet is exactly
 +64 bytes, similar to the behaviour of normal ping(1) command.
 +
  =item B<SourceAddress> I<host>
  
  Sets the source address to use. I<host> may either be a numerical network
@@@ -5651,10 -5458,6 +5668,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>
@@@ -6269,12 -6072,6 +6286,12 @@@ rate of counters and size of sets will 
  are unchanged. If set to B<True>, the such metrics are not dispatched and
  removed from the internal cache.
  
 +=item B<CounterSum> B<false>|B<true>
 +
 +When enabled, create a C<count> metric which reports the change since the last
 +read. This option primarily exists for compatibility with the I<statsd>
 +impelemtation by Etsy.
 +
  =item B<TimerPercentile> I<Percent>
  
  Calculate and dispatch the configured percentile, i.e. compute the latency, so
@@@ -7229,17 -7026,17 +7246,17 @@@ setting B<name>
  B<address> means use the interface's mac address. This is useful since the
  interface path might change between reboots of a guest or across migrations.
  
 -=item B<PluginInstanceFormat> B<name|uuid>
 +=item B<PluginInstanceFormat> B<name|uuid|none>
  
  When the virt plugin logs data, it sets the plugin_instance of the collected
 -data according to this setting. The default is to use the guest name as provided
 -by the hypervisor, which is equal to setting B<name>.
 +data according to this setting. The default is to not set the plugin_instance.
  
 +B<name> means use the guest's name as provided by the hypervisor.
  B<uuid> means use the guest's UUID.
  
 -You can also specify combinations of these fields. For example B<name uuid>
 -means to concatenate the guest name and UUID (with a literal colon character
 -between, thus I<"foo:1234-1234-1234-1234">).
 +You can also specify combinations of the B<name> and B<uuid> fields.
 +For example B<name uuid> means to concatenate the guest name and UUID
 +(with a literal colon character between, thus I<"foo:1234-1234-1234-1234">).
  
  =back
  
@@@ -7314,14 -7111,6 +7331,14 @@@ Service name or port number to connect 
  
  Protocol to use when connecting to I<Graphite>. Defaults to C<tcp>.
  
 +=item B<ReconnectInterval> I<Seconds>
 +
 +When set to non-zero, forces the connection to the Graphite backend to be
 +closed and re-opend periodically. This behavior is desirable in environments
 +where the connection to the Graphite backend is done through load balancers,
 +for example. When set to zero, the default, the connetion is kept open for as
 +long as possible.
 +
  =item B<LogSendErrors> B<false>|B<true>
  
  If set to B<true> (the default), logs errors when sending data to I<Graphite>.
@@@ -7590,10 -7379,6 +7607,10 @@@ complete. When this limit is reached, t
  all the data in the current send buffer will probably be lost. Defaults to 0,
  which means the connection never times out.
  
 +=item B<LogHttpError> B<false>|B<true>
 +
 +Enables printing of HTTP error code to log. Turned off by default.
 +
  The C<write_http> plugin regularly submits the collected values to the HTTP
  server. How frequently this happens depends on how much data you are collecting
  and the size of B<BufferSize>. The optimal value to set B<Timeout> to is
@@@ -7720,20 -7505,14 +7737,20 @@@ Synopsis
          Host "localhost"
          Port "6379"
          Timeout 1000
 +        Prefix "collectd/"
 +        Database 1
 +        MaxSetSize -1
 +        StoreRates true
      </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. Additionally, 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
 +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.
  
@@@ -7768,28 -7547,6 +7785,28 @@@ 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>.
 +
 +=item B<MaxSetSize> I<Items>
 +
 +The B<MaxSetSize> option limits the number of items that the I<Sorted Sets> can
 +hold. Negative values for I<Items> sets no limit, which is the default behavior.
 +
 +=item B<StoreRates> B<true>|B<false>
 +
 +If set to B<true> (the default), convert counter values to rates. If set to
 +B<false> counter values are stored as is, i.e. as an increasing integer number.
 +
  =back
  
  =head2 Plugin C<write_riemann>
diff --combined src/virt.c
@@@ -128,7 -128,7 +128,7 @@@ enum plginst_field 
  };
  
  static enum plginst_field plugin_instance_format[PLGINST_MAX_FIELDS] =
 -    { plginst_name };
 +    { plginst_none };
  
  /* InterfaceFormat. */
  enum if_field {
@@@ -327,8 -327,8 +327,8 @@@ lv_init (void
  {
      if (virInitialize () != 0)
          return -1;
-       return 0;
+     else
+         return 0;
  }
  
  static int
@@@ -449,10 -449,7 +449,10 @@@ lv_config (const char *key, const char 
          }
  
          for (i = 0; i < n; ++i) {
 -            if (strcasecmp (fields[i], "name") == 0)
 +            if (strcasecmp (fields[i], "none") == 0) {
 +                plugin_instance_format[i] = plginst_none;
 +                break;
 +            } else if (strcasecmp (fields[i], "name") == 0)
                  plugin_instance_format[i] = plginst_name;
              else if (strcasecmp (fields[i], "uuid") == 0)
                  plugin_instance_format[i] = plginst_uuid;