zoukankan      html  css  js  c++  java
  • ipmi监控主机

    author: headsen   chen

    date: 2018-09-25  20:04:01

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

    1、安装:

    yum -y install OpenIPMI OpenIPMI-devel ipmitool freeipmi

    2、zabbix-server配置
    2.1 zabbix-server安装:加上:--with-openipmi参数
    2.2 修改配置文件:/usr/local/zabbix/etc/zabbix_server.conf

        # sed -i '/# StartIPMIPollers=0/aStartIPMIPollers=5' zabbix_server.conf
        # /etc/init.d/abbix-server restart

    3、获取详细的传感器信息: sensor

    # 参数 
       -I lanplus 固定用法:指定接口(不加这一个选项会报错)
       -H 指定主机 (管理网IP)
       -U 指定登陆主机的用户名 (登陆管理网的用户)
       -P 指定登陆主机的密码  (登陆管理网的用户) 
    [root@zabbix-test ~]# ipmitool -I lanplus -H 172.52.2.95 -U root -P calvin sensor  
    SEL              | na         | discrete   | na    | na        | na        | na        | na        | na        | na        
    Intrusion        | 0x0        | discrete   | 0x0080| na        | na        | na        | na        | na        | na        
    Fan1 RPM         | 5880.000   | RPM        | ok    | na        | 360.000   | 600.000   | na        | na        | na        
    Fan2 RPM         | 6000.000   | RPM        | ok    | na        | 360.000   | 600.000   | na        | na        | na        
    Fan3 RPM         | 5760.000   | RPM        | ok    | na        | 360.000   | 600.000   | na        | na        | na        
    Fan4 RPM         | 5760.000   | RPM        | ok    | na        | 360.000   | 600.000   | na        | na        | na        
    Fan5 RPM         | 5760.000   | RPM        | ok    | na        | 360.000   | 600.000   | na        | na        | na        
    Fan6 RPM         | 5880.000   | RPM        | ok    | na        | 360.000   | 600.000   | na        | na        | na        
    Inlet Temp       | 24.000     | degrees C  | ok    | na        | -7.000    | 3.000     | 42.000    | 47.000    | na        
    CPU Usage        | 0.000      | percent    | ok    | na        | na        | na        | 101.000   | na        | na        
    IO Usage         | 0.000      | percent    | ok    | na        | na        | na        | 101.000   | na        | na        
    MEM Usage        | 0.000      | percent    | ok    | na        | na        | na        | 101.000   | na        | na        
    SYS Usage        | 0.000      | percent    | ok    | na        | na        | na        | 101.000   | na        | na        
    Exhaust Temp     | 41.000     | degrees C  | ok    | na        | 0.000     | 0.000     | 70.000    | 75.000    | na        
    Temp             | 53.000     | degrees C  | ok    | na        | 3.000     | 8.000     | 82.000    | 87.000    | na        
    Temp             | 54.000     | degrees C  | ok    | na        | 3.000     | 8.000     | 82.000    | 87.000    | na        
    OS Watchdog      | 0x0        | discrete   | 0x0080| na        | na        | na        | na        | na        | na        
    VCORE PG         | 0x0        | discrete   | 0x0180| na        | na        | na        | na        | na        | na     

    配置静态IP

    定义 static 静态协议
         ipmitool lan set 1 ipsrc static
    
    配置 IPMI 地址
         ipmitool lan set 1 ipaddress <x.x.x.x>
    
    配置子网掩码
         ipmitool lan set 1 netmask <netmask>
    
    配置网关
       ipmitool lan set 1 defgw ipaddr <x.x.x.x>

    4、获取传感器仓库中所有的监控项和从传感器中读取的值 sdr (作用和上面的sensor一样的,后面加个list也可以,作用一样)

    [root@zabbix-test ~]# ipmitool -I lanplus -H 172.52.2.95 -U root -P calvin sdr  
    SEL              | Not Readable      | ns
    Intrusion        | 0x00              | ok
    Fan1 RPM         | 5760 RPM          | ok
    Fan2 RPM         | 5880 RPM          | ok
    Fan3 RPM         | 5760 RPM          | ok
    Fan4 RPM         | 5760 RPM          | ok
    Fan5 RPM         | 5760 RPM          | ok
    Fan6 RPM         | 5880 RPM          | ok
    Inlet Temp       | 24 degrees C      | ok
    CPU Usage        | 0 percent         | ok
    IO Usage         | 0 percent         | ok
    MEM Usage        | 0 percent         | ok
    SYS Usage        | 0 percent         | ok

    5、获取上面某个选项的具体的值,在上面命令的基础是哪个加上:get "Fan1 RPM"  (后面是具体的某个监控项名称)

    [root@zabbix-test ~]# ipmitool -I lanplus -H 172.52.2.95 -U root -P calvin sensor get "Fan1 RPM"
    Locating sensor record...
    Sensor ID              : Fan1 RPM (0x30)
     Entity ID             : 7.1 (System Board)
     Sensor Type (Threshold)  : Fan (0x04)
     Sensor Reading        : 5520 (+/- 120) RPM
     Status                : ok
     Nominal Reading       : 10080.000
     Normal Minimum        : 16680.000
     Normal Maximum        : 23640.000
     Lower critical        : 360.000
     Lower non-critical    : 600.000
     Positive Hysteresis   : 120.000
     Negative Hysteresis   : 120.000
     Minimum sensor range  : Unspecified
     Maximum sensor range  : Unspecified
     Event Message Control : Per-threshold
     Readable Thresholds   : lcr lnc
     Settable Thresholds   :
     Threshold Read Mask   : lcr lnc
     Assertion Events      :
     Assertions Enabled    : lnc- lcr-
     Deassertions Enabled  : lnc- lcr-

    6、查看底盘状态,其中包括了底盘电源信息,底盘工作状态等

    [root@zabbix-test-normal ~]# ipmitool -I lanplus -H 172.52.2.95 -U root -P calvin chassis status
    System Power         : on
    Power Overload       : false
    Power Interlock      : inactive
    Main Power Fault     : false
    Power Control Fault  : false
    Power Restore Policy : previous
    Last Power Event     :
    Chassis Intrusion    : inactive
    Front-Panel Lockout  : inactive
    Drive Fault          : false
    Cooling/Fan Fault    : false
    Sleep Button Disable : not allowed
    Diag Button Disable  : allowed
    Reset Button Disable : not allowed
    Power Button Disable : allowed
    Sleep Button Disabled: false
    Diag Button Disabled : true
    Reset Button Disabled: false
    Power Button Disabled: false

    7、远程开关机重启:

    ipmitool -I lanplus -H 172.52.2.95 -U root -P calvin chassis power on/off/reset

    8、查看BMC硬件信息

    [root@zabbix-test ~]# ipmitool -I lanplus -H 172.52.2.95 -U root -P calvin mc info
    Device ID                 : 32
    Device Revision           : 1
    Firmware Revision         : 2.30
    IPMI Version              : 2.0
    Manufacturer ID           : 674
    Manufacturer Name         : DELL Inc
    Product ID                : 256 (0x0100)
    Product Name              : Unknown (0x100)
    Device Available          : yes
    Provides Device SDRs      : yes
    Additional Device Support :
        Sensor Device
        SDR Repository Device
        SEL Device
        FRU Inventory Device
        IPMB Event Receiver
        Bridge
        Chassis Device
    Aux Firmware Rev Info     :
        0x00
        0x32
        0x1e
        0x1e

    9、列出BMC所允许的选项 mc getenables

    [root@zabbix-test ~]# ipmitool -I lanplus -H 172.52.2.95 -U root -P calvin mc getenables
    Receive Message Queue Interrupt          : disabled
    Event Message Buffer Full Interrupt      : disabled
    Event Message Buffer                     : enabled
    System Event Logging                     : enabled
    OEM 0                                    : disabled
    OEM 1                                    : disabled
    OEM 2                                    : disabled

    10、显示本机的管理网信息 lan print

    其他机器的管理网信息 # ipmitool -I lanplus -H 172.19.24.101 -U admin -P admin lan print
    [root@zabbix-test ~]# ipmitool -I lanplus -H 172.52.2.95 -U root -P calvin lan print Set in Progress : Set Complete Auth Type Support : MD5 Auth Type Enable : Callback : MD5 : User : MD5 : Operator : MD5 : Admin : MD5 : OEM : IP Address Source : Static Address IP Address : 172.52.2.95 Subnet Mask : 255.255.255.0 MAC Address : 18:fb:7b:a4:fb:9f SNMP Community String : public 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 : 172.52.2.254 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,4,5,6,7,8,9,10,11,12,13,14 Cipher Suite Priv Max : Xaaaaaaaaaaaaaa : X=Cipher Suite Unused : c=CALLBACK : u=USER : o=OPERATOR : a=ADMIN : O=OEM

     11、设置主机从pxe启动:

    ipmitool -H 172.52.2.117 -I lanplus -U USER -P PASSW0RD chassis bootdev pxe

    设置远程主机的bmc重启

     ipmitool -I lanplus -H 172.25.84.24 -U admin -P admin mc reset cold

    设置Dell的机器bmc网卡自动dhcp启动

    racadm set idrac.ipv4.DHCPEnable enabled     (待检测 )
    ipmitool -I lanplus -H 10.0.0.1 -U root -P calvin  lan set 1 ipsrc dhcp    (实测可用的)

    12、查询远程Dell主机的mac地址

    [root@zabbix-test ~]# ipmitool -I lanplus -H 172.52.2.95 -U root -P calvin delloem mac
    
    System LOMs
    NIC Number    MAC Address        Status
    
    0        14:18:77:58:4a:09    Enabled
    1        14:18:77:58:4a:0a    Enabled
    2        14:18:77:58:4a:07    Enabled
    3        14:18:77:58:4a:08    Enabled
    
    iDRAC8 MAC Address 18:fb:7b:a4:fb:9f

    13、远程获取HP主机的mac地址

    [root@a mnt]# curl -s -k https://172.52.1.172/xmldata?item=all |grep '<MACADDR>' |awk -F">" '{print $2}' |awk -F"<" '{print $1}'
    f4:03:43:47:ab:0c
    f4:03:43:47:ab:0d
    f4:03:43:4b:9f:d8
    f4:03:43:4b:9f:d9
    f4:03:43:4b:9f:da
    f4:03:43:4b:9f:db
    98:f2:b3:20:37:20
    98:f2:b3:20:37:24
    [root@a mnt]# curl -s -k https://172.52.1.172/xmldata?item=all|grep -A3 "HP FlexFabric 10Gb 2port 534FLR-SFP+ Adapter"|grep MACADDR|awk -F">" '{print $2}'|awk -F"<" '{print $1}'|head -n 1
    98:f2:b3:20:37:20
    [root@a mnt]# curl -s -k https://172.52.1.172/xmldata?item=all|grep -A3 "HP FlexFabric 10Gb 2port 534FLR-SFP+ Adapter"|grep MACADDR|awk -F">" '{print $2}'|awk -F"<" '{print $1}'
    98:f2:b3:20:37:20
    98:f2:b3:20:37:24

    浪潮的机器获取mac地址:
    [root@PXE-server mnt]# ipmitool -I lanplus -H 172.19.24.23 -U root -P duduadmin raw 0x3c 0x02 0x06 0x00  0x00
     06 00 00 00 01 00 01 00 03 02 6c 92 bf 66 7e bc
     6c 92 bf 66 7e bd 00 00 00 00 00 00 00 00 00 00
     00 00
    
    
    #!/bin/bash
     
    HOST=$1
    USER=$2
    PASSWD=$3
     
    function getinfo()
    {
    # 1. 获取到服务器的网络配置信息
    echo -e " =======Networking Configurations:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan print
    # 2.获取到服务器的温度信息
    echo -e " =======Ambient Temprature:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr get "Ambient Temp"
    # 3.获取到服务器的功率信息
    echo -e " =======System Level:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr get "System Level"
     
    # 4.获取到服务器的序列号信息
    echo -e " =======Serial Number(Fru):"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD fru
    # 5.获取到服务器的MAC
    echo -e " =======Mac Address(only Dell):"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD delloem mac
     
    # 6.获取到服务器的资产号信息
    echo -e " =======Serial Number(Fru):"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr get "System Level"
     
    # 7.获取到服务器的管理卡的时间
    echo -e " =======Date and Time:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sel time get
    # 8.查看管理卡配置模式
    echo -e " =======Lan set Mode:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD delloem lan get
    # 9.查看SOL波特率
    echo -e " =======Volatile Bit Rate (kbps):"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol info 1
    }
     
    function operation()
    {
    # 1.服务器开机、关机、重启
    echo -e " =======Power:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD power
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD power status
     
    # 2.服务器添加用户、设置密码、授予权限
    echo -e " =======USER:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD user list 1
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD user set name 10 test1
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD user set password 10 test1pwd
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD user enable 10
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD user list 1
    # 1-CALLBACK ,2-USER ,3-OPERATOR ,4-ADMNISTRATOR
    echo -e " =======User privilage:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD user priv 10 4 1
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD user list 1
     
    # 3.管理卡IP配置模式转换(DHCP/静态IP)
    echo -e " =======OOB IP Mode:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan set 1 ipsrc
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan set 1 ipsrc static
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan print
     
    # 4.管理卡修改IP地址
    echo -e " =======Set IP:"
    read -p "modify oob ip, please use the current network : " oobip
    read -p "modify oob netmask : " netmask
    read -p "modify oob gateway : " oobgw
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan set 1 ipaddr $oobip
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan set 1 netmask $netmask
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan set 1 defgw ipaddr $oobgw
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan print
     
    # 5.管理卡配置模式转换(独立/共享) 仅dell
    echo -e " =======Lan Mode:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD delloem lan
    #ipmitool -I lan -H HOSTU
     
     
    USER -P $PASSWD delloem lan set dedicated
     
    # 6.设置SOL波特率
    echo -e " =======Sol volatile-bit-rate:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol set non-volatile-bit-rate 115.2 1
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol info 1
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol set non-volatile-bit-rate 57.6 1
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol info 1
     
    # 7.SOL模式开启、关闭
    echo -e " =======Sol enable and disable:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol set enabled true 1
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol info 1
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol set enabled false 1
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sol info 1
    }
     
    function extrainfo()
    {
    echo -e " =======Extra infomation:"
    # cpu信息
    echo -e " =======cpu型号:"
    echo -e " =======cpu物理个数:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr elist | grep 'Status' #华为提供,貌似不准确
    echo -e " =======cpu当前频率:"
     
    #内存信息
    echo -e " =======内存型号:"
    echo -e " =======内存数量:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr elist | grep 'DIMM'
     
    #硬盘信息
    echo -e " =======硬盘品牌:"
    echo -e " =======硬盘SN:"
    echo -e " =======硬盘型号:"
     
    #电力
    echo -e " =======服务器当前整体功耗:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr get "Pwr"
    echo -e " =======服务器交流实际供电电压:"     #不支持或未找到
    echo -e " =======服务器直流3.3V,5V和12V实际供电电压:"
     
    #风扇
    echo -e " =======风扇数量和转速:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr get "Fan"
     
    #温度
    echo -e " =======服务器进风口温度:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr get "Inlet"
    echo -e " =======服务器出风口温度:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr get "Exhaust Temp"
    echo -e " =======CPU当前温度:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sdr get "Temp"
     
    #状态:基于收集信息异常状态的记录及展示
    echo -e " =======基于收集信息异常状态的记录及展示:"
     
    #网络:Mac地址
    echo -e " =======远程管理卡以及主板上所有网口的MAC地址:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD lan print |grep "MAC Address"
     
    #时间:收集管理卡当前时钟信息,以“年月日时分秒”格式显示。
    echo -e " =======收集管理卡当前时钟信息,以“年月日时分秒”格式显示。:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sel time get
     
    #事件:异常事件、操作事件、登录事件记录
    echo -e " =======异常事件、操作事件、登录事件记录:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sel list
     
    }
     
    function extraop()
    {
    #通过网络,命令行模式完成以下功能:
     
    #1, 指定特定端口PXE启动
    echo -e " =======指定特定端口PXE启动:"
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD chassis bootdev pxe   #不能指定特定端口,端口指定可借助racadm等工具实现,网卡的pxe功能需要在bios中开启
     
    #2, 可通过管理卡启动KVM(无需登录web界面),并有相关的权限区分(可看,可操作等多种权限)
    echo -e " =======可通过管理卡启动KVM(无需登录web界面),并有相关的权限区分(可看,可操作等多种权限):" #Need config SSO, 虚拟控制台或者VNC免登陆方式
     
    #可以设置管理卡的时钟、使用“年月日时分秒”格式。
    echo -e " =======可以设置管理卡的时钟、使用 年月日时分秒 格式。" #dell反馈管理卡没有时间设置,只有BIOS时间和NTP
    ipmitool -I lan -H $HOST -U $USER -P $PASSWD sel time set
    }
     
     
    echo >$HOST-report.txt
    getinfo 2>&1 |tee -a $HOST-report.txt
    operation 2>&1 |tee -a $HOST-report.txt
    extrainfo 2>&1 |tee -a $HOST-report.txt
    extraop 2>&1 | tee -a $HOST-report.txt
     
    --------------------------------------------------------------------------------------------------------------------------------------
    网友的ipmitools用法
    原文链接:https://www.cnblogs.com/zhangxinglong/p/5012441.html
     

    一、开关机,重启

    1. 查看开关机状态:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) power status

    2. 开机:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) power on

    3. 关机:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) power off

    4. 重启:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) power reset

    二、用户管理

    说明:[ChannelNo] 字段是可选的,ChannoNo为1或者8;BMC默认有2个用户:user id为1的匿名用户,user id为2的ADMIN用户;<>字段为必选内容;<privilege level>:2为user权限,3为Operator权限,4为Administrator权限;

    1. 查看用户信息:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) user list [ChannelNo]

    2. 增加用户:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) user set name <user id> <username>

    3. 设置密码:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) user set password <user id> <password>

    4. 设置用户权限:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) user priv <user id> <privilege level> [ChannelNo]

    5. 启用/禁用用户:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) user enable/disable <user id>

    三、IP网络设置

    说明:[ChannelNo] 字段是可选的,ChannoNo为1(Share Nic网络)或者8(BMC独立管理网络);设置网络参数,必须首先设置IP为静态,然后再进行其他设置;

    1. 查看网络信息:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) lan print [ChannelNo]

    2. 修改IP为静态还是DHCP模式:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) lan set <ChannelNo> ipsrc <static/dhcp>

    3. 修改IP地址:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) lan set <ChannelNo> ipaddr <IPAddress>

    4. 修改子网掩码:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) lan set <ChannelNo> netmask <NetMask>

    5. 修改默认网关:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) lan set <ChannelNo> defgw ipaddr <默认网关>

    四、SOL功能

    说明:<9.6/19.2/38.4/57.6/115.2>其中115.2代表115200,即*1000是表示的波特率。

    1. 设置SOL串口波特率:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) sol set volatile-bit-rate <9.6/19.2/38.4/57.6/115.2>

    2. 打开SOL功能:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) sol activate

    3. 关闭SOL功能:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) sol deactivate

    五、SEL日志查看

    1. 查看SEL日志:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) sel list

    六、FRU信息查看

    1. 查看FRU信息:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) fru list

    七、SDR,Sensor信息查看

    1. 查看SDR Sensor信息:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) sdr

    2. 查看Sensor信息:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) sensor list

    八、mc(管理单元BMC)状态和控制

    1. 重启动BMC:

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) mc reset <warm/cold>

    九、设置BMC的iptables防火墙

    1. 设置某一段IP可以访问BMC

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) raw 0x32 0x76 0x01 0x01 ip1(0xa 0xa 0xa 0xa) ip2(0xb 0xb 0xb 0xb)

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) raw 0x32 0x76 0x09

    2. 设置某个IP可以访问BMC

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) raw 0x32 0x76 0x00 0x01 ip1(0xa 0xa 0xa 0xa)

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) raw 0x32 0x76 0x09

    3. 取消设置

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) raw 0x32 0x76 0x08

    4.获取防火墙设置

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) raw 0x32 0x77 0x01 0x00

    5. 阻止/开启某个端口

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) raw 0x32 0x76 0x02 0x00/0x01 0x00 (portno)0x22 0x00

    6. 取消某个端口的设置(6是5的对应取消操作)

    ipmitool -H (BMC的管理IP地址) -I lanplus -U (BMC登录用户名) -P (BMC 登录用户名的密码) raw 0x32 0x76 0x06 0x00/0x01 0x00 (portno)0x22 0x00

     
     
     
     
     
     
     
     
  • 相关阅读:
    scala文件读取报错“java.nio.charset.MalformedInputException: Input length = 1”
    关于sparksql操作hive,读取本地csv文件并以parquet的形式装入hive中
    区别window.location.Reload()和window.location.href=window.location.href;
    datagrid GridView Repeater 绑定 序号 逐一递增的实现
    品牌机用Vista光盘分区
    网络路径结点回溯分析工具
    几种流行的AJAX框架jQuery,Mootools,Dojo,Ext JS的对比
    Ubuntu Linux 设置
    sql server中为某个整数前加上一定数量的0,如1,要返回00001
    本地测试域名
  • 原文地址:https://www.cnblogs.com/kaishirenshi/p/9703127.html
Copyright © 2011-2022 走看看