HPE CRAY 자료 공유

ipmitool 사용법 정리 본문

Applications/LINUX

ipmitool 사용법 정리

CRAY KOREA Blog 2023. 11. 14. 15:23

 

ipmitool 
No command provided!
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. ipmitool lan

ipmitool lan
LAN Commands:
   print [<channel number>]
   set <channel number> <command> <parameter>
   alert print <channel number> <alert destination>
   alert set <channel number> <alert destination> <command> <parameter>
   stats get [<channel number>]
   stats clear [<channel number>]

 

ipmitool lan print 1
Set in Progress         : Set Complete
Auth Type Support       : MD5 
Auth Type Enable        : Callback : MD5 
                        : User     : MD5 
                        : Operator : MD5 
                        : Admin    : MD5 
                        : OEM      : 
IP Address Source       : Static Address
IP Address              : 192.168.0.120
Subnet Mask             : 255.255.255.0
MAC Address             : xx:xx:xx:xx:xx:xx
SNMP Community String   : public
IP Header               : TTL=0x40 Flags=0x40 Precedence=0x00 TOS=0x10
BMC ARP Control         : ARP Responses Enabled, Gratuitous ARP Disabled
Gratituous ARP Intrvl   : 2.0 seconds
Default Gateway IP      : 192.168.0.1
Default Gateway MAC     : 00:00:00:00:00:00
Backup Gateway IP       : 0.0.0.0
Backup Gateway MAC      : 00:00:00:00:00:00
802.1q VLAN ID          : Disabled
802.1q VLAN Priority    : 0
RMCP+ Cipher Suites     : 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
Cipher Suite Priv Max   : Xaaaaaaaaaaaaaa
                        :     X=Cipher Suite Unused
                        :     c=CALLBACK
                        :     u=USER
                        :     o=OPERATOR
                        :     a=ADMIN
                        :     O=OEM
Bad Password Threshold  : Not Available

 

BMC lan 설정 예제

 # ipmitool lan  set 1 ipsrc static        
 # ipmitool lan set 1 ipaddr 192.168.15.2  
   Setting LAN IP Address to 192.168.15.2  
 # ipmitool lan set 1 netmask 255.255.255.0
   Setting LAN Subnet Mask to 255.255.255.0
# IP 고정값 사용 
# IP 부여
# IP 설정 결과 출력
# netmask 설정
# netmask 설정 결과 출력

 

2. ipmitool power

 # ipmitool power 
chassis power Commands: status, on, off, cycle, reset, diag, soft

 

- 자주 사용하는 power 명령

명령 설명 비고
 # ipmitool power reset 시스템 재시작 재시작 버튼을 누르는 효과
 # ipmitool power off 시스템 off 전원 버튼을 눌러서 끄는 효과
 # ipmitool power on 시스템 on 전원 버튼을 눌러서 켜는 효과
 # ipmitool power status 시스템 전원 상태 확인  

 

3. ipmitool mc

ipmitool mc
Not enough parameters given.
MC 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
  getsysinfo <argument>
  setsysinfo <argument> <string>
    system_fw_version   System firmware (e.g. BIOS) version
    primary_os_name     Primary operating system name
    os_name             Operating system name
    system_name         System Name of server(vendor dependent)
    delloem_os_version  Running version of operating system
    delloem_url         URL of BMC webserver

 

- BMC reset

ipmitool mc reset cold

※ 시스템 전원을 재시작 하는것이 아닙니다.

 

4. ipmitool sel

# ipmitool sel
SEL Information
Version          : 1.5 (v1.5, v2 compliant)
Entries          : 9
Free Space       : 16240 bytes 
Percent Used     : 0%
Last Add Time    : 07/13/2021 02:27:54
Last Del Time    : 08/04/2016 00:14:24
Overflow         : false
Supported Cmds   : 'Reserve'

※ BIOS에서 sel buffer 자동 삭제 옵션을 선택하지 않고, sel buffer 가 100% 인 경우(예. Percent Used : 100%)에 log 기록이 되지 않습니다. 수동으로 clear 시켜 주어야 합니다.

 

- BMC sel buffer 삭제

# ipmitool sel clear

 

- BMC 시간 확인 및 설정

명령 설명 비고
 # ipmitool sel time get BMC 시간 확인  
 # ipmitool sel time set now 현재 시스템 시간으로 BMC 시간 설정  

 

- ipmitool sel list

ipmitool sel list
   1 | 08/04/2016 | 00:14:24 | Event Logging Disabled #0x72 | Log area reset/cleared | Asserted
   2 | 07/12/2021 | 05:58:44 | Temperature #0x04 | Upper Non-critical going high | Asserted
   3 | 07/12/2021 | 06:19:59 | Temperature #0x04 | Upper Non-critical going high | Deasserted
   4 | 07/12/2021 | 06:38:28 | Temperature #0x04 | Upper Non-critical going high | Asserted
   5 | 07/12/2021 | 06:59:06 | Temperature #0x04 | Upper Non-critical going high | Deasserted
   6 | 07/12/2021 | 07:05:53 | Temperature #0x04 | Upper Non-critical going high | Asserted
   7 | 07/12/2021 | 07:33:16 | Temperature #0x04 | Upper Non-critical going high | Deasserted
   8 | 07/13/2021 | 01:23:43 | Temperature #0x04 | Upper Non-critical going high | Asserted
   9 | 07/13/2021 | 02:27:54 | Temperature #0x04 | Upper Non-critical going high | Deasserted

 

- ipmitool sel elist

ipmitool sel elist
   1 | 08/04/2016 | 00:14:24 | Event Logging Disabled SEL | Log area reset/cleared | Asserted
   2 | 07/12/2021 | 05:58:44 | Temperature Inlet Temp | Upper Non-critical going high | Asserted | Reading 42 > Threshold 42 degrees C
   3 | 07/12/2021 | 06:19:59 | Temperature Inlet Temp | Upper Non-critical going high | Deasserted | Reading 39 > Threshold 42 degrees C
   4 | 07/12/2021 | 06:38:28 | Temperature Inlet Temp | Upper Non-critical going high | Asserted | Reading 42 > Threshold 42 degrees C
   5 | 07/12/2021 | 06:59:06 | Temperature Inlet Temp | Upper Non-critical going high | Deasserted | Reading 39 > Threshold 42 degrees C
   6 | 07/12/2021 | 07:05:53 | Temperature Inlet Temp | Upper Non-critical going high | Asserted | Reading 42 > Threshold 42 degrees C
   7 | 07/12/2021 | 07:33:16 | Temperature Inlet Temp | Upper Non-critical going high | Deasserted | Reading 39 > Threshold 42 degrees C
   8 | 07/13/2021 | 01:23:43 | Temperature Inlet Temp | Upper Non-critical going high | Asserted | Reading 42 > Threshold 42 degrees C
   9 | 07/13/2021 | 02:27:54 | Temperature Inlet Temp | Upper Non-critical going high | Deasserted | Reading 39 > Threshold 42 degrees C

 

- sel log 확인

ipmitool sel get 0x9
SEL Record ID          : 0009
 Record Type           : 02
 Timestamp             : 07/13/2021 02:27:54
 Generator ID          : 0020
 EvM Revision          : 04
 Sensor Type           : Temperature
 Sensor Number         : 04
 Event Type            : Threshold
 Event Direction       : Deassertion Event
 Event Data (RAW)      : 57a7aa
 Trigger Reading       : 39.000degrees C
 Trigger Threshold     : 42.000degrees C
 Description           : Upper Non-critical going high

Sensor ID              : Inlet Temp (0x4)
 Entity ID             : 7.1
 Sensor Type (Threshold)  : Temperature
 Sensor Reading        : 17 (+/- 1) degrees C
 Status                : ok
 Lower Non-Recoverable : na
 Lower Critical        : -7.000
 Lower Non-Critical    : 3.000
 Upper Non-Critical    : 42.000
 Upper Critical        : 47.000
 Upper Non-Recoverable : na
 Positive Hysteresis   : 2.000
 Negative Hysteresis   : 2.000
 Assertion Events      : 
 Assertions Enabled    : lnc- lcr- unc+ ucr+ 
 Deassertions Enabled  : lnc- lcr- unc+ ucr+ 

FRU Device Description : OEM fru (ID 17)

 

5. ipmitool sol

ipmitool sol
SOL Commands: info [<channel number>]
              set <parameter> <value> [channel] [noguard]
              payload <enable|disable|status> [channel] [userid]
              activate [<usesolkeepalive|nokeepalive>] [instance=<number>]
              deactivate [instance=<number>]
              looptest [<loop times> [<loop interval(in ms)> [<instance>]]]

※ sol 설정이 되어 있지 않은경우 sol 또는 conman 을 이용할 수 없습니다.

 

6. ipmitool user 

ipmitool user 
Not enough parameters given.
User Commands:
               summary      [<channel number>]
               list         [<channel number>]
               set name     <user id> <username>
               set password <user id> [<password> <16|20>]
               disable      <user id>
               enable       <user id>
               priv         <user id> <privilege level> [<channel number>]
                     Privilege levels:
                      * 0x1 - Callback
                      * 0x2 - User
                      * 0x3 - Operator
                      * 0x4 - Administrator
                      * 0x5 - OEM Proprietary
                      * 0xF - No Access

               test         <user id> <16|20> [<password]>

 

- user list 확인

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

 

7. ipmitool channel

 # ipmitool channel
 Not enough parameters given.
 Channel Commands: authcap   <channel number> <max privilege>
                   getaccess <channel number> [user id]
                   setaccess <channel number> <user id> [callin=on|off] [ipmi=on|off] [link=on|off] [privilege=level]
                   info      [channel number]
                   getciphers <ipmi | sol> [channel]
 
                   setkg hex|plain <key> [channel]
 
 Possible privilege levels are:
    1   Callback level
    2   User level
    3   Operator level
    4   Administrator level
    5   OEM Proprietary level
   15   No access

 

8. BMC 신규 사용자 추가 및 권한 부여 예제

 # 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

 # ipmitool user set name 3 admin    #비어 있는 3번 ID에 admin 사용자 추가
 # ipmitool user list 1                      #3번 ID로 추가된 admin 사용자 확인
 ID  Name      Callin  Link Auth IPMI Msg   Channel Priv Limit
 1                    true    false      false      NO ACCESS
 2   root             true    true       true       ADMINISTRATOR
 3   admin            true    false      false      NO ACCESS
 # ipmitool user set password 3 {비밀번호}  #admin의 비밀번호 설정
 Set User Password command successful (user 3)
 # ipmitool user enable 3                        #admin 사용자 활성화
 # ipmitool user priv 3 0x4 1                   #admin 사용자를 ADMINISTRATOR 권한 설정
 Set Privilege Level command successful (user 3)
 # 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   admin            true    false      false      ADMINISTRATOR
 # ipmitool sol payload status 1 3          #admin 사용자의 payload 상태 확인
 User 3 on channel 1 is disabled
 # ipmitool sol payload enable 1 3         #admin 사용자 payload 활성화
 # ipmitool sol payload status 1 3          #admin 사용자의 payload 상태 재 확인
 User 3 on channel 1 is enabled
 # ipmitool channel getaccess 1 3          #admin 사용자의 접속 권한 확인
 Maximum User IDs     : 16
 Enabled User IDs     : 2
 
 User ID              : 3
 User Name            : admin
 Fixed Name           : No
 Access Available     : call-in / callback
 Link Authentication  : disabled
 IPMI Messaging       : disabled
 Privilege Level      : ADMINISTRATOR
 Enable Status        : enabled
 # ipmitool channel setaccess 1 3 callin=on ipmi=on link=on privilege=4    #admin 사용자에게 권한 부여
 Set User Access (channel 1 id 3) successful.
 # ipmitool channel getaccess 1 3                       #admin 사용자 변경된 접속 권한 확인
 Maximum User IDs     : 16
 Enabled User IDs     : 2
 
 User ID              : 3
 User Name            : admin
 Fixed Name           : No
 Access Available     : call-in / callback
 Link Authentication  : enabled
 IPMI Messaging       : enabled
 Privilege Level      : ADMINISTRATOR
 Enable Status        : enabled

 # ipmitool user list 1                           #user 목록에서 admin 사용자 권한 재 확인
 ID  Name      Callin  Link Auth IPMI Msg   Channel Priv Limit
 1                    true    false      false      NO ACCESS
 2   root             true    true       true       ADMINISTRATOR
 3   admin            true    true       true       ADMINISTRATOR

 

9. ipmitool fru

 

 # ipmitool fru
 FRU Device Description : Builtin FRU Device (ID 0)
  Board Mfg Date        : Fri May 22 03:47:00 2015
  Board Mfg             : DELL
  Board Product         : PowerEdge R730                
  Board Serial          : CN7016355K00JY
  Board Part Number     : 0H21J3A09
  Product Manufacturer  : DELL
  Product Name          : localhost
  Product Version       : 01
  Product Serial        : HSC7052
 
 FRU Device Description : PS1 (ID 1)
  Board Mfg Date        : Wed May 13 20:03:00 2015
  Board Mfg             : DELL
  Board Product         : PWR SPLY,750W,RDNT,DELTA      
  Board Serial          : CN1797255A43QS
  Board Part Number     : 0G6W6KA00
 
 FRU Device Description : PS2 (ID 2)
  Board Mfg Date        : Wed May 13 16:44:00 2015
  Board Mfg             : DELL
  Board Product         : PWR SPLY,750W,RDNT,DELTA      
  Board Serial          : CN1797255A445P
  Board Part Number     : 0G6W6KA00
 
 FRU Device Description : BP0 (ID 12)
  Device not present (Timeout)
 
 FRU Device Description : BP1 (ID 13)
  Board Mfg Date        : Thu Jun  4 04:58:00 2015
  Board Mfg             : DELL
  Board Product         : DRIVE BACKPLANE               
  Board Serial          : CN77921561013P
  Board Part Number     : 0DMC25A01
 
 FRU Device Description : BP2 (ID 14)
  Device not present (Timeout)
 
 FRU Device Description : BP3 (ID 15)
  Device not present (Timeout)
 
 FRU Device Description : NDC (ID 4)
  Board Mfg Date        : Tue Mar  3 21:00:00 2015
  Board Mfg             : DELL
  Board Product         : Intel(R) 2P X540/2P I350 rNDC 
  Board Serial          : MY1240253601UF
  Board Part Number     : 099GTMA00
 
 FRU Device Description : PERC1 (ID 10)
  Board Mfg Date        : Sat May  9 00:37:00 2015
  Board Mfg             : DELL
  Board Product         : Dell Storage Cntlr. H730 -Mini
  Board Serial          : CN77921555005G
  Board Part Number     : 0KMCCDA01
 
 FRU Device Description : NTB (ID 16)
  Device not present (Timeout)
 
 FRU Device Description : OEM fru (ID 17)

 

- Power part만 확인 하는 경우

 # ipmitool fru list | grep -A4 -i Pwr
  Board Product         : PWR SPLY,750W,RDNT,DELTA      
  Board Serial          : CN1797255A43QS
  Board Part Number     : 0G6W6KA00
 
 FRU Device Description : PS2 (ID 2)
 --
  Board Product         : PWR SPLY,750W,RDNT,DELTA      
  Board Serial          : CN1797255A445P
  Board Part Number     : 0G6W6KA00
 
 FRU Device Description : BP0 (ID 12)

 

10. ipmitool chassis

- ipmitool chassis bootdev

 # ipmitool chassis bootdev
 bootdev <device> [clear-cmos=yes|no]
 bootdev <device> [options=help,...]
   none  : Do not change boot device order
   pxe   : Force PXE boot
   disk  : Force boot from default Hard-drive
   safe  : Force boot from default Hard-drive, request Safe Mode
   diag  : Force boot from Diagnostic Partition
   cdrom : Force boot from CD/DVD
   bios  : Force boot into BIOS Setup
   floppy: Force boot from Floppy/primary removable media

- ipmitool chassis bootparam

 # ipmitool chassis bootparam
 bootparam get <param #>
 bootparam set bootflag <device> [options=...]
  Legal devices are:
   none        : No override
   force_pxe   : Force PXE boot
   force_disk  : Force boot from default Hard-drive
   force_safe  : Force boot from default Hard-drive, request Safe Mode
   force_diag  : Force boot from Diagnostic Partition
   force_cdrom : Force boot from CD/DVD
   force_bios  : Force boot into BIOS Setup
  Legal options are:
   help    : print this message
   PEF     : Clear valid bit on reset/power cycle cause by PEF
   timeout : Automatically clear boot flag valid bit on timeout
   watchdog: Clear valid bit on reset/power cycle cause by watchdog
   reset   : Clear valid bit on push button reset/soft reset
   power   : Clear valid bit on power up via power push button or wake event
  Any Option may be prepended with no- to invert sense of operation

 

11. 기타

- 원격 시스템의 BMC 정보를 확인하는 방법

# ipmitool -I lanplus -H 192.168.15.5 -U admin -P {비밀번호} sel list

-I(대문자 아이) {interface}

-H {BMC hostname 또는 BMC IP}

-U {user list에 등록된 사용자}

-P {사용자의 비밀번호} 

 

 

- 참고 : https://www.ibm.com/docs/ko/power9?topic=ipmi-overview

          https://github.com/ipmitool/ipmitool

'Applications > LINUX' 카테고리의 다른 글

[LINUX] nmcli 명령 모음  (0) 2023.11.14
[Build] Environment Modules 5.2.0  (0) 2023.11.14
자주 사용하는 Linux 명령어 모음  (0) 2023.11.14
[MLDE] MLDE conda  (0) 2023.03.07
[보안팁] 계정이 존재하지 않는 GID 금지  (0) 2023.03.06