From cd2d438a20762cbd34241660516bf70f964100b1 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Fri, 3 Jul 2015 10:46:14 +0200 Subject: [PATCH] collectd.conf(5): Add documentation. Also add example config to src/collectd.conf.in --- src/collectd.conf.in | 25 +++++++++++ src/collectd.conf.pod | 112 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 136 insertions(+), 1 deletion(-) diff --git a/src/collectd.conf.in b/src/collectd.conf.in index bafdddb4..7877228e 100644 --- a/src/collectd.conf.in +++ b/src/collectd.conf.in @@ -139,6 +139,7 @@ #@BUILD_PLUGIN_MEMCACHED_TRUE@LoadPlugin memcached @BUILD_PLUGIN_MEMORY_TRUE@@BUILD_PLUGIN_MEMORY_TRUE@LoadPlugin memory #@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 @@ -671,6 +672,30 @@ # # +# +# +# Host "localhost" +# Port 1883 +# ClientId "localhost" +# User "user" +# Password "secret" +# QoS 0 +# Prefix "collectd" +# StoreRates true +# Retain false +# +# +# Host "localhost" +# Port 1883 +# ClientId "localhost" +# User "user" +# Password "secret" +# QoS 2 +# Topic "collectd/#" +# CleanSession true +# +# + # # # Host "database.serv.er" diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index b2aab213..36634d40 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -513,7 +513,9 @@ are disabled by default. The I can be used to communicate with other instances of I 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 # Send values to an AMQP broker @@ -3233,6 +3235,114 @@ B option is mandatory. =back +=head2 Plugin C + +The I can send metrics to MQTT (B blocks) and receive +values from MQTT (B blocks). + +B + + + + Host "mqtt.example.com" + Prefix "collectd" + + + Host "mqtt.example.com" + Topic "collectd/#" + + + +The plugin's configuration is in B and/or B blocks, +configuring the sending and receiving direction respectively. The plugin will +register a write callback named C> where I is the string +argument given to the B 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 + +=over 4 + +=item B I + +Hostname of the MQTT broker to connect to. + +=item B I + +Port number or service name of the MQTT broker to connect to. + +=item B I + +Username used when authenticating to the MQTT broker. + +=item B I + +Password used when authenticating to the MQTT broker. + +=item B I + +MQTT client ID to use. Defaults to the hostname used by I. + +=item B [B<0>-B<2>] + +Sets the I, 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 blocks, this option determines the QoS flag set on outgoing +messages and defaults to B<0>. In B 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 I (Publish only) + +This plugin will use one topic per I which will looks like a path. +I is used as the first path element and defaults to B. + +An example topic name would be: + + collectd/cpu-0/cpu-user + +=item B B|B (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. + +=item B B|B (Publish only) + +Controls whether C and C metrics are converted to a I +before sending. Defaults to B. + +=item B B|B (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. + +=item B I (Subscribe only) + +Configures the topic(s) to subscribe to. You can use the single level C<+> and +multi level C<#> wildcards. Defaults to B, i.e. all topics beneath +the B branch. + +=back + =head2 Plugin C The C requires B to be installed. It connects to -- 2.11.0