Ipmitool

From Leo's Notes
Revision as of 23:50, 18 December 2021 by Leo (talk | contribs) (→Usage)
This page was last edited on 18 December 2021, at 23:50.

ipmitool is a utility to fetch information from devices that support the Intelligent Platform Management Interface (IPMI). This includes servers such as the HP Proliant DL380 G6 which I have at home or practically all Dell servers.

The project can be found at:

Installation

Clone the repository from https://github.com/ipmitool/ipmitool, then run autoconf, ./configure, make.

A docker image containing this binary can be found at:

Usage

Task Command
Print the iDRAC network settings ipmitool lan print
Set the iDRAC network settings
# ipmitool lan set 1 ipsrc static
# ipmitool lan set 1 ipaddr 10.1.1.21
# ipmitool lan set 1 netmask 255.255.255.0
# ipmitool lan set 1 defgw ipaddr 10.1.1.1
View system event logs ipmitool sel elist
Clear system event logs / amber light ipmitool sel clear
Powercycle a machine ipmitool -U username -f passwd.txt -I lanplus -H hostname chassis power cycle
Reset iDRAC account password
# ipmitool user list 1
ID  Name             Callin  Link Auth  IPMI Msg   Channel Priv Limit
1                    true    false      false      NO ACCESS
2   root             true    true       true       ADMINISTRATOR
3                    true    false      false      NO ACCESS
4                    true    false      false      NO ACCESS
5                    true    false      false      NO ACCESS
6                    true    false      false      NO ACCESS
7                    true    false      false      NO ACCESS
8                    true    false      false      NO ACCESS
9                    true    false      false      NO ACCESS
10                   true    false      false      NO ACCESS
11                   true    false      false      NO ACCESS
12                   true    false      false      NO ACCESS
13                   true    false      false      NO ACCESS
14                   true    false      false      NO ACCESS
15                   true    false      false      NO ACCESS
16                   true    false      false      NO ACCESS

# ipmitool user set password 2
Password for user 2:
Password for user 2:

Tasks

View System Event Logs

Use ipmitool sel elist to show logs.

# ipmitool sel elist
   1 | 08/24/2006 | 14:05:17 | Event Logging Disabled SEL | Log area reset/cleared | Asserted                                        
   2 | 12/11/2008 | 03:21:50 | Memory ECC Corr Err | Correctable ECC (Correctable ECC | Bank 1DIMM B) | Asserted                     
   3 |  Pre-Init  |0000000011| Physical Security Intrusion | General Chassis intrusion | Asserted                                    
   4 |  Pre-Init  |0000000017| Physical Security Intrusion | General Chassis intrusion | Deasserted                                  
   5 |  Pre-Init  |0000000011| Physical Security Intrusion | General Chassis intrusion | Asserted                                    
   6 |  Pre-Init  |0000000016| Physical Security Intrusion | General Chassis intrusion | Deasserted                                  
   7 |  Pre-Init  |0000000011| Physical Security Intrusion | General Chassis intrusion | Asserted                                    
   8 |  Pre-Init  |0000000016| Physical Security Intrusion | General Chassis intrusion | Deasserted                                  
   9 | 06/11/2020 | 08:40:21 | Voltage CMOS Battery | Lower Critical going low  | Asserted | Reading 2.57 < Threshold 2.64 Volts     
   a | 06/11/2020 | 08:41:41 | Voltage CMOS Battery | Lower Critical going low  | Deasserted | Reading 2.73 < Threshold 2.64 Volts   
   b | 06/13/2020 | 19:01:06 | Voltage CMOS Battery | Lower Critical going low  | Asserted | Reading 2.63 < Threshold 2.64 Volts     
   c | 06/13/2020 | 19:01:11 | Voltage CMOS Battery | Lower Critical going low  | Deasserted | Reading 2.68 < Threshold 2.64 Volts

Polling Data

Poll the data from iLO by running ipmitool. An example output is given below.

/tmp # ./ipmitool -I lanplus -H X.X.X.X -U Administrator -P XXXXXXXXXX sensor
Unable to Get Channel Cipher Suites
UID Light        | 0x0        | discrete   | 0x0080| na        | na        | na        | na        | na        | na
Sys. Health LED  | 0x0        | discrete   | 0x0080| na        | na        | na        | na        | na        | na
Power Supply 1   | 85         | Watts      | ok    | na        | na        | na        | na        | na        | na
Power Supply 2   | 95         | Watts      | ok    | na        | na        | na        | na        | na        | na
Power Supplies   | 0x0        | discrete   | 0x0180| na        | na        | na        | na        | na        | na
Fan 1            | 13.720     | percent    | ok    | na        | na        | na        | na        | na        | na
Fan 2            | 13.720     | percent    | ok    | na        | na        | na        | na        | na        | na
Fan 3            | 22.736     | percent    | ok    | na        | na        | na        | na        | na        | na
Fan 4            | 27.048     | percent    | ok    | na        | na        | na        | na        | na        | na
Fan 5            | 22.736     | percent    | ok    | na        | na        | na        | na        | na        | na
Fan 6            | 13.720     | percent    | ok    | na        | na        | na        | na        | na        | na
Fans             | 0x0        | discrete   | 0x0180| na        | na        | na        | na        | na        | na
Temp 1           | 19.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 39.000    | 41.000    | 45.000
Temp 2           | 40.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 82.000    | 83.000
Temp 3           | 40.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 82.000    | 83.000
Temp 4           | 37.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 87.000    | 92.000
Temp 5           | 39.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 87.000    | 92.000
Temp 6           | 44.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 87.000    | 92.000
Temp 7           | 42.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 87.000    | 92.000
Temp 8           | 48.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 90.000    | 95.000
Temp 9           | 42.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 65.000    | 70.000
Temp 10          | 48.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 90.000    | 95.000
Temp 11          | 40.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 70.000    | 75.000
Temp 12          | 49.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 90.000    | 95.000
Temp 13          | na         |            | na    | 0.000     | 0.000     | 0.000     | 0.000     | 70.000    | 75.000
Temp 14          | na         |            | na    | 0.000     | 0.000     | 0.000     | 0.000     | 70.000    | 75.000
Temp 15          | na         |            | na    | 0.000     | 0.000     | 0.000     | 0.000     | 70.000    | 75.000
Temp 16          | na         |            | na    | 0.000     | 0.000     | 0.000     | 0.000     | 70.000    | 75.000
Temp 17          | na         |            | na    | 0.000     | 0.000     | 0.000     | 0.000     | 70.000    | 75.000
Temp 18          | na         |            | na    | 0.000     | 0.000     | 0.000     | 0.000     | 70.000    | 75.000
Temp 19          | 24.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 70.000    | 75.000
Temp 20          | 36.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 70.000    | 75.000
Temp 21          | 34.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 80.000    | 85.000
Temp 22          | 32.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 80.000    | 85.000
Temp 23          | 43.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 77.000    | 82.000
Temp 24          | 38.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 70.000    | 75.000
Temp 25          | 39.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 70.000    | 75.000
Temp 26          | 38.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 70.000    | 75.000
Temp 27          | na         |            | na    | 0.000     | 0.000     | 0.000     | 0.000     | 70.000    | 75.000
Temp 28          | na         |            | na    | 0.000     | 0.000     | 0.000     | 0.000     | 70.000    | 75.000
Temp 29          | 35.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 60.000    | 65.000
Temp 30          | 77.000     | degrees C  | ok    | 0.000     | 0.000     | 0.000     | 0.000     | 110.000   | 115.000
Memory           | 0x0        | discrete   | 0x4080| na        | na        | na        | na        | na        | na
Power Meter      | 188        | Watts      | ok    | na        | na        | na        | na        | na        | na

The data can be parsed then pushed into a logging server.

Troubleshooting

$ autoconf
configure.ac:8: error: possibly undefined macro: AM_INIT_AUTOMAKE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:9: error: possibly undefined macro: AM_CONFIG_HEADER
configure.ac:38: error: possibly undefined macro: AM_PROG_LIBTOOL

Fix this by running:

$ autoreconf -i