文档文档

MavLink 输入插件

此插件从 MavLink 兼容的飞行控制器(如 ArduPilotPX4)收集指标,以实时摄取无人驾驶系统(无人机、飞机、船只等)的飞行指标。目前使用 ArduPilot 特定的 Mavlink 方言,有关更多详细信息和可用消息,请参阅Mavlink 文档

此插件可能生成大量数据。如果您的输出插件无法处理消息速率,请使用指标过滤器限制写入输出的指标,和/或使用 filters 配置参数限制此插件解析哪些 Mavlink 消息。

引入于: Telegraf v1.35.0 标签: iot 操作系统支持: all

全局配置选项

插件支持其他全局和插件配置设置,用于修改指标、标签和字段,创建别名以及配置插件顺序等任务。更多详情请参阅 CONFIGURATION.md

配置

# Read metrics from a Mavlink flight controller.
[[inputs.mavlink]]
  ## Flight controller URL supporting serial port, UDP and TCP connections.
  ## Options are documented at
  ##   https://mavsdk.mavlink.io/v1.4/en/cpp/guide/connections.html.
  ##
  ## Examples:
  ## - Serial port: serial:///dev/ttyACM0:57600
  ## - TCP client:  tcp://192.168.1.12:5760
  ## - UDP client:  udp://192.168.1.12:14550
  ## - TCP server:  tcpserver://:5760
  ## - UDP server:  udpserver://:14550
  # url = "tcp://127.0.0.1:5760"

  ## Filter to specific messages. Only the messages in this list will be parsed.
  ## If blank or unset, all messages will be accepted. Glob syntax is accepted.
  ## Each message in this list should be lowercase camel_case, with "message_"
  ## prefix removed, eg: "global_position_int", "attitude"
  # filter = []

  ## Mavlink system ID for Telegraf. Only used if the mavlink plugin is sending
  ## messages, eg. when `stream_request_frequency` is 0 (see below.)
  # system_id = 254

  ## Determines whether the plugin sends requests to subscribe to data.
  ## In mavlink, stream rates must be configured before data is received.
  ## This config item sets the rate in Hz, with 0 disabling the request.
  ##
  ## This frequency should be set to 0 if your software already controls the
  ## rates using REQUEST_DATA_STREAM or MAV_CMD_SET_MESSAGE_INTERVAL
  ## (See https://mavlink.io/en/mavgen_python/howto_requestmessages.html)
  # stream_request_frequency = 4

Metrics

每个支持的 Mavlink 消息都将转换为一个度量组,Mavlink 消息中的字段将转换为 telegraf 中的字段。

Mavlink 消息的名称将转换为小写,并且会删除任何前导文本 message_

例如,消息 ATTITUDE 将成为一个 attitude 度量,所有字段都将从其 Mavlink 消息定义中复制。

示例输出

system_time,source=udp://:5760,sys_id=1 time_unix_usec=1732901334516981i,time_boot_ms=1731552i
ekf_status_report,source=udp://:5760,sys_id=1 velocity_variance=0.006436665542423725,pos_horiz_variance=0.006062425673007965,pos_vert_variance=0.0029854460153728724,compass_variance=0.010930062271654606,terrain_alt_variance=0,airspeed_variance=0
local_position_ned,source=udp://:5760,sys_id=1 time_boot_ms=1731552i,x=-0.010437906719744205,y=-0.02162001095712185,z=-0.0037050051614642143,vx=-0.011906237341463566,vy=-0.02467793971300125,vz=0.012739507481455803
vibration,source=udp://:5760,sys_id=1 time_usec=1731552102i,vibration_x=0.0028534166049212217,vibration_y=0.002792230574414134,vibration_z=0.0028329004999250174,clipping_0=0i,clipping_1=0i,clipping_2=0i
battery_status,source=udp://:5760,sys_id=1 id=0i,temperature=32767i,current_battery=0i,current_consumed=0i,energy_consumed=0i,battery_remaining=100i,time_remaining=0i
ahrs,source=udp://:5760,sys_id=1 omegaix=-0.0012698185164481401,omegaiy=-0.0011798597406595945,omegaiz=-0.0017210562946274877,accel_weight=0,renorm_val=0,error_rp=0.002372326795011759,error_yaw=0.0014012008905410767
ahrs2,source=udp://:5760,sys_id=1 roll=-0.0015893152449280024,pitch=-0.0018129277741536498,yaw=-1.2297048568725586,altitude=0.22999998927116394,lat=450469223i,lng=-834024728i
attitude,source=udp://:5760,sys_id=1 time_boot_ms=1731811i,roll=-0.0011288427049294114,pitch=-0.0013485358795151114,yaw=-1.2430261373519897,rollspeed=-0.00023304438218474388,pitchspeed=-0.00023194786626845598,yawspeed=-0.0008081073756329715 0
global_position_int,source=udp://:5760,sys_id=1 time_boot_ms=1731811i,lat=450469223i,lon=-834024730i,alt=0i,relative_alt=-115i,vx=-1i,vy=-2i,vz=1i,hdg=28878i
gps_raw_int,source=udp://:5760,sys_id=1 time_usec=1731635000i,lat=450469223i,lon=-834024728i,alt=0i,eph=121i,epv=200i,vel=0i,cog=0i,satellites_visible=10i,alt_ellipsoid=0i,hacc=300i,vacc=300i,vel_acc=40i,hdg_acc=0i,yaw=0i

此页面是否有帮助?

感谢您的反馈!


InfluxDB 3.8 新特性

InfluxDB 3.8 和 InfluxDB 3 Explorer 1.6 的主要增强功能。

查看博客文章

InfluxDB 3.8 现已适用于 Core 和 Enterprise 版本,同时发布了 InfluxDB 3 Explorer UI 的 1.6 版本。本次发布着重于操作成熟度,以及如何更轻松地部署、管理和可靠地运行 InfluxDB。

更多信息,请查看

InfluxDB Docker 的 latest 标签将指向 InfluxDB 3 Core

在 **2026 年 2 月 3 日**,InfluxDB Docker 镜像的 latest 标签将指向 InfluxDB 3 Core。为避免意外升级,请在您的 Docker 部署中使用特定的版本标签。

如果使用 Docker 来安装和运行 InfluxDB,latest 标签将指向 InfluxDB 3 Core。为避免意外升级,请在您的 Docker 部署中使用特定的版本标签。例如,如果使用 Docker 运行 InfluxDB v2,请将 latest 版本标签替换为 Docker pull 命令中的特定版本标签 — 例如

docker pull influxdb:2