2015-02-28 14:59:04 bnanoou 阅读数 20801

1. 下载ipmitool:http://ipmitool.sourceforge.net/

2. 确定gcc工具已经安装好

3. 在Linux系统上加载启用IPMI驱动:

insmod /lib/modules/2.6.32-220.el6.x86_64/kernel/drivers/char/ipmi/ipmi_msghandler.ko

insmod /lib/modules/2.6.32-220.el6.x86_64/kernel/drivers/char/ipmi/ipmi_devintf.ko

insmod /lib/modules/2.6.32-220.el6.x86_64/kernel/drivers/char/ipmi/ipmi_si.ko

4. 检查你的/dev目录下出现了ipmi0这个设备:

ls -l /dev/ipmi*

5. 解压缩ipmitool-1.8.11.tar.gz

tar zxvf ipmitool-1.8.11.tar.gz

6. cd ipmitool-1.8.11

7. 开始安装ipmitool:

./configure

make

make install

8. ipmitool命令将被安装到/usr/local/bin/ipmitool

9. 现在你就可以用了 

2020-03-11 13:52:45 qq_34160841 阅读数 95

以ubuun18.04为例

   如果可以联网直接安装ipmitool。

sudo apt install -y ipmitool             #ipmitool
sudo apt install -y openipmi  freeipmi   #相关工具

1、下载ipmitool源码

     源码下载地址:https://sourceforge.net/projects/ipmitool/

     安装包下载地址:https://pkgs.org/download/ipmitool

2、安装ipmi驱动

sudo modprobe ipmi_msghandler
sudo modprobe ipmi_devintf

(sudo modprobe ipmi_si   一般会报错,需要有驱动支持不用安装)

查看是否安装完成(如果没有 mod,可以切换到root用户下从新安装)

lsmod | grep ipmi

3、解压ipmitool源码包

tar -vxf ipmitool-1.8.18.tar.bz2 

4、编译配置

  执行:

./configure

一般lanplus 是no,,如果想用lanplus,需要安装sudo apt-get install -y openssl libssl-dev。(如果时ReaHat、centOS要将libssl-dev换成openssl-devel)

需要执行 (./configure -h 查看可以输入那些命令)

./configure --enable-intf-lanplus=yes

./configure 

5、编译

make

如果configure的结果中  lanplus : yes  则会出现编译报错:error: storage size of 'ctx' isn't known

此时需要修改源码下/src/plugins/lanplus/lanplus_crypt_impl.c文件中lanplus_encrypt_aes_cbc_128和lanplus_decrypt_aes_cbc_128

//EVP_CIPHER_CTX ctx;

    EVP_CIPHER_CTX *ctx;
    ctx = EVP_CIPHER_CTX_new();

6、安装

普通用户安装会报错

sudo make install 

2013-11-12 23:26:00 weixin_30663391 阅读数 5

http://www.thomas-krenn.com/en/wiki/Configuring_IPMI_under_Linux_using_ipmitool

Configuring IPMI under Linux using ipmitool

 
 

Under Linux, the ipmitool command (http://ipmitool.sourceforge.net/) can be used for configuring IPMI for a server.

Contents

 [hide

Hardware and Software Requirements

The following example will show how to configure IPMI on a Linux server. The /dev/ipmi0 device file must exist so that configuration can be carried out. If it does not exist, you can create it as follows:

  • under SuSE, Red Hat or CentOS: /etc/init.d/ipmi start (requires the OpenIMPI package. The OpenIPMI-tools package will be required later, as well.)
  • under Debian 4: /usr/share/ipmitool/ipmi.init.basic (If the error message, ipmi_kcs_drv not found, appears, you will have to comment the corresponding if-condition out, see also [1].)
  • under Debian 5: modprobe ipmi_devintf; modprobe ipmi_si

The approach described below has been tested on an Intel SR2500 under CentOS 4 using ipmitool version 1.8.7. In principle, the configuration should be configured similarly on other systems with IPMI support.

LAN Configuration

The first IPMI LAN channel will now be configured. Thereby, the configured IP address can be accessed at the first LAN port for the server. For the default gateway, both its IP address and MAC address must be configured.

[root@sr2500 ~]# ipmitool lan set 1 ipsrc static
[root@sr2500 ~]# ipmitool lan set 1 ipaddr 192.168.1.211
Setting LAN IP Address to 192.168.1.211
[root@sr2500 ~]# ipmitool lan set 1 netmask 255.255.255.0
Setting LAN Subnet Mask to 255.255.255.0
[root@sr2500 ~]# ipmitool lan set 1 defgw ipaddr 192.168.1.254
Setting LAN Default Gateway IP to 192.168.1.254
[root@sr2500 ~]# ipmitool lan set 1 defgw macaddr 00:0e:0c:aa:8e:13
Setting LAN Default Gateway MAC to 00:0e:0c:aa:8e:13
[root@sr2500 ~]# ipmitool lan set 1 arp respond on
Enabling BMC-generated ARP responses
[root@sr2500 ~]# ipmitool lan set 1 auth ADMIN MD5
[root@sr2500 ~]# ipmitool lan set 1 access on

When configuring LANs, older versions of ipmitool would not automatically reset Set in Progress to Set Complete. This can be done manually using a raw command (regarding this, see http://www.mail-archive.com/ipmitool-devel@lists.sourceforge.net/msg00095.html)

[root@sr2500 ~]# ipmitool lan print 1
Set in Progress         : Set In Progress
[...]
[root@sr2500 ~]# ipmitool raw 0x0c 1 1 0 0

ipmitool lan print 1

You can check the configuration using ipmitool lan print 1.

[root@sr2500 ~]# ipmitool lan print 1
Set in Progress         : Set Complete
Auth Type Support       : NONE MD5 PASSWORD 
Auth Type Enable        : Callback : 
                        : User     : 
                        : Operator : 
                        : Admin    : MD5 
                        : OEM      : 
IP Address Source       : Static Address
IP Address              : 192.168.1.211
Subnet Mask             : 255.255.255.0
MAC Address             : 00:0e:0c:ea:92:a2
SNMP Community String   : 
IP Header               : TTL=0x40 Flags=0x40 Precedence=0x00 TOS=0x10
BMC ARP Control         : ARP Responses Enabled, Gratuitous ARP Disabled
Gratituous ARP Intrvl   : 2.0 seconds
Default Gateway IP      : 192.168.1.254
Default Gateway MAC     : 00:0e:0c:aa:8e:13
Backup Gateway IP       : 0.0.0.0
Backup Gateway MAC      : 00:00:00:00:00:00
RMCP+ Cipher Suites     : None
Cipher Suite Priv Max   : XXXXXXXXXXXXXXX
                        :     X=Cipher Suite Unused
                        :     c=CALLBACK
                        :     u=USER
                        :     o=OPERATOR
                        :     a=ADMIN
                        :     O=OEM
[root@sr2500 ~]# 

User Configuration

A user will now be setup with admin rights.

[root@sr2500 ~]# ipmitool user set name 2 admin
[root@sr2500 ~]# ipmitool user set password 2
Password for user 2: 
Password for user 2: 
[root@sr2500 ~]# ipmitool channel setaccess 1 2 link=on ipmi=on callin=on privilege=4
[root@sr2500 ~]# ipmitool user enable 2
[root@sr2500 ~]# 

The server can now be controlled by this user as described in Using ipmitool for Remote Control of Servers.

Users at the USER Privilege Level

If a user should only be used for querying sensor data, a custom privilege level can be setup for that. This user does not then have any rights for activating or deactivating the server, for example. A user named monitor will be created for this in the following example:

[root@sr2500 ~]# ipmitool user set name 3 monitor
[root@sr2500 ~]# ipmitool user set password 3
Password for user 3: 
Password for user 3: 
[root@sr2500 ~]# ipmitool channel setaccess 1 3 link=on ipmi=on callin=on privilege=2
[root@sr2500 ~]# ipmitool user enable 3
[root@sr2500 ~]# ipmitool channel getaccess 1 3
Maximum User IDs     : 15
Enabled User IDs     : 2

User ID              : 3
User Name            : monitor
Fixed Name           : No
Access Available     : call-in / callback
Link Authentication  : enabled
IPMI Messaging       : enabled
Privilege Level      : USER
[root@sr2500 ~]# 

The importance of the various privilege numbers will be displayed when ipmitool channel is called without any additional parameters:

[root@sr2500 ~]# ipmitool channel
Channel Commands: authcap   <channel number> <max privilege>
                  getaccess <channel number> [user id]
                  setaccess <channel number> <user id> [callin=on|off] [ipmi=on|off] [link=on|off] [privilege=level]
                  info      [channel number]
                  getciphers <ipmi | sol> [channel]

Possible privilege levels are:
   1   Callback level
   2   User level
   3   Operator level
   4   Administrator level
   5   OEM Proprietary level
  15   No access
[root@sr2500 ~]# 

The user just created (named 'monitor') has been assigned the USER privilege level. So that LAN access is allowed for this user, you must activate MD5 authentication for LAN access for this user group (USER privilege level):

[root@sr2500 ~]# ipmitool lan set 1 auth USER MD5
[root@sr2500 ~]# 

MD5 will now also be listed as User Auth Type Enable for LAN Channel 1:

[root@sr2500 ~]# ipmitool lan print 1
Set in Progress         : Set Complete
Auth Type Support       : NONE MD5 PASSWORD 
Auth Type Enable        : Callback : 
                        : User     : MD5 
                        : Operator : 
                        : Admin    : MD5 
                        : OEM      : 
IP Address Source       : Static Address
IP Address              : 192.168.1.211
Subnet Mask             : 255.255.255.0
MAC Address             : 00:0e:0c:ea:92:a2
SNMP Community String   : 
IP Header               : TTL=0x40 Flags=0x40 Precedence=0x00 TOS=0x10
BMC ARP Control         : ARP Responses Enabled, Gratuitous ARP Disabled
Gratituous ARP Intrvl   : 2.0 seconds
Default Gateway IP      : 192.168.1.254
Default Gateway MAC     : 00:0e:0c:aa:8e:13
Backup Gateway IP       : 0.0.0.0
Backup Gateway MAC      : 00:00:00:00:00:00
RMCP+ Cipher Suites     : 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
Cipher Suite Priv Max   : XXXXXXXXXXXXXXX
                        :     X=Cipher Suite Unused
                        :     c=CALLBACK
                        :     u=USER
                        :     o=OPERATOR
                        :     a=ADMIN
                        :     O=OEM
[root@sr2500 ~]# 

Please specify the option "-L USER" for ipmitool when using a user with USER privilege. Otherwise you will get an error message stating:

Activate Session error: Requested privilege level exceeds limit

Author: Werner Fischer

转载于:https://www.cnblogs.com/baiyw/p/3420505.html

2018-10-30 12:41:22 weixin_42414349 阅读数 534

一、IPMI-IP配置(本机登陆方式

1,ipmitool -I open shell      //进入本地BMC shell

[root@bogon ~]# ipmitool -I open shell
ipmitool> 

2,lan set 1 ipsrc static      //设置ipsrc的类型为静态

ipmitool> lan set 1 ipsrc static

3,lan set 1 ipaddr 192.168.200.100   //设置静态IP为192.168.200.100

ipmitool> lan set 1 ipaddr 192.168.200.100
Setting LAN IP Address to 192.168.200.100

4,lan set 1 netmask 255.255.255.0 //设置子网掩码为255.255.255.0

ipmitool> lan set 1 netmask 255.255.255.0
Setting LAN Subnet Mask to 255.255.255.0

5,lan set 1 defgw ipaddr 192.168.200.1   //配置网关为192.168.200.1 

ipmitool> lan set 1 defgw ipaddr 192.168.200.1
Setting LAN Default Gateway IP to 192.168.200.1

6,lan print  //打印IPMI配置信息,检查是否正确

ipmitool> lan print
Set in Progress         : Set Complete
Auth Type Support       : NONE MD2 MD5 PASSWORD OEM 
Auth Type Enable        : Callback : NONE MD2 MD5 PASSWORD OEM 
                        : User     : NONE MD2 MD5 PASSWORD OEM 
                        : Operator : NONE MD2 MD5 PASSWORD OEM 
                        : Admin    : NONE MD2 MD5 PASSWORD OEM 
                        : OEM      : 
IP Address Source       : Static Address
IP Address              : 192.168.200.100
Subnet Mask             : 255.255.255.0
MAC Address             : d8:cb:8a:f6:6e:e5
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.200.1
Default Gateway MAC     : 00:00:00:00:00:00

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   : caaaXXaaaXXaaXX
                        :     X=Cipher Suite Unused
                        :     c=CALLBACK
                        :     u=USER
                        :     o=OPERATOR
                        :     a=ADMIN
                        :     O=OEM

7,exit  //退出shell

二、IPMI 测试

1,使用同网段电脑打开IE 输入192.168.200.100登陆

2,也可通过SSH登录

二、IPMI 远程操作命令

 远程SSH开机: 

ipmitool –H (IP地址) –I lanplus –U (用户名) –P (密码) power on 

远程关机: 

ipmitool –H (IP地址) –I lanplus –U (用户名) –P (密码) power off 

远程重启: 

ipmitool –H (IP地址) –I lanplus –U (用户名) –P (密码) power reset 

查看server状态: 

 ipmitool -I lanplus -H (IP地址) –U (用户名) –P (密码)  chassis status

ipmitool> chassis status
System Power         : on
Power Overload       : false
Power Interlock      : inactive
Main Power Fault     : false
Power Control Fault  : false
Power Restore Policy : always-on
Last Power Event     : ac-failed 
Chassis Intrusion    : inactive
Front-Panel Lockout  : inactive
Drive Fault          : false
Cooling/Fan Fault    : false
Front Panel Control  : none

更改密码: 

 ipmitool -I lanplus -H (IP地址) –U (用户名) –P (密码)  user list

 ipmitool -I lanplus -H (IP地址) –U (用户名) –P (密码) user set password 2 newpass 

查看风扇,电压,温度传感器

 ipmitool -I lanplus -H (IP地址) –U (用户名) –P (密码) sdr elist full

ipmitool> sdr elist full
Temp_CPU0        | 01h | ns  |  3.0 | No Reading
Temp_CPU1        | 02h | ns  |  3.0 | No Reading
Temp_CPU0_DIMM1  | 03h | ns  |  3.0 | No Reading
Temp_CPU0_DIMM2  | 04h | ns  |  3.0 | No Reading
Temp_CPU0_DIMM3  | 05h | ns  |  3.0 | No Reading
Temp_CPU0_DIMM4  | 06h | ns  |  3.0 | No Reading
Temp_CPU1_DIMM1  | 07h | ns  |  3.0 | No Reading
Temp_CPU1_DIMM2  | 08h | ns  |  3.0 | No Reading
Temp_CPU1_DIMM3  | 09h | ns  |  3.0 | No Reading
Temp_CPU1_DIMM4  | 0Ah | ns  |  3.0 | No Reading
Temp_BMC         | 0Bh | ok  |  3.0 | 35 degrees C
Temp_ENV         | 0Ch | ok  |  3.0 | 33 degrees C
Voltage_5VSB     | 40h | ok  |  7.1 | 5.15 Volts
Voltage_3VSB     | 41h | ok  |  7.2 | 3.32 Volts
Voltage_P5V      | 42h | ok  |  7.3 | 5.10 Volts
Voltage_P3V3     | 43h | ok  |  7.4 | 3.36 Volts
Voltage_P12V     | 44h | ok  |  7.5 | 12 Volts
Voltage_VBAT     | 45h | ok  |  7.6 | 2.79 Volts
Voltage_VCC_CPU0 | 46h | ok  |  7.7 | 1.80 Volts
Voltage_VCC_CPU1 | 47h | ok  |  7.8 | 1.80 Volts
Voltage_PVDDQ_AB | 48h | ok  |  7.9 | 1.21 Volts
Voltage_PVDDQ_CD | 49h | ok  |  7.10 | 1.21 Volts
Voltage_PVDDQ_EF | 4Ah | ok  |  7.11 | 1.21 Volts
Voltage_PVDDQ_GH | 4Bh | ok  |  7.12 | 1.21 Volts
CPU_FAN0         | B0h | ok  |  7.1 | 1400 RPM
CPU_FAN1         | B1h | ok  |  7.1 | 1500 RPM
SYS_FAN1         | B2h | ns  |  7.1 | No Reading
SYS_FAN2         | B3h | ok  |  7.1 | 3100 RPM
SYS_FAN3         | B4h | ok  |  7.1 | 3000 RPM
SYS_FAN4         | B5h | ns  |  7.1 | No Reading
SYS_FAN5         | B6h | ok  |  7.1 | 3100 RPM
SYS_FAN6         | B7h | ns  |  7.1 | No Reading

查看SEL事件中的传感器编号和名称

 ipmitool -I lanplus -H (IP地址) –U (用户名) –P (密码) sdr list

ipmitool> sdr list
Temp_CPU0        | no reading        | ns
Temp_CPU1        | no reading        | ns
Temp_CPU0_DIMM1  | no reading        | ns
Temp_CPU0_DIMM2  | no reading        | ns
Temp_CPU0_DIMM3  | no reading        | ns
Temp_CPU0_DIMM4  | no reading        | ns
Temp_CPU1_DIMM1  | no reading        | ns
Temp_CPU1_DIMM2  | no reading        | ns
Temp_CPU1_DIMM3  | no reading        | ns
Temp_CPU1_DIMM4  | no reading        | ns
Temp_BMC         | 35 degrees C      | ok
Temp_ENV         | 33 degrees C      | ok
Voltage_5VSB     | 5.15 Volts        | ok
Voltage_3VSB     | 3.36 Volts        | ok
Voltage_P5V      | 5.10 Volts        | ok
Voltage_P3V3     | 3.36 Volts        | ok
Voltage_P12V     | 12 Volts          | ok
Voltage_VBAT     | 2.79 Volts        | ok
Voltage_VCC_CPU0 | 1.80 Volts        | ok
Voltage_VCC_CPU1 | 1.80 Volts        | ok
Voltage_PVDDQ_AB | 1.21 Volts        | ok
Voltage_PVDDQ_CD | 1.21 Volts        | ok
Voltage_PVDDQ_EF | 1.21 Volts        | ok
Voltage_PVDDQ_GH | 1.21 Volts        | ok
CPU_FAN0         | 1400 RPM          | ok
CPU_FAN1         | 1500 RPM          | ok
SYS_FAN1         | no reading        | ns
SYS_FAN2         | 3100 RPM          | ok
SYS_FAN3         | 3000 RPM          | ok
SYS_FAN4         | no reading        | ns
SYS_FAN5         | 3100 RPM          | ok
SYS_FAN6         | no reading        | ns
Watchdog2        | 0x00              | ok

查看SELlog信息

 ipmitool -I lanplus -H (IP地址) –U (用户名) –P (密码) sel list

ipmitool> sel list
   1 | 01/01/2012 | 00:03:49 | System Event | Timestamp Clock Sync | Asserted
   2 | 10/30/2018 | 10:23:08 | System Event | Timestamp Clock Sync | Asserted

清除SELlog信息

 ipmitool -I lanplus -H (IP地址) –U (用户名) –P (密码) sel clean

查看FRU信息

 ipmitool -I lanplus -H (IP地址) –U (用户名) –P (密码) fru print

ipmitool> fru print
FRU Device Description : Builtin FRU Device (ID 0)
 Chassis Type          : Rack Mount Chassis
 Chassis Part Number   : S1451
 Board Mfg Date        : Wed Jan  1 14:40:00 2014
 Board Mfg             : MSI
 Board Product         : S1451
 Board Part Number     : MS-S1451
 Product Manufacturer  : EPS
 Product Name          : MSIS145
 Product Part Number   : MS-S145
 Product Version       : 1.0

FRU Device Description : AST2400-S1451   
 Chassis Type          : Rack Mount Chassis
 Chassis Part Number   : S1451
 Board Mfg Date        : Wed Jan  1 14:40:00 2014
 Board Mfg             : MSI
 Board Product         : S1451
 Board Part Number     : MS-S1451
 Product Manufacturer  : EPS
 Product Name          : MSIS145
 Product Part Number   : MS-S145
 Product Version       : 1.0

 

ipmitool

阅读数 340

没有更多推荐了,返回首页