Linux之ipmitool管理BMC詳解
BMC管理 – ipmitool
老規(guī)矩,先 help看看參數(shù)
[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 [選項] <命令> [參數(shù)]
其中:
選項
是一些可選的開關(guān),用于設(shè)置ipmitool的一些參數(shù)。命令
是要執(zhí)行的操作,如獲取傳感器信息等。參數(shù)
是可選的,它們是指定要執(zhí)行的特定操作所需的選項和值。
常用的ipmitool命令
1.獲取傳感器信息
ipmitool sensor get <Sensor ID>
其中,
<Sensor ID>
是要獲取的傳感器的ID。
此命令將顯示指定傳感器的當前狀態(tài)。
2.顯示系統(tǒng)信息
ipmitool fru print
此命令將打印系統(tǒng)中所有可用的FRU(固件可重編程單元)信息。
3.電源控制
ipmitool power on 開啟電源 ipmitool power off 關(guān)閉電源 ipmitool power reset 重置電源,按我的理解是沒有完全斷電的動作,類似系統(tǒng)的reboot ipmitool power cycle 先關(guān)閉電源,再開啟
這些命令用于控制服務(wù)器的電源狀態(tài)。
4.顯示事件日志
ipmitool sel list
此命令將顯示系統(tǒng)的事件日志。
5.啟用/禁用BMC用戶
ipmitool user enable <用戶ID> ipmitool user disable <用戶ID>
這些命令用于啟用或禁用BMC用戶。
以上是一些常用的ipmitool命令和它們的基本用法。
更多的ipmitool命令和選項可以通過ipmitool -h
命令查看完整的幫助文檔。
關(guān)于OS下設(shè)定BMC或遠程控制服務(wù)器的BMC命令等
ipmitool可以通過IPMI-over-LAN(基于LAN的IPMI協(xié)議)來遠程控制BMC。
要使用IPMI-over-LAN,您需要確保BMC已經(jīng)配置并連接到網(wǎng)絡(luò)。
通過IPMI-over-LAN連接到BMC并進行遠程控制的步驟
1.確定BMC的IP地址
使用ipmitool lan print
命令可以獲取BMC的IP地址、MAC地址和子網(wǎng)掩碼等信息。
如果BMC未配置IP地址,則需要在本地物理訪問服務(wù)器以配置BMC。
2.連接到BMC
使用ipmitool lan set <參數(shù)>
命令設(shè)置BMC的用戶名、密碼和IP地址等信息。
例如,下面的命令設(shè)置BMC的IP地址為192.168.1.100,并將用戶名設(shè)置為admin,密碼設(shè)置為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
注意:
這里假設(shè)BMC使用的是默認的LAN通道1。
如果使用的是其他通道,則需要將1
替換為相應(yīng)通道的數(shù)字。
3.啟用IPMI-over-LAN功能
使用ipmitool channel info <通道號>
命令檢查BMC所在通道的IPMI-over-LAN功能是否已經(jīng)啟用。
如果未啟用,可以使用以下命令啟用:
ipmitool channel setaccess <通道號> 2 ipmi=on auth=off link=on privilege=4
這將啟用指定通道的IPMI-over-LAN功能,并使得通過此通道的IPMI會話的權(quán)限級別為4(ADMINISTRATOR級別)。
4.連接到遠程BMC
使用以下命令連接到遠程BMC:
ipmitool -H <BMC IP地址> -U <用戶名> -P <密碼> -I lanplus <命令>
注意,這里使用了-I lanplus
選項,以使用基于LAN的IPMI協(xié)議。
<命令>
是您要執(zhí)行的ipmitool命令。
例如:
要獲取傳感器信息,可以使用以下命令:
ipmitool -H 192.168.1.100 -U admin -P password -I lanplus sensor list
這將顯示遠程BMC的傳感器列表信息。
總結(jié)
以上是通過ipmitool進行遠程BMC控制的基本步驟。
請注意,遠程BMC的訪問權(quán)限應(yīng)該是受限的,只有授權(quán)用戶才能訪問。此外,您還應(yīng)該確保網(wǎng)絡(luò)安全措施已經(jīng)得到了應(yīng)用,以確保遠程訪問的安全性。
這些僅為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
Linux中執(zhí)行定時任務(wù)的方法小結(jié)
有時候要在Linux系統(tǒng)上定時執(zhí)行腳本,Linux提供定時任務(wù)命令可以執(zhí)行,這篇文章小編就來和大家聊聊都有哪些方法可以實現(xiàn)定時任務(wù)吧2024-12-12CentOS 7.2配置Apache服務(wù)httpd(下)
這篇文章主要為大家詳細介紹了CentOS 7.2配置Apache服務(wù) httpd上篇,具有一定的參考價值,感興趣的小伙伴們可以參考一下2016-11-11如何關(guān)閉http Methods中的Trace 提高安全意識
在配置文件http.conf 添加 TraceEnable off 即可關(guān)閉2013-02-02shell 命令行中操作HBase數(shù)據(jù)庫實例詳解
這篇文章主要介紹了 shell 命令行中操作HBase數(shù)據(jù)庫實例詳解的相關(guān)資料,需要的朋友可以參考下2016-11-11apache .htaccess文件詳解和配置技巧總結(jié)
這篇文章主要介紹了apache .htaccess文件詳解和配置技巧總結(jié),需要的朋友可以參考下2014-04-04