文档文档

IPMI 传感器输入插件

此插件使用 ipmitool 命令行实用程序,从 智能平台管理接口 收集指标。

ipmitool 需要访问 IPMI 设备。请查看权限部分以获取可能的解决方案。

引入于: Telegraf v0.12.0 标签: hardware, system 操作系统支持: all

全局配置选项

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

配置

# Read metrics from the bare metal servers via IPMI
[[inputs.ipmi_sensor]]
  ## Specify the path to the ipmitool executable
  # path = "/usr/bin/ipmitool"

  ## Use sudo
  ## Setting 'use_sudo' to true will make use of sudo to run ipmitool.
  ## Sudo must be configured to allow the telegraf user to run ipmitool
  ## without a password.
  # use_sudo = false

  ## Servers
  ## Specify one or more servers via a url. If no servers are specified, local
  ## machine sensor stats will be queried. Uses the format:
  ##  [username[:password]@][protocol[(address)]]
  ##  e.g. root:passwd@lan(127.0.0.1)
  # servers = ["USERID:PASSW0RD@lan(192.168.1.1)"]

  ## Session privilege level
  ## Choose from: CALLBACK, USER, OPERATOR, ADMINISTRATOR
  # privilege = "ADMINISTRATOR"

  ## Timeout
  ## Timeout for the ipmitool command to complete.
  # timeout = "20s"

  ## Metric schema version
  ## See the plugin readme for more information on schema versioning.
  # metric_version = 1

  ## Sensors to collect
  ## Choose from:
  ##   * sdr: default, collects sensor data records
  ##   * chassis_power_status: collects the power status of the chassis
  ##   * dcmi_power_reading: collects the power readings from the Data Center Management Interface
  # sensors = ["sdr"]

  ## Hex key
  ## Optionally provide the hex key for the IMPI connection.
  # hex_key = ""

  ## Cache
  ## If ipmitool should use a cache
  ## Using a cache can speed up collection times depending on your device.
  # use_cache = false

  ## Path to the ipmitools cache file (defaults to OS temp dir)
  ## The provided path must exist and must be writable
  # cache_path = ""

如果未指定服务器,插件将通过以下命令查询本地机器传感器状态

ipmitool sdr

或使用版本 2 架构

ipmitool sdr elist

当指定一个或多个服务器时,插件将使用以下命令收集远程主机传感器状态

ipmitool -I lan -H SERVER -U USERID -P PASSW0RD sdr

如果配置了以下任何参数,它们将被添加到上述查询中

-y hex_key -L privilege

传感器

默认情况下,插件通过 sdr 命令收集数据并返回这些值。然而,还有额外的传感器选项可供调用

  • chassis_power_status - 根据 chassis power status 的输出来返回 0 或 1
  • dcmi_power_reading - 返回 dcmi power reading 的瓦特值

这些传感器选项不受指标版本的影响。

Metrics

版本 1 架构

  • ipmi_sensor
    • 标签 (tags)
      • name
      • unit
      • host
      • server (仅在从远程服务器检索统计信息时使用)
    • 字段 (fields)
      • status (int, 1=ok status_code/0=anything else)
      • value (浮点数)

版本 2 架构

  • ipmi_sensor
    • 标签 (tags)
      • name
      • entity_id (有助于使重复名称唯一化)
      • status_code (来自 IPMI 文档的两位字母代码)
      • status_desc (扩展状态描述字段)
      • unit (仅用于模拟值)
      • host
      • server (仅在从远程检索统计信息时使用)
    • 字段 (fields)
      • value (浮点数)

权限

当从本地系统收集数据时,Telegraf 需要访问 IPMI 设备节点的权限。当使用 udev 时,可以通过将以下规则添加到 /etc/udev/rules.d/52-telegraf-ipmi.rules 来为 telegraf 用户创建具有 rw 权限的设备节点

KERNEL=="ipmi*", MODE="660", GROUP="telegraf"

或者,也可以使用 sudo。您需要在 Telegraf 配置中包含以下内容

[[inputs.ipmi_sensor]]
  use_sudo = true

您还需要更新您的 sudoers 文件

$ visudo
# Add the following line:
Cmnd_Alias IPMITOOL = /usr/bin/ipmitool *
telegraf  ALL=(root) NOPASSWD: IPMITOOL
Defaults!IPMITOOL !logfile, !syslog, !pam_session

示例输出

版本 1 架构

从远程服务器检索统计信息时

ipmi_sensor,server=10.20.2.203,name=uid_light value=0,status=1i 1517125513000000000
ipmi_sensor,server=10.20.2.203,name=sys._health_led status=1i,value=0 1517125513000000000
ipmi_sensor,server=10.20.2.203,name=power_supply_1,unit=watts status=1i,value=110 1517125513000000000
ipmi_sensor,server=10.20.2.203,name=power_supply_2,unit=watts status=1i,value=120 1517125513000000000
ipmi_sensor,server=10.20.2.203,name=power_supplies value=0,status=1i 1517125513000000000
ipmi_sensor,server=10.20.2.203,name=fan_1,unit=percent status=1i,value=43.12 1517125513000000000

从本地机器检索统计信息时(未指定服务器)

ipmi_sensor,name=uid_light value=0,status=1i 1517125513000000000
ipmi_sensor,name=sys._health_led status=1i,value=0 1517125513000000000
ipmi_sensor,name=power_supply_1,unit=watts status=1i,value=110 1517125513000000000
ipmi_sensor,name=power_supply_2,unit=watts status=1i,value=120 1517125513000000000
ipmi_sensor,name=power_supplies value=0,status=1i 1517125513000000000
ipmi_sensor,name=fan_1,unit=percent status=1i,value=43.12 1517125513000000000

版本 2 架构

从本地机器检索统计信息时(未指定服务器)

ipmi_sensor,name=uid_light,entity_id=23.1,status_code=ok,status_desc=ok value=0 1517125474000000000
ipmi_sensor,name=sys._health_led,entity_id=23.2,status_code=ok,status_desc=ok value=0 1517125474000000000
ipmi_sensor,entity_id=10.1,name=power_supply_1,status_code=ok,status_desc=presence_detected,unit=watts value=110 1517125474000000000
ipmi_sensor,name=power_supply_2,entity_id=10.2,status_code=ok,unit=watts,status_desc=presence_detected value=125 1517125474000000000
ipmi_sensor,name=power_supplies,entity_id=10.3,status_code=ok,status_desc=fully_redundant value=0 1517125474000000000
ipmi_sensor,entity_id=7.1,name=fan_1,status_code=ok,status_desc=transition_to_running,unit=percent value=43.12 1517125474000000000

此页面是否有帮助?

感谢您的反馈!


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