Eu gostaria de usar ipmitool
para obter o número de série da placa. No momento, posso usar $ sudo ipmitool fru
para consultar as informações abaixo:
$ sudo ipmitool fru
FRU Device Description : Builtin FRU Device (ID 0)
Chassis Type : Main Server Chassis
Chassis Part Number : 01234567
Chassis Serial : 01234567890123456789AB
Board Mfg Date : Wed Jan 7 13:07:00 2015
Board Mfg : GIGABYTE
Board Product : MB10-DS4
Board Serial : GG3P8800012
Board Part Number : 01234567
Product Manufacturer : GIGABYTE
Product Name : MB10-DS4
Product Part Number : 000000000001
Product Version : 0100
Product Serial : 01234567890123456789AB
Product Asset Tag : 01234567890123456789AB
Como no meu projeto, preciso usar a API OpenIPMI no código C para obter a placa serial, acho que deve ser exclusivo. Então, eu uso o comando raw:
$ sudo ipmitool raw
Not enough parameters given.
RAW Commands: raw <netfn> <cmd> [data]
Network Function Codes:
VAL HEX STRING
==============================================
0 0x00 Chassis
2 0x02 Bridge
4 0x04 SensorEvent
6 0x06 Application
8 0x08 Firmware
10 0x0a Storage
12 0x0c Transport
(can also use raw hex values)
Em seguida, tente emitir o seguinte comando para saber mais sobre o formato de comando bruto
$ sudo ipmitool raw 0 0
01 20 20 20 20 20
$ sudo ipmitool raw 0 1
21 00 00 70
$ sudo ipmitool raw 0 2
Unable to send RAW command (channel=0x0 netfn=0x0 lun=0x0 cmd=0x2 rsp=0xc7):
Request data length invalid
Eu pesquisei por vários dias, mas não consegui encontrar nenhuma informação, e baixei o código-fonte do ipmitool, talvez eu tente ler o código-fonte com mais clareza.
BTW, baixei o utilitário IPMI 'IPMICFG' do SuperMicro, e siga o guia Configuração do dispositivo Supermicro IPMI usando IPMICFG e leia Uma introdução suave com o OpenIPMI .
Minha pergunta é, qual é o netfn
do código que devo usar e qual é o comando para obter a placa serial, neste caso, o valor deve ser GG3P8800012
.
Algum conselho?
Obrigado antecipadamente.
Obrigado @Lenniey
Aqui está a saída de sudo ipmitool fru -vvv
:
$ sudo ipmitool fru -vvv
Using ipmi device 0
Set IPMB address to 0x20
OpenIPMI Request Message Header:
netfn = 0x6
cmd = 0x1
Iana: 15370
Running Get PICMG Properties my_addr 0x20, transit 0, target 0
OpenIPMI Request Message Header:
netfn = 0x2c
cmd = 0x0
OpenIPMI Request Message Data (1 bytes)
00
Error response 0xc1 from Get PICMG Properities
Running Get VSO Capabilities my_addr 0x20, transit 0, target 0
OpenIPMI Request Message Header:
netfn = 0x2c
cmd = 0x0
OpenIPMI Request Message Data (1 bytes)
03
Invalid completion code received: Invalid command
Acquire IPMB address
Discovered IPMB address 0x0
Interface address: my_addr 0x20 transit 0:0 target 0x20:0 ipmb_target 0
FRU Device Description : Builtin FRU Device (ID 0)
OpenIPMI Request Message Header:
netfn = 0x6
cmd = 0x1
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x10
OpenIPMI Request Message Data (1 bytes)
00
fru.size = 2048 bytes (accessed by bytes)
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 00 00 08
FRU DATA (9 bytes)
08 01 00 01 07 0e 00 00 e9
fru.header.version: 0x1
fru.header.offset.internal: 0x0
fru.header.offset.chassis: 0x8
fru.header.offset.board: 0x38
fru.header.offset.product: 0x70
fru.header.offset.multi: 0x0
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 08 00 02
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 08 00 21
Retrying FRU read with request size 25
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 08 00 19
Retrying FRU read with request size 24
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 08 00 18
Retrying FRU read with request size 23
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 08 00 17
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 1f 00 17
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 36 00 02
Chassis Type : Main Server Chassis
Chassis Part Number : 01234567
Chassis Serial : 01234567890123456789AB
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 38 00 02
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 38 00 17
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 4f 00 17
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 66 00 0a
Board Mfg Date : Wed Jan 7 13:07:00 2015
Board Mfg : GIGABYTE
Board Product : MB10-DS4
Board Serial : GG3P8800012
Board Part Number : 01234567
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 70 00 02
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 70 00 17
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 87 00 17
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 9e 00 17
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 b5 00 17
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x11
OpenIPMI Request Message Data (4 bytes)
00 cc 00 04
Product Manufacturer : GIGABYTE
Product Name : MB10-DS4
Product Part Number : 000000000001
Product Version : 0100
Product Serial : 01234567890123456789AB
Product Asset Tag : 01234567890123456789AB
OpenIPMI Request Message Header:
netfn = 0x6
cmd = 0x1
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x20
SDR free space: 14864
SDR records : 25
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x22
SDR reservation ID 0002
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 00 00 00 05
SDR record ID : 0x0000
SDR record id mismatch: 0x0001
SDR record type : 0x12
SDR record next : 0x0002
SDR record bytes: 16
Getting 16 bytes from SDR at offset 5
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 00 00 05 10
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 02 00 00 05
SDR record ID : 0x0002
SDR record type : 0xc0
SDR record next : 0x0003
SDR record bytes: 11
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 03 00 00 05
SDR record ID : 0x0003
SDR record type : 0x01
SDR record next : 0x0009
SDR record bytes: 52
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 09 00 00 05
SDR record ID : 0x0009
SDR record type : 0x01
SDR record next : 0x000a
SDR record bytes: 53
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 0a 00 00 05
SDR record ID : 0x000a
SDR record type : 0x01
SDR record next : 0x000c
SDR record bytes: 53
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 0c 00 00 05
SDR record ID : 0x000c
SDR record type : 0x01
SDR record next : 0x000d
SDR record bytes: 53
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 0d 00 00 05
SDR record ID : 0x000d
SDR record type : 0x01
SDR record next : 0x003b
SDR record bytes: 53
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 3b 00 00 05
SDR record ID : 0x003b
SDR record type : 0x01
SDR record next : 0x003c
SDR record bytes: 47
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 3c 00 00 05
SDR record ID : 0x003c
SDR record type : 0x01
SDR record next : 0x003d
SDR record bytes: 46
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 3d 00 00 05
SDR record ID : 0x003d
SDR record type : 0x01
SDR record next : 0x003e
SDR record bytes: 47
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 3e 00 00 05
SDR record ID : 0x003e
SDR record type : 0x01
SDR record next : 0x0040
SDR record bytes: 51
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 40 00 00 05
SDR record ID : 0x0040
SDR record type : 0x01
SDR record next : 0x0041
SDR record bytes: 49
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 41 00 00 05
SDR record ID : 0x0041
SDR record type : 0x01
SDR record next : 0x0043
SDR record bytes: 53
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 43 00 00 05
SDR record ID : 0x0043
SDR record type : 0x01
SDR record next : 0x0047
SDR record bytes: 52
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 47 00 00 05
SDR record ID : 0x0047
SDR record type : 0x01
SDR record next : 0x0048
SDR record bytes: 53
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 48 00 00 05
SDR record ID : 0x0048
SDR record type : 0x01
SDR record next : 0x0049
SDR record bytes: 52
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 49 00 00 05
SDR record ID : 0x0049
SDR record type : 0x01
SDR record next : 0x004a
SDR record bytes: 57
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 4a 00 00 05
SDR record ID : 0x004a
SDR record type : 0x01
SDR record next : 0x0088
SDR record bytes: 56
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 88 00 00 05
SDR record ID : 0x0088
SDR record type : 0x01
SDR record next : 0x008a
SDR record bytes: 51
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 8a 00 00 05
SDR record ID : 0x008a
SDR record type : 0x01
SDR record next : 0x00b9
SDR record bytes: 51
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 b9 00 00 05
SDR record ID : 0x00b9
SDR record type : 0x02
SDR record next : 0x00ba
SDR record bytes: 31
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 ba 00 00 05
SDR record ID : 0x00ba
SDR record type : 0x02
SDR record next : 0x00bd
SDR record bytes: 31
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 bd 00 00 05
SDR record ID : 0x00bd
SDR record type : 0x02
SDR record next : 0x00ca
SDR record bytes: 36
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 ca 00 00 05
SDR record ID : 0x00ca
SDR record type : 0x01
SDR record next : 0x00cd
SDR record bytes: 51
OpenIPMI Request Message Header:
netfn = 0xa
cmd = 0x23
OpenIPMI Request Message Data (6 bytes)
02 00 cd 00 00 05
SDR record ID : 0x00cd
SDR record type : 0x02
SDR record next : 0xffff
SDR record bytes: 30
Siga o conselho de @Lenniey, eu envio o seguinte comando:
$ sudo ipmitool -v raw 0xa 0x11
Running Get PICMG Properties my_addr 0x20, transit 0, target 0
Error response 0xc1 from Get PICMG Properities
Running Get VSO Capabilities my_addr 0x20, transit 0, target 0
Invalid completion code received: Invalid command
Discovered IPMB address 0x0
RAW REQ (channel=0x0 netfn=0xa lun=0x0 cmd=0x11 data_len=0)
Unable to send RAW command (channel=0x0 netfn=0xa lun=0x0 cmd=0x11 rsp=0xc7):
Request data length invalid
Aqui levanta outra questão: Como obter dicas de comandos brutos da saída de sudo ipmitool fru -vvv
?
Tags ipmitool