网络协议学习---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

然后就可以用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

例子

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

远程测试方法

首先需要配置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
[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

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

ipmitool user set name 2 root
ipmitool user set password 2 123456
ipmitool user priv 2 0x4 1
ipmitool user enable 2
[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

然后配置绑定到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

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

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

常用查看数据

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

命令含义
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软件,进行学习。

在这里插入图片描述

  • 4
    点赞
  • 40
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

胖哥王老师

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值