Difference between revisions of "Plugin:MQTT"

From collectd Wiki
Jump to: navigation, search
(Created a initial version of the MQTT plugin pages - based on the AMQP page)
 
(Synopsis)
Line 21: Line 21:
 
   <Publish "some_name">
 
   <Publish "some_name">
 
     Host "localhost"
 
     Host "localhost"
    Port "5672"
+
Port "1883"
    VHost "/"
+
User "mqttuser"
    User "guest"
+
Password "password"
    Password "guest"
+
  #  ClientId "collectd-hostname"
  #  RoutingKey "collectd"
+
  #  QoS 0
  #  Persistent false
+
  #  Prefix "collectd"
  #  Format "command"
+
#  Retain true
 
  #  StoreRates false
 
  #  StoreRates false
 
   </Publish>
 
   </Publish>
Line 34: Line 34:
 
   <Subscribe "some_name">
 
   <Subscribe "some_name">
 
     Host "localhost"
 
     Host "localhost"
    Port "5672"
+
Port "1883"
    VHost "/"
+
User "mqttuser"
    User "guest"
+
Password "password"
    Password "guest"
+
#  ClientId "collectd-hostname"
    Exchange "amq.fanout"
+
  #  QoS 0
  #  ExchangeType "fanout"
+
  #  CleanSession false
  #  Queue "queue_name"
+
  #  Topic "subtopic"
  #  RoutingKey "collectd.#"
 
 
   </Subscribe>
 
   </Subscribe>
 
  </Plugin>
 
  </Plugin>

Revision as of 12:02, 7 September 2015

MQTT plugin
Type: read, write
Callbacks: config, write
Status: supported
First version: 5.6
Copyright: 2014-2015 Florian octo Forster
2014 Marc Falzon
License: MIT license
Manpage: collectd.conf(5)
List of Plugins

The MQTT plugin transmits or receives values collected by collectd via the MQTT protocol. Data is sent to or received from a "message broker" – a daemon relaying messages. The values are encoded in either the plain text protocol or JSON, though only the plain-text protocol can be parsed by the plugin at the moment. Messages can be sent in either persistent (guaranteed delivery) or transient (higher efficiency but values may be lost) delivery mode.

Synopsis

<Plugin "mqtt">
  # Send values to an MQTT server
  <Publish "some_name">
    Host "localhost"
#   Port "1883"
#   User "mqttuser"
#   Password "password"
#   ClientId "collectd-hostname"
#   QoS 0
#   Prefix "collectd"
#   Retain true
#   StoreRates false
  </Publish>
  
  # Receive values from an MQTT broker (work in progress)
  <Subscribe "some_name">
    Host "localhost"
#   Port "1883"
#   User "mqttuser"
#   Password "password"
#   ClientId "collectd-hostname"
#   QoS 0
#   CleanSession false
#   Topic "subtopic"
  </Subscribe>
</Plugin>

this registers a writer by the name

 collectd/

Dependencies

See also