MQTT 生产者 Telegraf 输出插件

强大的性能和简单的集成,由 InfluxData 构建的开源数据连接器 Telegraf 提供支持。

50 亿+

Telegraf 下载量

#1

时间序列数据库
来源:DB Engines

10 亿+

InfluxDB 下载量

2,800+

贡献者

目录

强大的性能,无限的扩展能力

收集、组织和处理海量高速数据。当您将任何数据视为时间序列数据时,它会变得更有价值。借助 InfluxDB,这是 #1 的时间序列平台,旨在与 Telegraf 一起扩展。

查看开始使用的几种方式

MQTT 是一种机器对机器 (M2M)/物联网通信协议,设计为轻量级的发布/订阅消息传递工具。 MQTT 适用于需要小资源占用空间和/或网络带宽受限的连接。 MQTT 由 IBM 的 Andy Stanford-Clark 博士和 Arcom 的 Arlen Nipper 于 1999 年创建。当时,IBM 正在与一家石油和天然气公司合作,该公司需要从偏远地区的石油管道中提取数据,这需要一种新的协议来满足这些要求。结果就是 MQTT。

MQTT 在 IBM 内部使用,直到他们在 2010 年发布 MQTT 3.1 规范,允许其他人创建自己的 MQTT 实现。开发人员很快意识到 MQTT 对物联网相关用例的价值,并且采用迅速增长,创建了许多开源代理和客户端库。 2013 年,IBM 将 MQTT 提交给 OASIS 进行维护和标准化。

为什么要使用 MQTT 生产者 Telegraf 输出插件?

MQTT 生产者 Telegraf 输出插件使您可以轻松地使用 Telegraf 将数据发送到您的 MQTT 代理。这意味着您可以利用 200 多个 Telegraf 输入插件 来接收数据,使用自定义或预制的 Telegraf 处理器插件 来转换您的数据,然后最终将数据输出到您的 MQTT 代理。

如何使用 MQTT 生产者 Telegraf 输出插件

MQTT 生产者 Telegraf 输出插件易于设置和快速运行。您只需配置您的 Telegraf YAML 配置文件即可。这是一个包含所有可用配置选项的基本示例

# Configuration for MQTT server to send metrics to
[[outputs.mqtt]]
  ## MQTT Brokers
  ## The list of brokers should only include the hostname or IP address and the
  ## port to the broker. This should follow the format `[{scheme}://]{host}:{port}`. For
  ## example, `localhost:1883` or `mqtt://localhost:1883`.
  ## Scheme can be any of the following: tcp://, mqtt://, tls://, mqtts://
  ## non-TLS and TLS servers can not be mix-and-matched.
  servers = ["localhost:1883", ] # or ["mqtts://tls.example.com:1883"]

  ## Protocol can be `3.1.1` or `5`. Default is `3.1.1`
  # protocol = "3.1.1"

  ## MQTT Topic for Producer Messages
  ## MQTT outputs send metrics to this topic format:
  ## 'topic_prefix/'hostname'/'pluginname'/ (e.g. prefix/web01.example.com/mem)
  topic_prefix = "telegraf"

  ## QoS policy for messages
  ## The mqtt QoS policy for sending messages.
  ## See https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.dev.doc/q029090_.htm
  ##   0 = at most once
  ##   1 = at least once
  ##   2 = exactly once
  # qos = 2

  ## Keep Alive
  ## Defines the maximum length of time that the broker and client may not
  ## communicate. Defaults to 0 which turns the feature off.
  ##
  ## For version v2.0.12 and later mosquitto there is a bug
  ## (see https://github.com/eclipse/mosquitto/issues/2117), which requires
  ## this to be non-zero. As a reference eclipse/paho.mqtt.golang defaults to 30.
  # keep_alive = 0

  ## username and password to connect MQTT server.
  # username = "telegraf"
  # password = "metricsmetricsmetricsmetrics"

  ## client ID
  ## The unique client id to connect MQTT server. If this parameter is not set
  ## then a random ID is generated.
  # client_id = ""

  ## Timeout for write operations. default: 5s
  # timeout = "5s"

  ## Optional TLS Config
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"

  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = false

  ## When true, metrics will be sent in one MQTT message per flush. Otherwise,
  ## metrics are written one metric per MQTT message.
  # batch = false

  ## When true, metric will have RETAIN flag set, making broker cache entries until someone
  ## actually reads it
  # retain = false

  ## Each data format has its own unique set of configuration options, read
  ## more about them here:
  ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
  data_format = "influx"
有关更多信息,请查看文档。

项目 URL   文档

强大的性能,无限的扩展能力

收集、组织和处理海量高速数据。当您将任何数据视为时间序列数据时,它会变得更有价值。借助 InfluxDB,这是 #1 的时间序列平台,旨在与 Telegraf 一起扩展。

查看开始使用的几种方式

相关集成