目录
- BMC管理 – ipmitool
- 老规矩,先 help看看参数
- 常用的ipmitool命令
- 关于OS下设定BMC或远程控制服务器的BMC命令等
- 通过IPMI-over-LAN连接到BMC并进行远程控制的步骤
- 总结
BMC管理 – ipmitool
老规矩,先 help看看参数
- [root@test ~]# ipmitool -h
- ipmitool version 1.8.18
- usage: ipmitool [options...] <command>
- -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
- -f file Read remote session password from file
- -z size Change Size of Communication Channel (OEM)
- -S sdr Use local file for remote SDR cache
- -D tty:b[:s] Specify the serial device, baud rate to use
- and, optionally, specify that interface is the system one
- -4 Use only IPv4
- -6 Use only IPv6
- -a Prompt for remote password
- -Y Prompt for the Kg key for IPMIv2 authentication
- -e char Set SOL escape character
- -C ciphersuite Cipher suite to be used by lanplus interface
- -k key Use Kg key for IPMIv2 authentication
- -y hex_key Use hexadecimal-encoded Kg key for IPMIv2 authentication
- -L level Remote session privilege level [default=ADMINISTRATOR]
- Append a '+' to use name/privilege lookup in RAKP1
- -A authtype Force use of auth type NONE, PASSWORD, MD2, MD5 or OEM
- -P password Remote session password
- -E Read password from IPMI_PASSWORD environment variable
- -K Read kgkey from IPMI_KGKEY environment variable
- -m address Set local IPMB address
- -b channel Set destination channel for bridged request
- -t address Bridge request to remote target address
- -B channel Set transit channel for bridged request (dual bridge)
- -T address Set transit address for bridge request (dual bridge)
- -l lun Set destination lun for raw commands
- -o oemtype Setup for OEM (use 'list' to see available OEM types)
- -O seloem Use file for OEM SEL event descriptions
- -N seconds Specify timeout for lan [default=2] / lanplus [default=1] interface
- -R retry Set the number of retries for lan/lanplus interface [default=4]
- 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)
- 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
复制代码ipmitool命令的基本格式是: 其中:
- 是一些可选的开关,用于设置ipmitool的一些参数。
- 是要执行的操作,如获取传感器信息等。
- 是可选的,它们是指定要执行的特定操作所需的选项和值。
常用的ipmitool命令
1.获取传感器信息- ipmitool sensor get <Sensor ID>
复制代码其中, 是要获取的传感器的ID。
此命令将显示指定传感器的当前状态。
2.显示系统信息此命令将打印系统中所有可用的FRU(固件可重编程单元)信息。
3.电源控制- ipmitool power on 开启电源
- ipmitool power off 关闭电源
- ipmitool power reset 重置电源,按我的理解是没有完全断电的动作,类似系统的reboot
- ipmitool power cycle 先关闭电源,再开启
复制代码这些命令用于控制服务器的电源状态。
4.显示事件日志此命令将显示系统的事件日志。
5.启用/禁用BMC用户- ipmitool user enable <用户ID>
- ipmitool user disable <用户ID>
复制代码这些命令用于启用或禁用BMC用户。
以上是一些常用的ipmitool命令和它们的基本用法。
更多的ipmitool命令和选项可以通过 命令查看完整的帮助文档。
关于OS下设定BMC或远程控制服务器的BMC命令等
ipmitool可以通过IPMI-over-LAN(基于LAN的IPMI协议)来远程控制BMC。
要使用IPMI-over-LAN,您需要确保BMC已经配置并连接到网络。
通过IPMI-over-LAN连接到BMC并进行远程控制的步骤
1.确定BMC的IP地址
使用 命令可以获取BMC的IP地址、MAC地址和子网掩码等信息。
如果BMC未配置IP地址,则需要在本地物理访问服务器以配置BMC。
2.连接到BMC
使用 命令设置BMC的用户名、密码和IP地址等信息。
例如,下面的命令设置BMC的IP地址为192.168.1.100,并将用户名设置为admin,密码设置为password: - ipmitool lan set 1 ipsrc static
- ipmitool lan set 1 ipaddr 192.168.1.100
- ipmitool lan set 1 netmask 255.255.255.0
- ipmitool lan set 1 defgw ipaddr 192.168.1.1
- ipmitool user set name 2 admin
- ipmitool user set password 2 password
复制代码注意:
这里假设BMC使用的是默认的LAN通道1。
如果使用的是其他通道,则需要将 替换为相应通道的数字。
3.启用IPMI-over-LAN功能
使用 - ipmitool channel info <通道号>
复制代码命令检查BMC所在通道的IPMI-over-LAN功能是否已经启用。
如果未启用,可以使用以下命令启用: - ipmitool channel setaccess <通道号> 2 ipmi=on auth=off link=on privilege=4
复制代码这将启用指定通道的IPMI-over-LAN功能,并使得通过此通道的IPMI会话的权限级别为4(ADMINISTRATOR级别)。
4.连接到远程BMC
使用以下命令连接到远程BMC: - ipmitool -H <BMC IP地址> -U <用户名> -P <密码> -I lanplus <命令>
复制代码注意,这里使用了 选项,以使用基于LAN的IPMI协议。 是您要执行的ipmitool命令。
例如:
要获取传感器信息,可以使用以下命令: - ipmitool -H 192.168.1.100 -U admin -P password -I lanplus sensor list
复制代码这将显示远程BMC的传感器列表信息。
总结
以上是通过ipmitool进行远程BMC控制的基本步骤。
请注意,远程BMC的访问权限应该是受限的,只有授权用户才能访问。此外,您还应该确保网络安全措施已经得到了应用,以确保远程访问的安全性。
这些仅为个人经验,希望能给大家一个参考,也希望大家多多支持晓枫资讯。
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作! |