null

OpenIPMI и Compact Sensor Record

Заканчивая заметку о мониторинге IPMI-совместимого оборудования я случайно обнаружил несоответствие имен сенсоров в оборудовании Sun: разные IPMI программы показывали разные имена для одних и тех же сенсоров. Раскопки, проведенные в этой области показали как много значат толково написанные технические спецификации. Список сенсоров можно получить, опросив сервисный процессор при помощи:

* Web GUI сервисного процессора
* CLI сервисного процессора
* SNMP запросов
* ipmitool/FreeIPMI/OpenIPMI инструментария

Т.к. мониторить оборудование я собрирался при помощи IPMI, поэтому опрашивать решил с помощью ipmitool. Для Sun Fire x4240 у меня получился вот такой список:

Sensor Type Description Units Lower Non Recoverable Lower Critical Lower Non Critical Upper Non Critical Upper Critical Upper Non Recoverable
/SYS/VPS Analog Power Unit Watts            
ACPI Discrete System ACPI Power State discrete            
DBP/HDD0/PRSNT Discrete Entity Presence discrete            
DBP/HDD0/STATE Discrete Drive Slot / Bay discrete            
DBP/HDD1/PRSNT Discrete Entity Presence discrete            
DBP/HDD1/STATE Discrete Drive Slot / Bay discrete            
DBP/HDD10/PRSNT Discrete Entity Presence discrete            
DBP/HDD10/STATE Discrete Drive Slot / Bay discrete            
DBP/HDD11/PRSNT Discrete Entity Presence discrete            
DBP/HDD11/STATE Discrete Drive Slot / Bay discrete            
DBP/HDD12/PRSNT Discrete Entity Presence discrete            
DBP/HDD12/STATE Discrete Drive Slot / Bay discrete            
DBP/HDD13/PRSNT Discrete Entity Presence discrete            
DBP/HDD13/STATE Discrete Drive Slot / Bay discrete            
DBP/HDD14/PRSNT Discrete Entity Presence discrete            
DBP/HDD14/STATE Discrete Drive Slot / Bay discrete            
DBP/HDD15/PRSNT Discrete Entity Presence discrete            
DBP/HDD15/STATE Discrete Drive Slot / Bay discrete            
DBP/HDD2/PRSNT Discrete Entity Presence discrete            
DBP/HDD2/STATE Discrete Drive Slot / Bay discrete            
DBP/HDD3/PRSNT Discrete Entity Presence discrete            
DBP/HDD3/STATE Discrete Drive Slot / Bay discrete            
DBP/HDD4/PRSNT Discrete Entity Presence discrete            
DBP/HDD4/STATE Discrete Drive Slot / Bay discrete            
DBP/HDD5/PRSNT Discrete Entity Presence discrete            
DBP/HDD5/STATE Discrete Drive Slot / Bay discrete            
DBP/HDD6/PRSNT Discrete Entity Presence discrete            
DBP/HDD6/STATE Discrete Drive Slot / Bay discrete            
DBP/HDD7/PRSNT Discrete Entity Presence discrete            
DBP/HDD7/STATE Discrete Drive Slot / Bay discrete            
DBP/HDD8/PRSNT Discrete Entity Presence discrete            
DBP/HDD8/STATE Discrete Drive Slot / Bay discrete            
DBP/HDD9/PRSNT Discrete Entity Presence discrete            
DBP/HDD9/STATE Discrete Drive Slot / Bay discrete            
DBP/PRSNT Discrete Entity Presence discrete            
FB0/FM0/F0/TACH Analog Fan RPM 2000.000 2400.000 2800.000      
FB0/FM0/F1/TACH Analog Fan RPM 2000.000 2400.000 2800.000      
FB0/FM0/PRSNT Discrete Entity Presence discrete            
FB0/FM1/F0/TACH Analog Fan RPM 2000.000 2400.000 2800.000      
FB0/FM1/F1/TACH Analog Fan RPM 2000.000 2400.000 2800.000      
FB0/FM1/PRSNT Discrete Entity Presence discrete            
FB0/FM2/F0/TACH Analog Fan RPM 2000.000 2400.000 2800.000      
FB0/FM2/F1/TACH Analog Fan RPM 2000.000 2400.000 2800.000      
FB0/FM2/PRSNT Discrete Entity Presence discrete            
FB0/PRSNT Discrete Entity Presence discrete            
FB1/FM0/F0/TACH Analog Fan RPM 2000.000 2400.000 2800.000      
FB1/FM0/F1/TACH Analog Fan RPM 2000.000 2400.000 2800.000      
FB1/FM0/PRSNT Discrete Entity Presence discrete            
FB1/FM1/F0/TACH Analog Fan RPM 2000.000 2400.000 2800.000      
FB1/FM1/F1/TACH Analog Fan RPM 2000.000 2400.000 2800.000      
FB1/FM1/PRSNT Discrete Entity Presence discrete            
FB1/FM2/F0/TACH Analog Fan RPM 2000.000 2400.000 2800.000      
FB1/FM2/F1/TACH Analog Fan RPM 2000.000 2400.000 2800.000      
FB1/FM2/PRSNT Discrete Entity Presence discrete            
FB1/PRSNT Discrete Entity Presence discrete            
INTSW Discrete Physical Security discrete            
MB/P0/PROCHOT Discrete Processor discrete            
MB/P0/PRSNT Discrete Entity Presence discrete            
MB/P0/T_CORE Analog Temperature degrees C       63.000 68.000 75.000
MB/P0/V_+0V9 Analog Voltage Volts 0.602 0.708 0.802 1.003 1.109 1.204
MB/P0/V_+1V8 Analog Voltage Volts 1.404 1.509 1.603 2.001 2.106 2.200
MB/P0/V_VDDCORE Analog Voltage Volts 0.637 0.720 0.802 1.923 2.030 2.159
MB/P0/V_VDDNB Analog Voltage Volts 0.234 0.299 0.351 1.690 1.898 2.106
MB/P1/PROCHOT Discrete Processor discrete            
MB/P1/PRSNT Discrete Entity Presence discrete            
MB/P1/T_CORE Analog Temperature degrees C       63.000 68.000 75.000
MB/P1/V_+0V9 Analog Voltage Volts 0.602 0.708 0.802 1.003 1.109 1.204
MB/P1/V_+1V8 Analog Voltage Volts 1.404 1.509 1.603 2.001 2.106 2.200
MB/P1/V_VDDCORE Analog Voltage Volts 0.637 0.720 0.802 1.923 2.030 2.159
MB/P1/V_VDDNB Analog Voltage Volts 0.234 0.293 0.351 1.697 1.895 2.106
MB/T_AMB Analog Temperature degrees C       50.000 52.000 55.000
MB/V_+12V Analog Voltage Volts 9.009 10.017 11.025 13.041 14.049 15.057
MB/V_+1V2HT Analog Voltage Volts 0.600 0.800 1.000 1.500 1.700 1.900
MB/V_+1V4 Analog Voltage Volts 1.123 1.193 1.264 1.544 1.615 1.685
MB/V_+1V5 Analog Voltage Volts 0.804 1.009 1.205 1.803 2.009 2.205
MB/V_+3V3 Analog Voltage Volts 2.612 2.803 3.010 3.616 3.806 3.996
MB/V_+3V3STBY Analog Voltage Volts 2.612 2.803 3.010 3.616 3.806 3.996
MB/V_+5V Analog Voltage Volts 3.510 4.004 4.524 5.512 6.006 6.500
MB/V_BAT Analog Voltage Volts 2.200 2.402 2.605 3.401 3.604 3.806
PS0/CUR_FAULT Discrete Power Supply discrete            
PS0/FAN_FAULT Discrete Power Supply discrete            
PS0/IN_POWER Analog Power Unit Watts            
PS0/I_IN Analog Current Amps            
PS0/I_OUT Analog Current Amps            
PS0/OUT_POWER Analog Power Unit Watts            
PS0/PRSNT Discrete Entity Presence discrete            
PS0/PWROK Discrete Power Supply discrete            
PS0/TEMP_FAULT Discrete Power Supply discrete            
PS0/VINOK Discrete Power Supply discrete            
PS0/VOLT_FAULT Discrete Power Supply discrete            
PS0/V_IN Analog Voltage Volts 70.000 80.000 90.000 260.000 270.000 280.000
PS0/V_OUT Analog Voltage Volts 8.000 8.960 10.000 14.000 14.960 16.000
PS1/CUR_FAULT Discrete Power Supply discrete            
PS1/FAN_FAULT Discrete Power Supply discrete            
PS1/IN_POWER Analog Power Unit Watts            
PS1/I_IN Analog Current Amps            
PS1/I_OUT Analog Current Amps            
PS1/OUT_POWER Analog Power Unit Watts            
PS1/PRSNT Discrete Entity Presence discrete            
PS1/PWROK Discrete Power Supply discrete            
PS1/TEMP_FAULT Discrete Power Supply discrete            
PS1/VINOK Discrete Power Supply discrete            
PS1/VOLT_FAULT Discrete Power Supply discrete            
PS1/V_IN Analog Voltage Volts 70.000 80.000 90.000 260.000 270.000 280.000
PS1/V_OUT Analog Voltage Volts 8.000 8.960 10.000 14.000 14.960 16.000
T_AMB Analog Temperature degrees C         45.000 50.000

 

 

Создав на основе этого списка шаблон для Sun Fire x4240 для системы мониторинга Zabbix
(о создании наблонов я также пишу заметку ;-) я увидел, что несколько сенсоров в Web интерфейсе Zabbix поменяли свой статус с "Активен" на "Не поддерживается". Для общения с сервисным процессором Zabbix использует библиотеку OpenIPMI. Поэтому я решил на всякий случай проверить, как выглядят те же самые сенсоры для инструментария OpenIPMI. Оказалось, что имена некоторых дискретных сенсоров заканчиваюся на еденичку, которй нет в выводе ipmitool:

> sensor list
Entity
  Name: x4240(3.0)
  Sensors
    Name: x4240(3.0).MB/P0/PROCHOT
    Name: x4240(3.0).MB/P0/V_VDDNB
    Name: x4240(3.0).MB/P0/V_+1V8
    Name: x4240(3.0).MB/P0/V_+0V9
    Name: x4240(3.0).MB/P0/V_VDDCORE
    Name: x4240(3.0).MB/P0/T_CORE
    Name: x4240(3.0).MB/P0/PRSNT1
Entity
  Name: x4240(3.1)
  Sensors
    Name: x4240(3.1).MB/P1/PROCHOT
    Name: x4240(3.1).MB/P1/V_VDDNB
    Name: x4240(3.1).MB/P1/V_+1V8
    Name: x4240(3.1).MB/P1/V_+0V9
    Name: x4240(3.1).MB/P1/V_VDDCORE
    Name: x4240(3.1).MB/P1/T_CORE
    Name: x4240(3.1).MB/P1/PRSNT1

 

Собрав всю необходимую информацию я написал письмо разработчику OpenIPMI - Corey Minyard. Вот что он мне ответил:

Well, this is certainly a gray area in the spec.  The SDR in question is:

 SDR
  Record ID: 30
  Type: 2
  Version: 1.5
  Data: 0x20 0x00 0x64 0x0a 0x00 0x67 0x40 0x25
        0x08 0x03 0x00 0x00 0x00 0x03 0x00 0xc0
        0x00 0x00 0x01 0x81 0x00 0x00 0x00 0x00
        0x00 0x00 0xc9 0x50 0x53 0x30 0x2f 0x50
        0x52 0x53 0x4e 0x54


Bytes 18 and 19 are the ones in question, these correspond to byte 24 and 25 of the "SDR type 02h Compact Sensor Record".
Since the "share count" is non-zero, OpenIPMI assumes that it is doing sensor sharing and numbers them as specified
in the spec and the other bits in those bytes.  Thus it appends the "1".

You can "fix" this problem by changing lib/sensor.c, line 1441 from:
  if (share_count) {
to
  if (share_count > 1) {

Any opinions on this from anyone else?  IMHO, this is a poor design in the spec, and it's silly for anyone to put a "1" in this share count field.

Также это письмо ушло в списки рассылки разработчиков ipmitool и FreeIPMI, от которых я тоже получил ответ:

> Any opinions on this from anyone else?  IMHO, this is a poor design in
> the spec, and it's silly for anyone to put a "1" in this share count field.

I concur that it's silly.  I have this recollection that I too
implemented "share_count != 0", then later changed it to "share_count > 1"
in FreeIPMI when I saw that's how it was implemented in motherboards.

Документация Intelligent Platform Management Interface Specification от Intel в разделе 43.1 SDR Type 01h, Full Sensor Record сообщает нам:

The Full Sensor Record can be used to describe any type of sensor. The Compact sensor record saves space, but has limitations in the sensors it can describe. The Full record is defined as a 64-byte record, while the Compact record is defined as 48-bytes.

а в разделе 43.2 SDR Type 02h, Compact Sensor Record описан способ хранения таких записей:

Byte 2:
Entity Instance Sharing
[7] - 0b = Entity Instance same for all shared records
1b = Entity Instance increments for each shared record
[6:0] - ID String Instance Modifier Offset
Multiple Discrete sensors can share the same sensor data record. The ID
String Instance Modifier and Modifier Offset are used to modify the Sensor ID
String as follows:
Suppose sensor ID is “Temp ” for ‘Temperature Sensor’, share count = 3, ID
string instance modifier = numeric, instance modifier offset = 5 - then the
sensors could be identified as:
Temp 5, Temp 6, Temp 7
If the modifier = alpha, offset=0 corresponds to ‘A’, offset=25 corresponds to
‘Z’, and offset = 26 corresponds to ‘AA’, thus, for offset=26 the sensors could
be identified as:
Temp AA, Temp AB, Temp AC
(alpha characters are considered to be base 26 for ASCII)

Откуда и получается расхождение. Пишите простые и однозначные спецификации!

Применив предложенный автором патч я решил проблему. Также я зарегистрировал PR 147287 для добавления патча в коллекцию портов FreeBSD.

Не делайте из еды культа!

Очень люблю готовить и вкусно покушать. А чтобы времени на эти увлекательные занятия оставалось как можно больше, я стараюсь автоматизировать любые задачи, которые оказываются в поле моей профессиональной деятельности.
В своем скромном дневнике я буду делиться с Вами рецептами блюд, которые удаются мне особенно хорошо

Ничего не найдено. n is 0