服务器-IPMI详解
IPMI、Intelligent Platform Management Interface(智能平台管理接口):一种开放标准的硬件管理接口规范,定义了如何与服务器上的BMC进行通信。
- 核心作用:允许管理员独立于操作系统,通过网络远程管理服务器硬件,即使服务器关机或操作系统无响应,也能进行操作。(带外管理)
- 与BMC的关系:BMC是“硬件”,IPMI是“语言”,IPMI控制BMC实现相关操作。
- 常见功能如下:
| 远程电源管理 | 远程查看、控制服务器的开机、关机、重启 |
| 硬件健康监控 | 实时读取CPU温度、风扇转速、电压、电源状态等传感器数据 |
| 系统事件日志 | 查看和管理系统事件日志(SEL),用于故障排查 |
| 远程控制台 |
远程查看启动过程和操作系统控制台 1、KVM:远程桌面,带图形界面 2、Serial Over LAN:远程串口,纯命令行 3、JViewer:基于Java的远程桌面(KVM) |
| 用户与安全 |
管理BMC的用户账号和权限 |
一、IPMI使用——安装和使用介绍
| 安装 |
yum install ipmitool #Centos系列 apt install ipmitool #Ubuntu系列 ipmitool -h #查看帮助信息
Interfaces:接口类型,指定通过什么通道与BMC通信 Interfaces:
open Linux OpenIPMI Interface [default]
imb Intel IMB Interface
lan IPMI v1.5 LAN Interface
lanplus IPMI v2.0 RMCP+ LAN Interface
serial-terminal Serial Interface, Terminal Mode
serial-basic Serial Interface, Basic Mode
usb IPMI USB Interface(OEM Interface for AMI Devices)
|
|
||||||||||||||||||||||||
| 使用 |
命令格式:ipmitool [options...] <command> options:选项,配置参数,控制“如何连接”BMC(比如远程BMC的IP,用户名及密码)
-h This help -V Show version information -v Verbose (can use multiple times) -c Display output in comma separated format -d N Specify a /dev/ipmiN device to use (default=0) -I intf Interface to use -H hostname Remote host name for LAN interface -p port Remote RMCP port [default=623] -U username Remote session username |
commands:命令,告诉BMC“要做什么”,后续进行详细行介绍 Commands:
raw Send a RAW IPMI request and print response
i2c Send an I2C Master Write-Read command and print response
spd Print SPD info from remote I2C device
lan Configure LAN Channels
chassis Get chassis status and set power state
power Shortcut to chassis power commands
event Send pre-defined events to MC
mc Management Controller status and global enables
sdr Print Sensor Data Repository entries and readings
sensor Print detailed sensor information
fru Print built-in FRU and scan SDR for FRU locators
gendev Read/Write Device associated with Generic Device locators sdr
sel Print System Event Log (SEL)
pef Configure Platform Event Filtering (PEF)
sol Configure and connect IPMIv2.0 Serial-over-LAN
tsol Configure and connect with Tyan IPMIv1.5 Serial-over-LAN
isol Configure IPMIv1.5 Serial-over-LAN
user Configure Management Controller users
channel Configure Management Controller channels
session Print session information
dcmi Data Center Management Interface
nm Node Manager Interface
sunoem OEM Commands for Sun servers
kontronoem OEM Commands for Kontron devices
picmg Run a PICMG/ATCA extended cmd
fwum Update IPMC using Kontron OEM Firmware Update Manager
firewall Configure Firmware Firewall
delloem OEM Commands for Dell systems
shell Launch interactive IPMI shell
exec Run list of commands from file
set Set runtime variable for shell and exec
hpm Update HPM components using PICMG HPM.1 file
ekanalyzer run FRU-Ekeying analyzer using FRU files
ime Update Intel Manageability Engine Firmware
vita Run a VITA 46.11 extended cmd
lan6 Configure IPv6 LAN Channels
|
一、IPMI使用——实战命令
| 电源管理 |
本地命令 ipmitool power status #查看服务器当前电源状态
ipmitool power on #开机
ipmitool power reset #强制重启
ipmitool power cycle #冷重启(先断电再开机)
|
远程命令 ipmitool -H 172.19.66.22 -U admin -P password -I lanplus power status ipmitool -H 172.19.66.22 -U admin -P password -I lanplus power on ipmitool -H 172.19.66.22 -U admin -P password -I lanplus power reset ipmitool -H 172.19.66.22 -U admin -P password -I lanplus power cycle |
| 网络配置 |
ipmitool lan print 1 #打印通道1的网络信息,通常只有1个通道,id为1 ipmitool lan set 1 ipsrc dhcp #设置IP获取方式为DHCP,动态获取 ipmitool lan set 1 ipsrc static #设置IP获取方式为静态IP,需手动设置 ipmitool set 1 ipaddr <IP地址> ipmitool set 1 netmask <子网掩码> ipmitool set 1 defgw ipaddr <网关地址> |
|
| 用户管理 |
ipmitool user list 1 #列出通道1的所有用户,通常只有1个通道,id为1 ipmitool user set name <用户ID> <用户名> #添加用户,设置指定用户ID的用户名 ipmitool user set password <用户ID> <用户密码> #设置用户密码 #设置密码:如果开启了复杂密码验证使能,必须要有特殊字符、Test@123 #密码不符合复杂度要求,会出现报错 ipmitool user enable/disable <用户ID> #启用或停用用户 ipmitool user priv 3 3 1 #设置用户权限(3是用户ID,3是OPERATOR级别,1是通道号) ipmitool channel getaccess 1 <用户ID> #查看用户在该通道上的权限 |
|
| 查看传感器 |
ipmitool sensor list #列出所有传感器及其当前读数(温度、风扇等) |
|
| 查看系统事件日志 |
ipmitool sel list #查看系统事件日志,是排查硬件问题的利器 |
|
| 重启BMC |
ipmitool mc reset warm/cold #有特殊需求时才用 |
|
| SOL功能 |
ipmitool sol info 1 #查看SOL信息 |
本文来自博客园,作者:FengweiTech,转载请注明原文链接:https://www.cnblogs.com/fengwei-blogs/p/18841162



浙公网安备 33010602011771号