What is ipmitool?
ipmitool is a command-line tool based on a free software license that supports various functions such as monitoring hardware status, viewing sensors, and checking logs.
Installing ipmitool
On most Linux distributions, you can install ipmitool using the package manager:
sudo apt-get install ipmitool # For Debian/Ubuntu
sudo yum install ipmitool # For CentOS/Fedora
Make sure you have root privileges to perform installation and management operations.
1. View BMC Information
# View BMC information
ipmitool mc info
# View BMC IP address
ipmitool lan print
# View motherboard FRU information (model, serial number, etc.)
ipmitool fru print
This command displays basic management controller information for the server, including IP address, subnet mask, etc.
2. Check System Health Status
ipmitool sdr list
This command lists the status of all sensors, helping you monitor hardware health in real-time.
3. View System Logs
ipmitool sel list
With this command, you can view the system event log to analyze system errors and warnings.
4. Remote Control the Server
# Check power status:
ipmitool –H (BMC management IP address) –I lanplus –U (BMC login username) –P (BMC login password) power status
# Power on:
ipmitool –H (BMC management IP address) –I lanplus –U (BMC login username) –P (BMC login password) power on
# Force power off:
ipmitool –H (BMC management IP address) –I lanplus –U (BMC login username) –P (BMC login password) chassis power off
# Force reset:
ipmitool –H (BMC management IP address) –I lanplus –U (BMC login username) –P (BMC login password) chassis power reset
These commands are very useful when you need to access a remote server.
5. Check Server Power Status
ipmitool chassis power status # Check the current power status of the system
6. Reset Password
— Execute command to list users and find the corresponding user ID
ipmitool user list 1
— Reset password
ipmitool user setpassword <userID> "<new password>" # Use the user ID queried in the previous step
7. Restart BMC
# Cold restart BMC
ipmitool mc reset cold
Conclusion
ipmitool is not only a tool for managing Linux servers but also a great assistant for network administrators, IT operations personnel, and developers.