Linux Commands

IPMI Linux Command

When working with Linux systems and servers, you often need to monitor and troubleshoot hardware and other components remotely. The Intelligent Platforms Management Interface (IPMI) makes achieving that from the command line easier. An IPMItool is needed to access the capabilities of IPMI, and you can run most tasks remotely.

This guide will cover how to install the IPMItool on Linux and Debian systems and see several commands at your disposal when working with IPMI.

How To Install IPMItool

To install IPMItool on Ubuntu, update the package repository, then run the following command:

$ sudo apt install ipmitool

The IPMI daemon should automatically start.

For CentOS, start with updating the repositories.

$ yum update

Run the following command to install IPMItool:

$ sudo yum install OpenIPMI ipmitool

Once installed, proceed to enable the IPMItool access using the following command:

$ /sbin/chkconfig ipmi on

Getting Started With the IPMItool

The IPMI Linux tool has multiple commands categorized in different sections, including chassis, sensor output, and more.

1. IPMI LAN Configuration Commands

When accessing remote devices and servers, the IPMItool allows creating a LAN channel, and all its configurations can be done on the terminal.

To set the LAN to use a static IP address, run the following command:

$ ipmitool lan set 1 ipsrc static

You now need to set the actual IP address for the LAN. Replace the following with your preferred one.

$ ipmitool lan set 1 ipaddr 192.168.0.11

Next, set the netmask for the channel. In this case, we set our IP to a class C. Our netmask will be:

$ ipmitool lan set 1 netmask 255.255.255.0

You must also configure the default gateway and MAC address, as shown below:

$ ipmitool lan set 1 defgw ipaddr < default gateway ip >
$ ipmitool lan set 1 defgw macaddr <MAC address>

To enable BMC-generated ARP responses, run the following command:

$ ipmitool lan set 1 arp respond on

The last step is to define your authentication rules.

$ ipmitool lan set 1 auth ADMIN MD5

You can check the set configurations using the following command:

$ ipmitool lan print 1

The previous commands created one LAN channel, and the next thing is to define the users who will access the channel.

Use the following commands to set up a user named admin with the password test01:

$ ipmitool user set name 2 admin
$ ipmitool user set password 2

Here, 2 is the user ID of the admin user. You also need to enable and grant the new user admin access, as shown below:

$ ipmitool channel setaccess 1 2 link=on ipmi=on callin=on privilege=4
$ ipmitool user enable 2

You can view the user list using the following command:

$ ipmitool user list

2. Sensor Output Commands

There is a command to list the different sensors on your system.

To list all the names of the sensors, use the following command:

$ ipmitool sdr list

To list all the types of sensors, use the following command:

$ ipmitool sdr type list

To list all the sensors for fans on the system, use the following command:

$ ipmitool sdr type Fan

To list all types of sensors for the power supply, use the following command:

$ ipmitool sdr type “Power Supply”

To view the types of sensors for the temperature, use the following command:

$ ipmitool sdr type Temperature

3. Logging Commands

Generating and analyzing system event logs are part of an admin’s job, which can be simplified using the IPMItool.

Here’s a quick cheat sheet for most of the logging commands:

ipmitool sel info: it displays general system event log details.

ipmitool sel list: it shows the system event logs.

ipmitool sel clear: it clears the event logs.

4. Common IPMI Commands

The IPMItool has tons of commands. However, the common ones that you will encounter are:

To power on the server, use the following command:

$ ipmitool -I lanplus -H <your serverdomain> -P <yourpassword> chassis power on

To power off the server, use the following command:

$ ipmitool -I lanplus -H <your serverdomain> -P <yourpassword> chassis power off

To check the status of your server, use the following command:

$ ipmitool -I lanplus -H <your serverdomain> -P <yourpassword> chassis status

To activate the SOL system console, use the following command:

$ ipmitool -I lanplus -H <your serverdomain> -P <yourpassword> sol activate

Conclusion

This article discussed how you could install IPMItool on Ubuntu and CentOS. Besides, we’ve also discussed some basic IPMItool commands. However, those are simply several things you can achieve with the IPMItool. Using the man page, you can play with different commands, which help perform various tasks. Hopefully, this article has set the pace for you.

About the author

Denis Kariuki

Denis is a Computer Scientist with a passion for Networking and Cyber Security. I love the terminal, and using Linux is a hobby. I am passionate about sharing tips and ideas about Linux and computing.