您的位置:首页 > 产品设计 > 产品经理

ipmi之远程管理协议学习路线

2017-11-07 10:04 579 查看
IPMI(Intelligent Platform Management Interface)即智能平台管理接口是使硬件管理具备“智能化”的新一代通用接口标准。用户可以利用 IPMI 监视服务器的物理特征,如温度、电压、电扇工作状态、电源供应以及机箱入侵等。Ipmi 最大的优势在于它是独立于 CPU BIOS 和 OS 的,所以用户无论在开机还是关机的状态下,只要接通电源就可以实现对服务器的监控。Ipmi 是一种规范的标准,其中最重要的物理部件就是BMC(Baseboard Management Controller 如图1),一种嵌入式管理微控制器,它相当于整个平台管理的“大脑”,通过它 ipmi 可以监控各个传感器的数据并记录各种事件的日志。

The Intelligent Platform Management Interface (IPMI) is a set of computer interface
specifications for an autonomous computer subsystem that provides
management and monitoring capabilities independently of the host
system's CPU, firmware (BIOS or UEFI) and operating system.

OpenIPMI is an effort to create a full-function IPMI system to allow full access to all IPMI information on a server and to abstract it to a level that will make it easy to use. See the SourceForge page for the source code.
A nice overview of IPMI can be found here, if you are interested.OpenIPMI consists of two main parts: A device driver that goes into the Linux kernel, and a user-level library that provides a higher-level abstraction of IPMI and generic services that can be used on any operation system.

IPMI
https://en.wikipedia.org/wiki/Intelligent_Platform_Management_Interface

http://openipmi.sourceforge.net/

基于Zabbix IPMI监控服务器硬件状况

http://www.cnblogs.com/wajika/p/6549095.html

使用 ipmitool 实现 Linux 系统下对服务器的 ipmi 管理

https://www.ibm.com/developerworks/cn/linux/l-ipmi/

使用ipmi进行服务器管理

IPMI介绍
智能平台管理界面(IPMI,Intelligent Platform Management Interface)是管理基于 Intel® 结构的企业系统中所使用的外围设备采用的一种工业标准,用户可以利用IPMI监视服务器的物理健康特征,如温度、电压、风扇工作状态、电源状态等。该标准由美国英特尔、惠普(Hewlett-Packard)、NEC、美国戴尔电脑和SuperMicro等公司制定。新的版本是IPMI2.0(http://www.intel.com/design/servers/ipmi/)。
新版本的IPMI可以通过串口、Modem以及Lan等远程环境管理服务器系统(包括远程开关机),同时在系统发生错误时能自动发出警告。要对服务器进行IPMI管理,需要被监控的系统具有支持IPMI的硬件设备。如果服务器具有底板管理控制器 (Baseboard Management Controller ,BMC),并且支持IPMI规范,则通过BMC与主机板上的不同传感器通信来监视系统是否有严重事件,并在某些参数超出其预置阈值时发出警报和日志事件。BMC具有以下功能:
1. 通过系统的串行端口进行访问
2. 故障日志记录和 SNMP 警报发送
3. 访问系统事件日志 (System Event Log ,SEL) 和传感器状况
4. 控制包括开机和关机
5. 独立于系统电源或工作状态的支持
6. 用于系统设置、基于文本公用程序和操作系统控制台的文本控制台重定向
7. 使用 LAN访问 Red Hat® Enterprise Linux 串行控制台界面

IPMI应用
所举应用都基于以下平台:
服务器:超毅
主板:TyanS5353
服务器监控卡(SMDC,Server Management Daughter Card):M3291
Ipmitool版本:ipmitool version 1.8.8
Ipmitool版本:ipmiutil-1.7.4-1
OpenIPMI版本:OpenIPMI-2.0.7

IPMI可以通过本地和远程两种方式来获取被监控服务器的监测信息,两种方式都需要相关的硬件,但是软件的安装和软件命令使用稍微有所不同。
1 软件安装
1.1本地获取软件安装
通过本地方式获取服务器相应状态信息,需要安装ipmi驱动程序和用于获取信息的软件。驱动程序使用OpenIPMI, ipmi工具软件可以安装ipmitool或者ipmiutil,或者freeipmi。软件下载网址为:
OpenIPMI:http://openipmi.sourceforge.net/
Ipmitool: http://ipmitool.sourceforge.net/ http://ipmitool.sourceforge.net/manpage.html
ipmiutil: http://ipmiutil.sourceforge.net/ 1.2远程获取软件安装
远程监控只需要在监控客户端上安装用于获取信息的软件:ipmitool、ipmiutil或者reeipmi即可,而不需要在服务其上安装任何工具。
2 服务器监控信息获取
2.1本地获取服务器监控信息
在获取本地服务器相关的监控信息之前,需要启动相应的驱动模块,可以通过以下两种命令启动驱动:
/etc/init.d/ipmi start
或者通过以下命令:
modprobe ipmi_msghandler
modprobe ipmi_devintf
modprobe ipmi_si
modprobe ipmi_poweroff
modprobe ipmi_watchdog

启动ipmi驱动后,通过cat /proc/devices | grep ipmidev获得设备号,我得到的设备号是253,用mknod -m 600 /dev/ipmi0 c 253 0 建立文件索引点。然后就可以在本地服务器上运行各种ipmi工具获取相应的服务器信息了。
以下所有的命令都是我用到的,还有更多命令没有涉及,可以查看相应的帮助文档来获得所有命令的用法。
2.1.1 使用ipmitool本地获取信息
Ipmitool本地监控使用命令:ipmitool –I open command,其中-I open表示使用OpenIPMI接口,command有以下项:
a) raw:发送一个原始的IPMI请求,并且打印回复信息。
b) Lan:配置网络(lan)信道(channel)
c) chassis :查看底盘的状态和设置电源
d) event:向BMC发送一个已经定义的事件(event),可用于测试配置的SNMP是否成功
e) mc: 查看MC(Management Contollor)状态和各种允许的项
f) sdr:打印传感器仓库中的所有监控项和从传感器读取到的值。
g) Sensor:打印详细的传感器信息。
h) Fru:打印内建的Field Replaceable Unit (FRU)信息
i) Sel: 打印 System Event Log (SEL)
j) Pef: 设置 Platform Event Filtering (PEF),事件过滤平台用于在监控系统发现有event时候,用PEF中的策略进行事件过滤,然后看是否需要报警。
k) Sol/isol:用于配置通过串口的Lan进行监控
l) User:设置BMC中用户的信息 。
m) Channel:设置Management Controller信道。

Ipmitool –I open sensor list命令可以获取传感器中的各种监测值和该值的监测阈值,包括(CPU温度,电压,风扇转速,电源调制模块温度,电源电压等信息)
Ipmitool –I open sensor get “CPU0Temp”可以获取ID为CPU0Temp监测值,CPU0Temp是sensor的ID,服务器不同,ID表示也不同。
Ipmitool –I open sensor thresh <id> <threshold> <setting>设置ID值等于id的监测项的各种限制值。
Ipmitool –I open chassis status查看底盘状态,其中包括了底盘电源信息,底盘工作状态等
Ipmitool –I open chassis restart_cause查看上次系统重启的原因
Ipmitool –I open chassis policy list 查看支持的底盘电源相关策略。
Ipmitool –I open chassis power on启动底盘,用此命令可以远程开机
Ipmitool –I open chassis power off关闭底盘,用此命令可以远程开机
Ipmitool –I open chassis power reset实现硬重启,用此命令可以远程开机
Ipmi还可以设置系统启动boot的设备,具体见ipmitool帮助文档。
Ipmitool –I open mc reset 使BMC重新硬启动
Ipmitool –I open mc info 查看BMC硬件信息
Ipmitool –I open mc getenables 列出BMC所有允许的选项
Ipmitool –I open mc setenables <option>=[on|off],设置bmc相应的允许/禁止选项。
Ipmitool-I open event 1 发送一个温度过高的消息到System Event Log中,可以发送的Event有:
1 Temperature: Upper Critical: Going High
2 Voltage Threshold: Lower Critical: Going Low
3 Memory: Correctable ECC Error Detected
Ipmitool-I open event命令可以用测试配置的IPMI中的snmp功能是否成功。
Ipmitool -I open lan print 1 打印现咱channel 1的信息 。
Ipmitool -I open lan set 1 ipaddr 10.10.113.95设置channel 1 的地址为10.10.113.95
Ipmitool -I open lan set 1 snmp public设置channel 1 上snmp的community为public。
Ipmitool -I open lan set 1 access on设置channel 1允许访问。
Ipmitool -I open pef info打印Platform Event Filtering (pef)信息
Ipmitool -I open pef status查看Platform Event Filtering (pef)状态
Ipmitool -I open pef policy查看Platform Event Filtering (pef)策略设置
Ipmitool -I open sdr list fru 读取fru信息并显示。(但我的服务器有问题,该项读取不到)
备注:
PEF由BMC厂商的FIRMWARE设置,ipmitool(V1.8.8)不能进行设置,也可以使用ipmiutil来进行初始设置。

2.1.2 使用ipmiutil本地获取信息
Ipmiutil安装完成后,会包含以下可执行命令:
alarms –显示和设置Telco alarms报警(LED显示和延迟)
bmchealth – 测试BMC是否工作正常。
fruconfig – 显示FRU的产品信息,写入有用信息
getevent – 接收一个IPMI event,并显示。
hwreset – 用于使 firmware 硬重新启动或者关掉系统
pefconfig – 用于显示和配置LAN端口,配置Platform Event Filter 表,来通过firmare event产生BMC Lan提示
sensor – 显示Sensor Data Records,值和阈值。
showsel – 显示System Event Log记录。
tmconfig – 显示和配置BMC串口。
wdt – 显示和设置看门狗时间.
以上命令种中最为常用的是sensor命令和pefconfig命令。使用sensor命令可以获取各种监测信息。使用pefconfig命令设置BMC,使得BMC可以在系统有event时候,进行报警。
Sensor 命令显示服务器状态信息。
Pefconfig –e命令用于设置BMC硬件,该命令将从操作系统收集相应的信息,并对bmc进行设置,使得BMC能够在有event时候报警(alert)。
Pefconfig –d命令将设置bmc不报警。
2.2远程获取服务器监控信息
远程获取服务器监控信息时,需要系统硬件支持ipmiV1.5和IPMIV2.0。获取信息时,不需要在服务器上安装其他软件,只需要在监控的客户端上安装ipmi工具软件,如ipmitool、ipmiutil或者freeipmi,并需要在相应命令中加入远端服务器的名字或者地址。Ipmitool和ipmiutil可以通过LAN远程监控系统,同时BMC中保存有一序列用户名和密码,通过LAN进行远端访问需要用户名和密码。
2.2.1使用ipmitool获取远程服务器信息
Ipmitool 命令需要通过相应的interface来访问BMC,在本地获取信息时候采用的是-I open,即为OpenIPMI接口,IPMItool命令包含的接口有open、lan、lanplus。其中open是指的是OpenIPMI与BMC通信,Lan是通过Ethernet LAN网用IPV4的udp协议与BMC通信。UDP的数据段包含了IPMI request/resoponse消息,消息具有一个IPMI session 头和RMCP 头。IPMI使用Remote Management Control Protocol (RMCP) 版本1支持操作系统关闭(pre-OS和OS-absent),RMCP把把数据发送到UDP的623端口。象lan接口一样,lanplus同样使用Ethernet LAN 的UDP协议与BMC通信,但是lanplus使用RMCP+协议(在IPMIV20中描述)来同新,RMCP+允许使用改经的认证方式和数据完整性检查。Open端口用于本地监控系统使用的;Lan/lanplus通过网络进行远程监控。
远程获取服务器监控信息时,需要加上远程服务器的地址。使用以下的命令格式:
ipmitool -H 10.6.77.249 -U root -P changeme -I lan command。其中-H表示后面跟的是服务器的地址,-U表示后面跟着用户名,-P表示后面跟着用户密码,command与本地获取信息相同。
2.2.2使用ipmiutil获取远程服务器信息
Ipmiutil的sensor命令格式如下:
Sensor -N nodename –U user –R passwd ,
其中-N后面跟的是被监控服务器名字,-U后是用户名,-R后是用户密码。
Pefconfig -e -N nodename –U user –R passwd命令用于设置BMC硬件,该命令将从操作系统收集相应的信息,并对bmc进行设置,使得BMC能够在有event时候报警。
Pefconfig -d -N nodename –U user –R passwd将不允许报警

http://blog.chinaunix.net/uid-1724205-id-2813075.html

ipmi 介绍和使用

http://www.cnblogs.com/ngnetboy/p/5646017.html

http://www.360doc.com/content/13/0418/11/11729272_279164665.shtml

关于IPMI的几个问题

使用IPMI监控服务器主要有两种模式:本地和远程。

本地监控:

需要安装:
IPMI驱动(硬件设备被操作系统识别)

ipmitool或其他工具(通过驱动获取服务器信息)

远程监控:

只需要在客户端安装ipmitool或其他工具
远程模式下,IPMI使用RMCP,RMCP基于UDP协议实现。
远程监控也就是基于UDP的网络通信。
服务器IPMI使用的端口一般是623.

ipmitool的使用

基本的帮助信息可以通过-h选项获取
也可以使用man ipmitool
$ ipmitool -h
ipmitool version 1.8.11usage: ipmitool [options...] <command>

-h             This help
-V             Show version information
-v             Verbose (can use multiple times)
-c             Display output in comma separated format
-d N           Specify a /dev/ipmiN device to use (default=0)
-I intf        Interface to use
-H hostname    Remote host name for LAN interface
-p port        Remote RMCP port [default=623]
-U username    Remote session username
-f file        Read remote session password from file
-z size        Change Size of Communication Channel (OEM)
-S sdr         Use local file for remote SDR cache
-D tty:b[:s]   Specify the serial device, baud rate to use                      and, optionally, specify that interface is the system one
-a             Prompt for remote password
-Y             Prompt for the Kg key for IPMIv2 authentication
-e char        Set SOL escape character
-C ciphersuite Cipher suite to be used by lanplus interface
-k key         Use Kg key for IPMIv2 authentication
-y hex_key     Use hexadecimal-encoded Kg key for IPMIv2 authentication
-L level       Remote session privilege level [default=ADMINISTRATOR]
Append a '+' to use name/privilege lookup in RAKP1
-A authtype    Force use of auth type NONE, PASSWORD, MD2, MD5 or OEM
-P password    Remote session password
-E             Read password from IPMI_PASSWORD environment variable
-K             Read kgkey from IPMI_KGKEY environment variable
-m address     Set local IPMB address
-b channel     Set destination channel for bridged request
-t address     Bridge request to remote target address
-B channel     Set transit channel for bridged request (dual bridge)
-T address     Set transit address for bridge request (dual bridge)
-l lun         Set destination lun for raw commands
-o oemtype     Setup for OEM (use 'list' to see available OEM types)
-O seloem      Use file for OEM SEL event descriptions
-N seconds     Specify timeout for lan [default=2] / lanplus [default=1] interface
-R retry       Set the number of retries for lan/lanplus interface [default=4]

Interfaces:
open          Linux OpenIPMI Interface [default]
imb           Intel IMB Interface
lan           IPMI v1.5 LAN Interface
lanplus       IPMI v2.0 RMCP+ LAN Interface
serial-terminal  Serial Interface, Terminal Mode
serial-basic  Serial Interface, Basic Mode

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
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


http://blog.csdn.net/lanyang123456/article/details/51712878

ipmitool 中文 帮助 文档

pmitool —— 对于控制支持IPMI的设备有效.

Synopsis(概要)

ipmitool [-c|-h|-v|-V] -I open <command>
ipmitool [-c|-h|-v|-V] -I lan -H <hostname>

[-p <port>]

[-U <username>]

[-A <authtype>]

[-L <privlvl>]

[-a|-E|-P|-f <password>]

[-o <oemtype>]

<command>
ipmitool [-c|-h|-v|-V] -I lanplus -H <hostname>

[-p <port>]

[-U <username>]

[-L <privlvl>]

[-a|-E|-P|-f <password>]

[-o <oemtype>]

[-C <ciphersuite>]

<command>

Description(描述)

这个程序能够使你通过一个kernel设备驱动或者一个远程系统,利用IPMI v1.5或IPMIv2.0 来
管理本地系统的任何一个智能平台管理接口(IPMI)功能。这些功能包括打印FRU(现场可替换装置)信息、LAN配置、传感器读数、以及远程机架电源控
制。

一个本地系统接口的IPMI管理功能需要一个兼容IPMI的kernel驱动程序被安装以及配置。在linux中,这个驱动叫做OpenIPMI,他被
包括在了标准化分配中。在Solaris系统中,这个驱动叫做BMC,他被包括在了Solaris
10中。远程控制的管理需要授权以及配置IPMI-over-LAN接口。根据每个系统独特的需要,它可以通过系统接口来使LAN接口使用
ipmitool。

Options(选项)

-a 提示输入远程服务器的密码
-A <authtype>
当IPMIv1.5会话激活时,指定使用一个认证类型。
-c 使输出格式为 CSV(逗号分隔的变量)格式。但是不是针对所有命令都有效。
-C <ciphersuite>
为IPMIv2 lanplus连接使用远程服务器身份验证、完整性和加密算法。请看IPMIv2说明书中的表格 22-19。

默认的三个格式为:指定RAKP-HMAC-SHA1为验证,HMAC-SHA1-96为完整性,AES-CBC-128为加密算法。
-E 远程服务密码通过环境变量IPMI_PASSWORD来指定。
-f <password_file>
指定一个文件,而这个文件中包含了远程服务密码。如果这个选项没有被使用,或者指定的文件不存在,

那么那么密码将默认为NULL。
-h 获取基本帮助
-H <address>
远程服务地址,可以为ip地址或者是主机名。Lan和lanplus接口都需要这个操作。
-I <interface>
选择使用的IPMI接口。编译支持的接口都在使用帮助输出中可见。
-L <privlvl>
力量会话特权级别。可以为CALLBACK,
USER,
OPERATOR,
ADMIN。默认为ADMIN。
-m <local_address>
设置本地IPMB(智能平台管理总线)地址。默认的为0x20。如果是一般的操作,那么就没有必要更改它。
-o <oemtype>
选择支持的OEM(原始设备制造商)类型。这通常涉及到代码中的小窍门,以解决各种BMC在不同制造商的怪癖到位。

使用命令“-o list”来查看当前支持的OEM类型的列表。
-p <port>
设置要连接的远程服务UPD端口,默认为623。
-P <password>
在命令行中指定远程服务密码。如果支持,他将会进程列表中被掩盖。注意!:不推荐在命令行中指定密码。
-t <target_address>
桥接IPMI的请求到远程目标地址。
-U <username>
远程服务用户名,默认为NULL。
-v 提高详细输出的级别。这个操作可以指定多次用来提高调试输出的级别。如果指定三次,那么你将会得到所有传入和传出的数据包。
-V 列出版本信息。

如果没有密码方法被指定,那么ipmitool将会提示用户输入密码。如果用户没有输入密码,那么远程服务密码将会设置为NULL。


http://blog.csdn.net/zuiaituantuan/article/details/5816380

使用IPMI工具实现对服务器的远程管理

IPMI是智能型平台管理接口(Intelligent Platform Management Interface)的缩写,是管理基于
Intel结构的企业系统中所使用的外围设备采用的一种工业标准,该标准由英特尔、惠普、NEC、美国戴尔电脑和SuperMicro等公司制定。用户可以利用IPMI监视服务器的物理健康特征,如温度、电压、风扇工作状态、电源状态等。而且更为重要的是IPMI是一个开放的免费标准,用户无需为使用该标准而支付额外的费用。

IPMI 工作原理
  IPMI的核心是一个专用芯片/控制器(叫做服务器处理器或基板管理控制器(BMC)),其并不依赖于服务器的处理器、BIOS或操作系统来工作,可谓非常地独立,是一个单独在系统内运行的无代理管理子系统,只要有BMC与IPMI固件其便可开始工作,而BMC通常是一个安装自爱服务器主板上的独立的板卡,现在也有服务器主板提供对IPMI支持的。IPMI良好的自治特性便克服了以往基于操作系统的管理方式所受的限制,例如操作系统不响应或未加载的情况下其仍然可以进行开关机、信息提取等操作。
  在工作时,所有的IPMI功能都是向BMC发送命令来完成的,命令使用IPMI规范中规定的指令,BMC接收并在系统事件日志中记录事件消息,维护描述系统中传感器情况的传感器数据记录。在需要远程访问系统时,IPMI新的LAN上串行(SOL)特性很有用。SOL改变IPMI会话过程中本地串口传送方向,从而提供对紧急管理服务、Windows专用管理控制台或Linux串行控制台的远程访问。BMC通过在LAN上改变传送给串行端口的信息的方向来做到这点,提供了一种与厂商无关的远程查看启动、操作系统加载器或紧急管理控制台来诊断和维修故障的标准方式。

http://blog.csdn.net/bbs598598/article/details/51055382
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ipmi