安装ipmi软件工具

ipmi

IPMI(Intelligent Platform Management Interface)
Step 0:簡介
Step 1:檢查你的系統是否有提供 IPMI

Step 2.安裝 ipmi
Step 3.檢查 ipmi 服務是否啟動
Step 4: ipmi所需模組
Step 5: ipmi的使用
Step 6: ipmi的相關聯結

Step 0:簡介
IPMI(Intelligent Platform Management Interface) 是一種可擴展的標準,它定義了如何監控硬體和感測器,控制系統部件以及記錄重大事件,隨著 ipmi技術在伺服器中的應用,利用 ipmi 的眾多優勢就成為伺服器管理特別是集群管理中不可缺少的部分.而利用 ipmitool 可以實現 Linux 系統下對伺服器的 ipmi 管理.

再開始使用前我們先針對 IPMI 常會聽到的 I²C,smbus,ipmi,BMC 這幾個名詞.一一說明.

  • I²C / smbus

    不管是 I²C bus (Inter-Integrated Circuit,讀法為 "I-squared-C")還是 SMBus(System Management Bus) 他們是一種慢速 serial bus 的協定,主要透過兩條線路的匯流排與電腦上的控制晶片(Micro Controller)做溝通.,最早推出的是由飛利浦公司主導的 I²C 主要也是為了連接低速週邊裝置. 而 SMBus 是由 Intel 參考了 I²C 主要是為了系統上較慢速的裝置與電源管理裝置之間的溝通. 透過這套系統可以獲得這些裝置的設備資訊如型號或是狀態等資訊. 通常而言會將SMBus 視為 I²C 的子集,也因此 I²C / smbus 在某個程度上是相容的.目前 Linux 核心同時支援 I²C / smbus,在核心編譯的 Device Drivers 就可以找到   I²C / smbus .

  • ipmi,BMC

    IPMI(Intelligent Platform Management Interface) 是一種可擴展的標準技術協定, 它定義了如何監控硬體和感測器,控制系統部件以及記錄重大事件, 而 BMC 是基於 ipmi spec 所做出來的 controller, 隨著 ipmi技術在伺服器中的應用,利用 ipmi 的眾多優勢就成為伺服器管理特別是集群管理中不可缺少的部分.
    IPMItool 的官方網站 http://ipmitool.sourceforge.net/

  • ipmitool,LM_Sensor

    而利用 ipmitool 可以實現 Linux 系統下對伺服器的 ipmi 管理.主要的監控管理方式還是透過 I²C / smbus ,不過不是每台電腦上都有配備 BMC 所以在沒有 BMC 時 Linux 底下還是可以透過另外一種方式 LM_Sensor 來針對 I²C / smbus 裝置來做較簡易的監控. 不過 BMC 是獨立於作業系統以外的一套機制,他不需要開啟作業系統才能做事.只要系統有電源時就可以針對他開始做監管的動作.
    LM Sensors 的官方網站 http://www2.lm-sensors.nu/~lm78/index.html

Step 1:檢查你的系統是否有提供 IPMI
我們無法透過 #lspci 來查詢系統是不是有 BMC 的裝置,只能使用 #dmidecode 如果在 type 38 看到 IPMI DEVICE INFORMATION , 就表示系統有 BMC 存在.

[root@benjr ~]# rpm -aq | grep -i ipmi
OpenIPMI-libs-1.4.14-1.4E.12
OpenIPMI-tools-1.4.14-1.4E.12
OpenIPMI-devel-1.4.14-1.4E.12
OpenIPMI-1.4.14-1.4E.12

除了硬體外還需要軟體的支援,這邊使用的是 RedHat Enterprise 4 系統預設就有安裝 ipmi,請直接到 step 3.如果你的系統沒有安裝可以到他官方網站來安裝 IPMItool.
http://ipmitool.sourceforge.net/

Step 2.安裝 ipmi

基本上 ipmitool.sourceforge.net 提供了 .rpm 和 .tar 檔.可以依你的喜歡來安裝.

  • rpm 檔
    [root@benjr ~]#rpm ipmitool-<VER>.<PLATFORM>.rpm
  • tar 檔
    [root@benjr ~]# tar xzvf ipmitool-<VER>.tar.gz
    [root@benjr ~]# cd ipmitool-<VER>
    [root@benjr ~]# ./configure -enable-inft-open=static
    [root@benjr ~]# make
    [root@benjr ~]# make install

    我們還要創建字元設備,使 ipmitool 可以通過驅動程式連結至 ipmi 系統介面

    [root@benjr ~]# cat /proc/devices | grep ipmidev
    254 ipmidev
    [root@benjr ~]# mknod /dev/ipmi0 c 254 0

    note:
    Type: "c" 是 character device(unbuffered)
    MAJOR number是根據剛剛查到的254

Step 3.檢查 ipmi 服務是否啟動

[root@benjr ~]# service ipmi status
ipmi_msghandler module loaded.
ipmi_si module loaded.
ipmi_devintf module loaded.
/dev/ipmi0 exists.

這樣子代表有正式啟動,如果沒有請鍵入下面指令.

[root@benjr ~]#service ipmi start
Starting ipmi drivers: [  OK  ]

如果要讓每次開機時都能啟動 ipmi,請鍵入下面指令.

[root@benjr ~]# chkconfig ipmi on

Step 4: ipmi所需模組
這邊我使用的是 RedHat Enterprise 4(kernel 2.6),可以看到和ipmi相關的模組,但如果使用的是 kernel 2.4 所需的模組又不同了.

[root@benjr ~]#lsmod
Module                  Size  Used by
ipmi_devintf           13129  0
ipmi_si                36585  0
ipmi_msghandler        31913  2 ipmi_devintf,ipmi_si

2.6-based kernel 的 ipmitool 需要下面這些模組才能正確運作. 

  • ipmi_msghandler

    Incoming and outgoing message handler for IPMI interfaces.

  • ipmi_si

    An IPMI system interface driver for the message handler. This module supports various IPMI system interfaces such as KCS, BT, SMIC, and even SMBus in 2.6 kernels.

  • ipmi_devintf

    Linux character device interface for the message handler.

2.4-based kernel 的 ipmitool 需要下面這些模組才能正確運作. 

  • ipmi_msghandler

    Incoming and outgoing message handler for IPMI interfaces.

  • ipmi_kcs_drv

    An IPMI Keyboard Controler Style (KCS) interface driver for the message handler.

  • ipmi_devintf

    Linux character device interface for the message handler.

其他選用的模組

  • ipmi_smb 

    A driver for accessing BMCs on the SMBus. It uses the I2C kernel driver's SMBus interfaces to send and receive IPMI messages over the SMBus.

  • ipmi_watchdog

    IPMI requires systems to have a very capable watchdog timer.  This driver implements the standard Linux watchdog timer interface on top of the IPMI message handler.

  • ipmi_poweroff

    Some systems support the ability to be turned off via IPMI commands.


Step 5: ipmi的使用

直接使用 ipmitool 來查看有什麼可以作為查詢的,下面是一般 ipmitool 所提供的系統上相關資訊.

[root@benjr ~]# ipmitool
Commands:
        raw           Send a RAW IPMI request and print response
        i2c           Send an I2C Master Write-Read command and print response
        lan           Configure LAN Channels
        chassis       Get chassis status and set power state
        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
        sel           Print System Event Log (SEL)
        pef           Configure Platform Event Filtering (PEF)
        sol           Configure IPMIv2.0 Serial-over-LAN
        isol          Configure IPMIv1.5 Serial-over-LAN
        user          Configure Management Controller users
        channel       Configure Management Controller channels
        session       Print session information
        sunoem        OEM Commands for Sun servers
        exec          Run list of commands from file
        set           Set runtime variable for shell and exec

我們可以使用 #ipmitool -l open sdr 直接看整個所有的 sensor 的資訊.sdr(Sensor Data Repository) 或是指令 #ipmitool sdr elist

[root@benjr ~]# ipmitool -I open sdr
SYS FAN 1        | 4850 RPM          | ok
SYS FAN 2        | 5000 RPM          | ok
SYS FAN 3        | 4500 RPM          | ok
SYS FAN 4        | 4350 RPM          | ok
SYS FAN 5        | 5150 RPM          | ok
SYS FAN 6        | 4750 RPM          | ok
STBY 5V          | 5.05 Volts        | ok
PS 1.8V          | 1.81 Volts        | ok
PS 1.2V          | 1.21 Volts        | ok
PS 5V            | 5.02 Volts        | ok
PS 12V           | 12.01 Volts       | ok
PS 3.3V          | 3.33 Volts        | ok
SCSI CARD TEMP   | 48 degrees C      | ok
CPU 1 TEMP       | 49 degrees C      | ok
CPU 2 TEMP       | disabled          | ns
PWR CONN TEMP    | 34 degrees C      | ok
MEM TEMP         | 42 degrees C      | ok
NB TEMP          | 50 degrees C      | ok
DIS SYS FAN 1    | 0 unspecified     | nc
DIS SYS FAN 2    | 0 unspecified     | nc
DIS SYS FAN 3    | 0 unspecified     | nc
DIS SYS FAN 4    | 0 unspecified     | nc
DIS SYS FAN 5    | 0 unspecified     | nc
DIS SYS FAN 6    | 0 unspecified     | nc
CPU 1 STATUS     | 0 unspecified     | ok
CPU 2 STATUS     | disabled          | ns
THERMAL TRIP     | 0 unspecified     | nc
ACPI PW STATE    | 0 unspecified     | ok
WATCHDOG2        | 0 unspecified     | ok
AC POWER ON      | 0 unspecified     | ok
PS 1 STATUS      | 0 unspecified     | cr
PS 2 STATUS      | 0 unspecified     | nc
PS REDUNDANCY    | 0 unspecified     | cr
UID BUTTON       | 0 unspecified     | nc
PEF ACTION       | 0 unspecified     | ok

這些都是比較粗略的資訊,如果你想要知道比較詳細的資料,可以用 #ipmitool sensor get 的指令來查詢更詳細的 sensor 資訊.

[root@benjr ~]#ipmitool sensor get "CPU 1 TEMP"
Locating sensor record...
Sensor ID              : CPU 1 TEMP (0x22)
 Entity ID             : 3.0
 Sensor Type (Analog)  : Temperature
 Sensor Reading        : 49 (+/- 0) degrees C
 Status                : ok
 Lower Non-Recoverable : na
 Lower Critical        : na
 Lower Non-Critical    : na
 Upper Non-Critical    : 80.000
 Upper Critical        : 90.000
 Upper Non-Recoverable : 100.000
 Assertion Events      :
 Assertions Enabled    : lnc- lcr- lnr- unc+ ucr+ unr+

這裡查詢了 "CPU 1 TEMP" 詳細資料,至於還有什麼可以查詢可以參考 #ipmitool -I open sdr 內的初略資料的參數來查出哪些 sensor 可供查詢.

Step 6: ipmi的相關聯結

posted @ 2012-08-01 10:31  ajiaju  阅读(5077)  评论(0编辑  收藏  举报