MQTT is a machine-to-machine (M2M)/Internet of Things communication protocol designed as a lightweight publish/subscribe messaging tool. MQTT is useful for connections where a small resource footprint is required and/or network bandwidth is at a premium. MQTT was created by Dr. Andy Stanford-Clark of IBM, and Arlen Nipper of Arcom in 1999. At the time, IBM was working with an oil and gas company that needed to pull data from oil pipelines in remote areas, which required a new protocol to fit those requirements. The result was MQTT.

MQTT was used internally by IBM until they released the MQTT 3.1 specification in 2010, allowing others to create their own MQTT implementations. Developers quickly realized the value MQTT had for IoT-related use cases and adoption grew quickly, with numerous open source brokers and client libraries being created. In 2013 IBM submitted MQTT to OASIS to be maintained and standardized.

MQTT basics

MQTT was designed for low-bandwidth, high-latency networks in the late 1990s/early 2000s. As a result, the designers made a number of key choices which have come to characterize it:

  • Simple to implement
  • Publish/subscribe messaging
  • Zero administration (or near-zero administration)
  • Minimal on-the-wire footprint
  • Expect and cater for frequent network disruption
  • Continuous session awareness
  • Expect that client applications may have very limited processing resources available
  • Provide traditional messaging qualities of service where the environment allows
  • Flexible and data agnostic

Why use the Telegraf plugin for MQTT?

Telegraf makes it easy to collect your MQTT data without having to write a custom script to connect to your MQTT broker. Telegraf also makes it simple to process and transform MQTT messages as they are delivered, before sending them to a database for storage. Another benefit of using Telegraf with MQTT is the 40+ output plugins. This means you can send your MQTT data to almost any data store and even multiple data stores at the same time.

How to monitor MQTT using the Telegraf plugin

The MQTT Consumer Telegraf Input Plugin reads from specified MQTT topics and adds messages to InfluxDB. Once your MQTT messages have been stored with InfluxDB you can set alerts or routine tasks to take action on your data. You can also generate forecasts or visualize your data with tools provided by InfluxDB. If you want to send messages back to your MQTT client devices you can also use the Telegraf MQTT Output Plugin to pass data back to your MQTT broker.

Key MQTT Telegraf Consumer metrics to use for monitoring

With MQTT, you can stream data between different applications, remote devices, sensor data, application monitoring, fraud detection and live leader-boards. All measurements are tagged with the incoming topic, i.e. topic=telegraf/host01/cpu

For more information, please check out the documentation.

Project URL   Documentation

VIDEO

Monitor Your MQTT Devices in InfluxDB Cloud with Telegraf

This demonstration walks you through how to monitor The Things Network with InfluxDB Cloud via MQTT. Learn how to configure your MQTT Telegraf input plugin to read data from The Things Network and to send it to InfluxDB Cloud.

Related resources

AMQP Consumer Telegraf plugin

Learn how the AMQP Consumer Telegraf Input Plugin receives streaming data from an AMQP message producer.

RabbitMQ Telegraf plugin

This plugin gathers statistics from your RabbitMQ monitoring cluster. It reads metrics from RabbitMQ servers via the RabbitMQ Management Plugin.

Kafka Telegraf plugin

Learn how the Kafka Consumer Plugin polls a specified Kafka topic and adds messages to InfluxDB.

Scroll to Top