[root @ localhost ~] # yum install -y ipmitool #install this package
#service ipmi start
#ipmitool -I open shell
#### You can directly enter the local BMC sh
[root@localhost ~]# 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
1. Switch on and off, restart
1. Check the switch status:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login username) -P (BMC login username password) power status
2. Turn on:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login username) -P (BMC login username password) power on
3. Shut down:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login username) -P (BMC login username password) power off
4. Restart:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) power reset
Second, user management
Note: [ChannelNo] field is optional, ChannoNo is 1 or 8; BMC defaults to 2 users: anonymous user with user id 1, ADMIN user with user id 2; <> field is required content; <privilege level>: 2 is user permission, 3 is Operator permission, 4 is Administrator permission;
1. View user information:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) user list [ChannelNo]
2. Add users:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login username) -P (BMC login username password) user set name <user id> <username>
3. Set password:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) user set password <user id> <password>
4. Set user permissions:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login username) -P (BMC login username password) user priv <user id> <privilege level> [ChannelNo]
5. Enable / disable users:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) user enable / disable <user id>
3. IP network settings
Note: The [ChannelNo] field is optional, ChannoNo is 1 (Share Nic network) or 8 (BMC independent management network); to set the network parameters, you must first set the IP to static, and then make other settings;
1. View network information:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login username) -P (BMC login username password) lan print [ChannelNo]
2. Change the IP to static or DHCP mode:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) lan set <ChannelNo> ipsrc <static / dhcp>
3. Modify the IP address:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) lan set <ChannelNo> ipaddr <IPAddress>
4. Modify the subnet mask:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) lan set <ChannelNo> netmask <NetMask>
5. Modify the default gateway:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) lan set <ChannelNo> defgw ipaddr <default gateway>
Four, SOL function
Explanation: <9.6 / 19.2 / 38.4 / 57.6 / 115.2> where 115.2 represents 115200, that is * 1000 is the baud rate.
1. Set the SOL serial port baud rate:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) sol set volatile-bit-rate <9.6 / 19.2 / 38.4 / 57.6 / 115.2>
2. Turn on the SOL function:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login username) -P (BMC login username password) sol activate
3. Turn off the SOL function:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login username) -P (BMC login username password) sol deactivate
Five, SEL log view
1. View the SEL log:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) sel list
6. View FRU information
1. View FRU information:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) fru list
Seven, SDR, Sensor information view
1. View SDR Sensor information:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) sdr
2. View Sensor information:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login username) -P (BMC login username password) sensor list
8. MC (Management Unit BMC) status and control
1. Restart the BMC:
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) mc reset <warm / cold>
Nine, set the BMC iptables firewall
1. Set a certain IP to access BMC
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login username) -P (BMC login username password) raw 0x32 0x76 0x01 0x01 ip1 (0xa 0xa 0xa 0xa) ip2 (0xb 0xb 0xb 0xb)
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) raw 0x32 0x76 0x09
2. Set an IP to access BMC
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login username) -P (BMC login username password) raw 0x32 0x76 0x00 0x01 ip1 (0xa 0xa 0xa 0xa)
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) raw 0x32 0x76 0x09
3. Cancel settings
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) raw 0x32 0x76 0x08
4. Get firewall settings
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) raw 0x32 0x77 0x01 0x00
5. Block / open a port
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) raw 0x32 0x76 0x02 0x00 / 0x01 0x00 (portno) 0x22 0x00
6. Cancel the setting of a port (6 is the corresponding cancel operation of 5)
ipmitool -H (BMC management IP address) -I lanplus -U (BMC login user name) -P (BMC login user name password) raw 0x32 0x76 0x06 0x00 / 0x01 0x00 (portno) 0x22 0x00
#service ipmi start
#ipmitool -I open shell
#### You can directly enter the local BMC shell
#ipmitool -I lan -H -U shell
#### Enter the password to enter the IPMI interactive mode, of course, you can also change the shell directly here It is a bmc command, and ipmitool supports ports, so can you do DNAT first, and then directly manage the intranet machine remotely.
#### ipmitool provides more functions than those provided by ipmish under windows. The usage is relatively complicated.
See below
Refer to the
excerpted article to learn more about the command. Ipmitool local monitoring command is used: ipmitool –I open command, where -I open means to use OpenIPMI interface, command has the following items:
a) raw: send a raw IPMI request, and print the reply message .
b) Lan: configure the network (lan) channel (
c) chassis: check the status of the chassis and set the power supply
d) event: send a defined event to the BMC, which can be used to test whether the configured SNMP is successful
e) mc: view MC (Management Contollor) status and various allowed items
f) sdr: print all monitoring items in the sensor warehouse and the values read from the sensor.
g) Sensor: Print detailed sensor information.
h) Fru: Print the built-in Field Replaceable Unit (FRU) information
i) Sel: Print System Event Log (SEL)
j) Pef: Set Platform Event Filtering (PEF), the event filtering platform is used to filter events using the strategy in PEF when the monitoring system finds an event, and then see if an alarm is needed .
k) Sol / isol: used to configure Lan for monitoring via serial port
l) User: set user information in BMC.
m) Channel: Set the Management Controller channel.
The Ipmitool –I open sensor list command can obtain various monitoring values in the sensor and the monitoring threshold of this value, including (CPU temperature, voltage, fan speed, power modulation module temperature, power supply voltage, etc.)
Ipmitool –I open sensor get “ "CPU0Temp" can get the ID as the monitoring value of CPU0Temp, CPU0Temp is the ID of the sensor, the ID is different for different servers.
Ipmitool –I open sensor thresh Set various limit values of the monitoring items whose ID value is equal to id.
Ipmitool –I open chassis status to view the chassis status, including chassis power information, chassis working status, etc.
Ipmitool –I open chassis restart_cause to view the reasons for the last system restart
Ipmitool –I open chassis policy list View the supported chassis power related policies.
Ipmitool –I open chassis power on to start the chassis, you can use this command to remotely boot
Ipmitool -I open chassis power off to turn off the chassis, use this command to remotely boot
Ipmitool -I open chassis power reset to achieve a hard restart, use this command to remotely boot
Ipmi can also set the system boot device, see the ipmitool help documentation for details.
Ipmitool –I open mc reset Make BMC restart hard
Ipmitool –I open mc info View BMC hardware information
Ipmitool –I open mc getenables List all allowed options of BMC
Ipmitool –I open mc setenables = [on | off], set bmc accordingly Allow / disable options.
Ipmitool-I open event 1 Send a high temperature message to the System Event Log. The events that can be sent are:
1 Temperature: Upper Critical: Going High
2 Voltage Threshold: Lower Critical: Going Low
3 Memory: Correctable ECC Error Detected
Ipmitool The -I open event command can be used to test whether the snmp function in the configured IPMI is successful.
Ipmitool -I open lan print 1 Print the information of our channel 1.
Ipmitool -I open lan set 1 ipaddr 10.10.113.95 sets the address of channel 1 to
10.10.113.95 Ipmitool -I open lan set 1 snmp public sets the community of snmp on channel 1 to public.
Ipmitool -I open lan set 1 access on Set channel 1 to allow access.
Ipmitool -I open pef info Print Platform Event Filtering (pef) information
Ipmitool -I open pef status View Platform Event Filtering (pef) status
Ipmitool -I open pef policy View Platform Event Filtering (pef) policy settings
Ipmitool -I open sdr list fru Read and display the fru information.
[root @ localhost ~] # yum install -y ipmitool #install this package
Power related:
#Turn on the power
ipmitool -I lanplus -H 10.41.1.41 -U root -P root power on
#Turn off the power
ipmitool -I lanplus -H 10.41.1.41 -U root -P root power off
#Restart power
ipmitool -I lanplus -H 10.41.1.41 -U root -P root power reset
#View power status
ipmitool -I lanplus -H 10.41.1.41 -U root -P root power status
Startup related:
#Set to BIOS boot
ipmitool -I lanplus -H 10.41.1.41 -U root -P root chassis bootparam set bootflag force_bios
#Set to pxe start
ipmitool -I lanplus -H 10.41.1.41 -U root -P root chassis bootparam set bootflag force_pxe
#Set to CD boot
ipmitool -I lanplus -H 10.41.1.41 -U root -P root chassis bootparam set bootflag force_cdrom
#Set to hard disk boot
ipmitool -I lanplus -H 10.41.1.41 -U root -P root chassis bootparam set bootflag force_disk
#Restart BMC
ipmitool -I lanplus -H 10.41.1.41 -U root -P root mc reset cold
#Modify BMC password
ipmitool -I lanplus -H 10.41.1.41 -U root -P root user set password 2 new_password #new_password This is the new password
#Remote text redirection restart the server to see the screen
ipmitool -I lanplus-H 10.41.1.41 -U root -P root sol activate
#When there is this error Info: SOL payload already active on another session
ipmitool -I lanplus-H 10.41.1.41 -U root -P root sol deactivate #This command kicks out other people's sessions
#Get mac address Some models do not allow me. This is a dell server. Huawei servers can also be used.
"""ipmitool -I lanplus -H 10.41.1.41 -U root -P root lan print |grep "MAC Address"|awk '{print $NF}'"""