首页 > 代码库 > IPMI (Intelligent Platform Management Interface)
IPMI (Intelligent Platform Management Interface)
4.3. ipmitool - utility for controlling IPMI-enabled devices
4.3.1. ipmitool
4.3.1.1. ubuntu
确定硬件是否支持 IPMI
neo@monitor:~$ sudo dmidecode |grep -C 5 IPMI[sudo] password for neo:Handle 0x2000, DMI type 32, 11 bytesSystem Boot Information Status: No errors detectedHandle 0x2600, DMI type 38, 18 bytesIPMI Device Information Interface Type: KCS (Keyboard Control Style) Specification Version: 2.0 I2C Slave Address: 0x10 NV Storage Device: Not Present Base Address: 0x0000000000000CA8 (I/O)
sudo apt-get install openipmisudo apt-get install ipmitoolsudo mkdir -p /var/lock/subsys/ipmi$ sudo /etc/init.d/openipmi start * Starting ipmi drivers [ OK ]
4.3.1.2. CentOS
# yum search ipmi========================================== Matched: ipmi ===========================================OpenIPMI.x86_64 : OpenIPMI (Intelligent Platform Management Interface) library and toolsOpenIPMI-devel.i386 : The development environment for the OpenIPMI project.OpenIPMI-devel.x86_64 : The development environment for the OpenIPMI project.OpenIPMI-gui.x86_64 : IPMI graphical user interface toolOpenIPMI-libs.i386 : The OpenIPMI runtime librariesOpenIPMI-libs.x86_64 : The OpenIPMI runtime librariesOpenIPMI-perl.x86_64 : OpenIPMI Perl language bindingsOpenIPMI-python.x86_64 : OpenIPMI Python language bindingsOpenIPMI-tools.x86_64 : OpenIPMI utilities and scripts from ipmitoolcollectd-ipmi.x86_64 : IPMI module for collectdfreeipmi.i386 : FreeIPMIfreeipmi.x86_64 : FreeIPMIfreeipmi-bmc-watchdog.x86_64 : FreeIPMI BMC watchdogfreeipmi-devel.i386 : Development package for FreeIPMIfreeipmi-devel.x86_64 : Development package for FreeIPMIfreeipmi-ipmidetectd.x86_64 : IPMI node detection monitoring daemonopenhpi.i386 : openhpi Hardware Platform Interface (HPI) library and toolsopenhpi.x86_64 : openhpi Hardware Platform Interface (HPI) library and toolsripmime.x86_64 : Extract attachments out of a MIME encoded email packageswatchdog.x86_64 : Software and/or Hardware watchdog daemon# yum install OpenIPMI OpenIPMI-tools -y
4.3.2. sensor
# ipmitool -I open sensor list
4.3.3. ipmitool shell
# ipmitool shell
mc info
ipmitool> mc infoDevice ID : 32Device Revision : 0Firmware Revision : 1.54IPMI Version : 2.0Manufacturer ID : 674Manufacturer Name : DELL IncProduct ID : 256 (0x0100)Product Name : Unknown (0x100)Device Available : yesProvides Device SDRs : yesAdditional Device Support : Sensor Device SDR Repository Device SEL Device FRU Inventory Device IPMB Event Receiver Bridge Chassis DeviceAux Firmware Rev Info : 0x00 0x0f 0x00 0x00ipmitool> lan print 1Set in Progress : Set CompleteAuth Type Support : NONE MD2 MD5 PASSWORDAuth Type Enable : Callback : MD2 MD5 : User : MD2 MD5 : Operator : MD2 MD5 : Admin : MD2 MD5 : OEM :IP Address Source : Static AddressIP Address : 172.16.1.132Subnet Mask : 255.255.255.0MAC Address : 84:2b:2b:fd:e2:51SNMP Community String : publicIP Header : TTL=0x40 Flags=0x40 Precedence=0x00 TOS=0x10Default Gateway IP : 172.16.1.254Default Gateway MAC : 00:00:00:00:00:00Backup Gateway IP : 0.0.0.0Backup Gateway MAC : 00:00:00:00:00:00802.1q VLAN ID : Disabled802.1q VLAN Priority : 0RMCP+ Cipher Suites : 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14Cipher Suite Priv Max : aaaaaaaaaaaaaaa : X=Cipher Suite Unused : c=CALLBACK : u=USER : o=OPERATOR : a=ADMIN : O=OEM
4.3.4. ipmitool 访问远程主机
# ipmitool -H 172.16.1.155 -U root -P 123456 lan print 1Set in Progress : Set CompleteAuth Type Support : NONE MD2 MD5 PASSWORDAuth Type Enable : Callback : MD2 MD5 : User : MD2 MD5 : Operator : MD2 MD5 : Admin : MD2 MD5 : OEM :IP Address Source : Static AddressIP Address : 172.16.1.15Subnet Mask : 255.255.255.0MAC Address : 84:2b:2b:fc:fb:ccSNMP Community String : publicIP Header : TTL=0x40 Flags=0x40 Precedence=0x00 TOS=0x10Default Gateway IP : 172.16.1.254Default Gateway MAC : 00:00:00:00:00:00Backup Gateway IP : 0.0.0.0Backup Gateway MAC : 00:00:00:00:00:00802.1q VLAN ID : Disabled802.1q VLAN Priority : 0RMCP+ Cipher Suites : 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14Cipher Suite Priv Max : aaaaaaaaaaaaaaa : X=Cipher Suite Unused : c=CALLBACK : u=USER : o=OPERATOR : a=ADMIN : O=OEM
4.3.5. Get chassis status and set power state
# ipmitool -I open chassisChassis Commands: status, power, identify, policy, restart_cause, poh, bootdev, bootparam, selftest# ipmitool -I open chassis statusSystem Power : onPower Overload : falsePower Interlock : inactiveMain Power Fault : falsePower Control Fault : falsePower Restore Policy : previousLast Power Event :Chassis Intrusion : inactiveFront-Panel Lockout : inactiveDrive Fault : falseCooling/Fan Fault : falseSleep Button Disable : not allowedDiag Button Disable : allowedReset Button Disable : not allowedPower Button Disable : allowedSleep Button Disabled: falseDiag Button Disabled : trueReset Button Disabled: falsePower Button Disabled: false
4.3.6. Configure Management Controller
4.3.6.1. Management Controller status and global enables
# ipmitool -I open mcMC Commands: reset <warm|cold> guid info watchdog <get|reset|off> selftest getenables setenables <option=on|off> ... recv_msg_intr Receive Message Queue Interrupt event_msg_intr Event Message Buffer Full Interrupt event_msg Event Message Buffer system_event_log System Event Logging oem0 OEM 0 oem1 OEM 1 oem2 OEM 2
4.3.6.2. Configure LAN Channels
ipmitool -I open lan print 1 显示BMC通道的信息,如果不知道BMC使用的是哪个通道,请使用下面的命令确认:ipmitool -I open channel info 1ipmitool -I open lan set 1 ipsrc static 设置本地BMC地址为静态,才能设置IPipmitool -I open lan set 1 ipaddr 172.16.0.2 设置本地BMC的IP地址ipmitool -I open lan set 1 netmask 255.255.255.0 子网掩码,别忘了设ipmitool -I open lan set 1 defgw ipaddr 172.16.0.254 网关,可设可不设,不过一定要确保监控它的机器位于同一路由
4.3.6.3. Configure Management Controller users
ipmitool user list 1 查看BMC的用户列表ipmitool user set name 1 username 对BMC的1号用户设置用户名usernameipmitool user set password 1 123456 对BMC的1号用户设置密码123456
4.3.6.4. Configure Management Controller channels
# ipmitool -I open channel info 1Channel 0x1 info: Channel Medium Type : 802.3 LAN Channel Protocol Type : IPMB-1.0 Session Support : multi-session Active Session Count : 0 Protocol Vendor ID : 7154 Volatile(active) Settings Alerting : disabled Per-message Auth : disabled User Level Auth : enabled Access Mode : always available Non-Volatile Settings Alerting : disabled Per-message Auth : disabled User Level Auth : enabled Access Mode : always available
4.3.7. Example for iDRAC
http://support.dell.com/support/edocs/software/smbmcmu/bmcmu_4_0/cs/ug/bmcugc0d.htm#wp1067804
4.3.7.1. 更改IP地址,子网掩码与网关
查看IP,子网掩码与网关
# ipmitool -I open lan print 1Set in Progress : Set CompleteAuth Type Support : NONE MD2 MD5 PASSWORDAuth Type Enable : Callback : MD2 MD5 : User : MD2 MD5 : Operator : MD2 MD5 : Admin : MD2 MD5 : OEM :IP Address Source : Static AddressIP Address : 172.16.5.23Subnet Mask : 255.255.255.0MAC Address : 18:03:73:f5:ee:82SNMP Community String : publicIP Header : TTL=0x40 Flags=0x40 Precedence=0x00 TOS=0x10Default Gateway IP : 172.16.5.254Default Gateway MAC : 00:00:00:00:00:00Backup Gateway IP : 0.0.0.0Backup Gateway MAC : 00:00:00:00:00:00802.1q VLAN ID : Disabled802.1q VLAN Priority : 0RMCP+ Cipher Suites : 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14Cipher Suite Priv Max : aaaaaaaaaaaaaaa : X=Cipher Suite Unused : c=CALLBACK : u=USER : o=OPERATOR : a=ADMIN : O=OEM
设置IP,子网掩码与网关
/usr/bin/ipmitool -I open lan set 1 ipaddr 172.16.8.200/usr/bin/ipmitool -I open lan set 1 netmask 255.255.255.0/usr/bin/ipmitool -I open lan set 1 defgw ipaddr 172.16.8.254/usr/bin/ipmitool -I open lan set 1 access on
4.3.7.2. 更改 iDRAC LCD 显示屏
# ipmitool delloem lcd set mode userdefined test# ipmitool delloem lcd infoLCD info Setting: User defined Text: test
4.3.7.3. 更改 iDRAC 密码
# ipmitool user list 2ID Name Callin Link Auth IPMI Msg Channel Priv Limit2 root true true true ADMINISTRATOR# ipmitool user set password 2 "mypasswd"
4.3.7.4. 关机/开机
服务器关机#ipmitool -I lan -U root -P secpass -H 10.10.0.5 power off服务器开机#ipmitool -I lan -U root -P secpass -H 10.10.0.5 power on服务器 reset#ipmitool -I lan -U root -P secpass -H 10.10.0.5 power reset
4.3.7.5. 启动列表
ipmitool -I lan -H 10.10.0.5 -U ADMIN -P ADMIN chassis bootdev pxe
IPMI (Intelligent Platform Management Interface)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。