当前位置:   article > 正文

网络协议学习---IPMI协议学习

ipmi协议

概念介绍

IPMI(Intelligent Platform Management Interface)智能平台管理接口 是一种开放标准的硬件管理接口规格,定义了嵌入式管理子系统进行通信的特定方法。IPMI亦是一个开放的免费标准,用户无需支付额外的费用即可使用此标准。
IPMI 能够横跨不同的操作系统、固件和硬件平台,可以智能的监视、控制和自动回报大量服务器的运作状况,以降低服务器系统成本。
PMI的核心是一个专用芯片/控制器 —— BMC,其并不依赖于服务器的处理器、BIOS或操作系统来工作,可谓非常地独立。
在工作时,所有的IPMI功能都是向BMC发送命令来完成的,BMC接收并在系统事件日志中记录事件消息,维护描述系统中传感器情况的传感器数据记录。
最简单的话理解,就是BMC是独立于整个系统之外的一个设备,它不依赖于运行的系统,就好像一个外挂模块,有自己的网络,并且断电都不会影响它。它可以从外部管理服务器。

作用

远程控制台:

远程调整BIOS;
远程安装操作系统;

服务器强制断电重启

在遥远的地方,我们不需要去机房,直接通过ipmi的命令工具即可进行对服务器电源的操作 —— 这个操作是独立于操作系统的,硬件实现,因此比较稳定可靠。

远程获取服务器硬件信息

在Linux环境下我们可以通过 ipmi的命令行工具,来进行服务器硬件的获取:例如:风扇的转速,机箱温度,硬件日志,电压,BIOS版本号,RAID卡 fireware版本号,机箱上次打开的时间,服务标签等等。

测试方法

本地测试 CentOS8.4

yum install OpenIPMI OpenIPMI-tools
chkconfig ipmi on
service ipmi start
modprobe ipmi_watchdog
modprobe ipmi_poweroff
modprobe ipmi_devintf
modprobe ipmi_si
modprobe ipmi_msghandler
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

然后就可以用ipmitool命令了

[root@localhost ~]# 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
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39

例子

[root@localhost ~]# ipmitool -I open power status 
Chassis Power is on
  • 1
  • 2

远程测试方法

首先需要配置IPMI的IP地址

ipmitool lan set 1 ipsrc static
ipmitool lan set 1 ipaddress 192.168.1.239
ipmitool lan set 1 netmask 255.255.255.0
ipmitool lan set 1 defgw ipaddr 192.168.1.1
ipmitool lan print 1
  • 1
  • 2
  • 3
  • 4
  • 5
[root@localhost home]# 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      : MD5 
IP Address Source       : Static Address
IP Address              : 192.168.1.239
Subnet Mask             : 255.255.255.0
MAC Address             : b4:05:5d:a2:8f:00
SNMP Community String   : AMI
IP Header               : TTL=0x40 Flags=0x40 Precedence=0x00 TOS=0x10
BMC ARP Control         : ARP Responses Enabled, Gratuitous ARP Disabled
Gratituous ARP Intrvl   : 0.0 seconds
Default Gateway IP      : 192.168.1.1
Default Gateway MAC     : 68:ed:a4:3b:94:e1
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,6,7,8,11,12,15,16,17
Cipher Suite Priv Max   : caaaaaaaaaaaXXX
                        :     X=Cipher Suite Unused
                        :     c=CALLBACK
                        :     u=USER
                        :     o=OPERATOR
                        :     a=ADMIN
                        :     O=OEM
Bad Password Threshold  : 3
Invalid password disable: no
Attempt Count Reset Int.: 200
User Lockout Interval   : 300
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34

然后增加用户2,名字为root

ipmitool user set name 2 root
ipmitool user set password 2 123456
ipmitool user priv 2 0x4 1
ipmitool user enable 2
  • 1
  • 2
  • 3
  • 4
[root@localhost home]# ipmitool user list 1
ID  Name             Callin  Link Auth  IPMI Msg   Channel Priv Limit
1   admin            true    true       true       ADMINISTRATOR
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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

然后配置绑定到channle 1

ipmitool channel setaccess 1 2 callin=on
ipmitool channel setaccess 1 2 ipmi=on
ipmitool channel setaccess 1 2 link=on
ipmitool channel setaccess 1 2 privilege=4
  • 1
  • 2
  • 3
  • 4

然后在另一台机器上,安装好ipmitool工具。

[root@localhost ~]# ipmitool -I lanplus -H 192.168.1.239 -U root -P 123456 power status  
Chassis Power is on
  • 1
  • 2

常用查看数据

这是常见的命令部分,完整命令需要后续的部分,每个部分都不一样,需要随用随学。

命令含义
rawSend a RAW IPMI request and print response
i2cSend an I2C Master Write-Read command and print response
spdPrint SPD info from remote I2C device
lanConfigure LAN Channels
chassisGet chassis status and set power state
powerShortcut to chassis power commands
eventSend pre-defined events to MC
mcManagement Controller status and global enables
sdrPrint Sensor Data Repository entries and readings
sensorPrint detailed sensor information
fruPrint built-in FRU and scan SDR for FRU locators
gendevRead/Write Device associated with Generic Device locators sdr
selPrint System Event Log (SEL)
pefConfigure Platform Event Filtering (PEF)
solConfigure and connect IPMIv2.0 Serial-over-LAN
tsolConfigure and connect with Tyan IPMIv1.5 Serial-over-LAN
isolConfigure IPMIv1.5 Serial-over-LAN
userConfigure Management Controller users
channelConfigure Management Controller channels
sessionPrint session information
dcmiData Center Management Interface
nmNode Manager Interface
sunoemOEM Commands for Sun servers
kontronoemOEM Commands for Kontron devices
picmgRun a PICMG/ATCA extended cmd
fwumUpdate IPMC using Kontron OEM Firmware Update Manager
firewallConfigure Firmware Firewall
delloemOEM Commands for Dell systems
shellLaunch interactive IPMI shell
execRun list of commands from file
setSet runtime variable for shell and exec
hpmUpdate HPM components using PICMG HPM.1 file
ekanalyzerrun FRU-Ekeying analyzer using FRU files
imeUpdate Intel Manageability Engine Firmware
vitaRun a VITA 46.11 extended cmd
lan6Configure IPv6 LAN Channels

常用软件

可以在网上搜索IPMI View软件,进行学习。

在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/人工智能uu/article/detail/867486
推荐阅读
相关标签
  

闽ICP备14008679号