Dell CentOS 环境下安装远程管理命令racadm

好久不见. 提交于 2019-11-26 00:31:21

参考文档:
https://juejin.im/post/5cac582cf265da036504daac
https://www.jianshu.com/p/3a57f235916c
http://www.softpanorama.org/Hardware/Dell/Servers/DRAC/racadm_command_line_interface.shtml
http://www.softpanorama.org/Hardware/Dell/Servers/DRAC/racadm_command_line_interface.shtml#n20141008X_racadm_command_line_interface_for_drac_systems_management_wiki_systems_management
http://jaseywang.me/2013/05/15/%E4%BD%BF%E7%94%A8-racadm-%E7%AE%A1%E7%90%86%E8%BF%9C%E7%A8%8B%E5%8D%A1/
https://www.dell.com/support/manuals/cn/zh/cndhs1/idrac7-8-with-lc-v2.20.20.20/idrac_racadm_pub-v3/racadm-subcommand-details?guid=guid-cd4e81e6-818c-44fb-9e7a-82950425fbbb&lang=en-us


远程管理DELL服务器可通过IPMI或者OMSA的方式。

Dell OpenManage Server Administrator (OMSA)

  • 通过基于网页浏览器的集成图形用户界面(GUI)
  • 通过基于操作系统(OS)的命令行界面(CLI)

Dell RACADM(远程访问控制器管理)实用程序是一个命令行工具,允许通过iDRAC或DRAC远程或本地管理Dell服务器。
RACADM提供与iDRAC / DRAC图形用户界面(GUI)类似的功能,还可以使用RACADM远程管理Dell Chassis Management Controller(CMC)。
RACADM命令可以从管理站远程运行和/或在受管系统上本地运行。
RACADM命令允许您查看受管系统信息,在受管系统上执行电源操作,执行固件更新,配置设置等。由于RACADM是从命令行界面(CLI)运行的,因此系统管理员可以创建以一对多方式控制和更新Dell系统的脚本。

术语

  • 受管系统 - 包含iDRAC或DRAC的Dell PowerEdge服务器,或包含机箱管理控制器(CMC)的Dell Blade Chassis。
  • Management Station - 用于远程访问iDRAC,DRAC或CMC的计算机。
  • iDRAC - 集成的戴尔远程访问控制器。适用于新一代和现有的Dell PowerEdge服务器(11G和12G)。
  • DRAC - 戴尔远程访问控制器。适用于老一代的Dell PowerEdge服务器。

安装

1、安装依赖包
联网YUM安装必须的基本组件,主要是SNMP客户端,如果不打算用于监控,可忽略,wget,perl 是OMSA安装需用到的,自RHEL/CentOS 6.4后的2.6.32.358内核变动,所以要额外安装一个 OpenIPMI 包,否则OMSA无法正常启动。软件包注意区分大小写

yum install -y net-snmp net-snmp-devel net-snmp-utils wget perl OpenIPMI

2、安装racadm
方式一:
Linux 环境可以使用 Dell的源进行yum安装,如下
#可参考 http://zh.community.dell.com/techcenter/systems-management/w/wiki/561.omsalinux

wget -q -O - http://linux.dell.com/repo/hardware/latest/bootstrap.cgi | bash 
yum  -y install srvadmin-all

# 启动服务,只有安装在物理机上才可启动
/opt/dell/srvadmin/sbin/srvadmin-services.sh start 
# 创建软连接
ln -s /opt/dell/srvadmin/sbin/racadm /usr/sbin/racadm

报错:

Error: Package: openwsman-server-2.6.3-6.git4391e5c.el7_6.x86_64 (updates)
           Requires: libruby.so.2.0()(64bit)
           Available: ruby-libs-2.0.0.648-33.el7_4.x86_64 (base)
               libruby.so.2.0()(64bit)
           Available: ruby-libs-2.0.0.648-34.el7_6.x86_64 (updates)
               libruby.so.2.0()(64bit)
           Available: ruby-libs-2.0.0.648-35.el7_6.x86_64 (updates)
               libruby.so.2.0()(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

解决方法:

wget https://rpmfind.net/linux/mageia/distrib/5/x86_64/media/core/updates/lib64ruby2.0-2.0.0.p648-1.6.mga5.x86_64.rpm
rpm -ivh lib64ruby2.0-2.0.0.p648-1.6.mga5.x86_64.rpm

#安装好重新yum安装即可。

方式二:

cd /data/packages/
wget https://downloads.dell.com/FOLDER05223994M/1/OM-MgmtStat-Dell-Web-LX-9.2.0-3142_A00.tar.gz
tar zxvf OM-MgmtStat-Dell-Web-LX-9.2.0-3142_A00.tar.gz
cd /data/packages/linux/rac
# 运行安装程序
sh install_racadm.sh
# 创建软连接
ln -s /opt/dell/srvadmin/sbin/racadm /usr/sbin/racadm

安装后在/opt/dell/srvadmin/sbin/racadm位置


使用

主要是使用的命令有 omreport、omconfig 和 racadm。

omreport命令示例:

/opt/dell/srvadmin/bin/omreport chassis                     # 显示所有主要组件的常规状态 
/opt/dell/srvadmin/bin/omreport chassis memory              # 显示内存信息
/opt/dell/srvadmin/bin/omreport chassis temps             # 显示系统主要组件的温度
/opt/dell/srvadmin/bin/omreport storage adisk controller=0  # 查看磁盘陈列中的硬盘状态
/opt/dell/srvadmin/bin/omreport storage pdisk controller=0  # 查看物理磁盘信息
/opt/dell/srvadmin/bin/omreport storage vdisk controller=0  # 查看虚拟硬盘的状态
/opt/dell/srvadmin/bin/omreport storage controller          # 查看控制器(即RAID卡)的属性
/opt/dell/srvadmin/bin/omreport storage channel controller=0    # 查看通道的属性
/opt/dell/srvadmin/bin/omreport storage enclosure controller=0  # 查看enclosure的属性
/opt/dell/srvadmin/bin/omreport storage battery                 # 查看电池属性

如果要控制远程服务器,可以使用 racadm, 命令示例如下:

#参考文档
#http://www.dell.com/support/manuals/cn/zh/cnbsd1/idrac8-with-lc-v2.05.05.05/racadm_idrac_pub-v1/introduction?guid=guid-6b6564ab-ee63-49ef-a7d6-47154c343841&lang=en-us

racadm语法

racadm -r <racIpAddr> -u <username> -p <password> <subcommand> 
racadm -r <racIpAddr> -u <username> -p <password> get <devicename>.<groupname>.[<index>].[<objectname>]
racadm -r <racIpAddr> -u <username> -p <password> set <devicename>.<groupname>.[<index>].<objectname> <value>

* -r <racIpAddr>[  : <port number> ]   :指定IDRAC  IP,端口号默认是443
* -u  <username>                       : IDRAC用户名
* -p  <password>                       : IDRAC密码
* -S                                   :安全认证无效时停止命令执行(所有正常执行命令基本都包含无效认证安全警告,非需求时不要配置此选项)
* -i                                   :交互式登陆,手动输入账号密码;和-u、-p选项不能同时使用。
* --nocertwarn                         :忽略认证相关警告信息

racadm常用命令

# 监视和清点连接到服务器的H/W NICs(硬件信息比较全)
racadm -r 10.10.10.8 -u root -p xxxx hwinventory

# 获取系统信息
racadm -r 10.10.10.8 -u root -p xxxx getsysinfo

# 获取IP信息
racadm -r 10.10.10.8 -u root -p xxxx getniccfg

# 获取IP信息(包含DNS)
racadm -r 10.10.10.8 -u root -p xxxx getconfig -g cfgLanNetworking
racadm -r 10.10.10.8 -u root -p xxxx set idrac.ssh.port 22
racadm -r 10.10.10.8 -u root -p xxxx --nocertwarn get idrac.ssh.port

硬件资源:
racadm get BIOS.memSettings.SysMemSize     # 获取内存大小
racadm get BIOS.MemSettings.SysMemSpeed    # 获取内存工作速率
racadm get BIOS.MemSettings.SysMemType  # 获取内存类型

BIOS相关:
racadm get BIOS.MiscSettings.ErrPrompt   #  错误提示状态:
racadm set BIOS.MiscSettings.ErrPrompt Disabled # 关闭错误提示 
racadm get BIOS.BiosBootSettings.BootMode(默认BIOS,另有UEFI) # BIOS启动模式: 
racadm get BIOS.BiosBootSettings.BootSeq  # 系统启动顺序: 
racadm set BIOS.BiosBootSettings.BootSeq NIC.Integrated.1-1-1,HardDisk.List.1-1,Optical.SATAEmbedded.E-1  # 更改系统启动顺序:
jobqueue create BIOS.Setup.1-1  # 提交BIOS objects job:
racadm get BIOS.SysInformation.SystemServiceTag   # 获取sn: 
racadm get BIOS.SysInformation. SystemModelName   # 获取型号:
racadm get BIOS.SysInformation. SystemBiosVersion  # 获取bios版本: 

网卡相关:
racadm getsysinfo -s ( racadm nicstatistics | racadm racdump )  # 获取网卡mac: 
racadm get nic.NICConfig.3.LegacyBootProto  # 获取网卡3是否开启pxe:
racadm set nic.NICConfig.3.LegacyBootProto PXE # 启用网卡pxe: 
racadm jobqueue create NIC.Integrated.1-3-1 # PXE配置应用生效: 
racadm jobqueue create NIC.Integrated.1-1 -r pwrcycle -s TIME_NOW -e 20120501100000    #  提交NIC objects job:

磁盘相关:
racadm storage get pdisks     #  获取物理磁盘: 
racadm storage get vdisks -o [ -p status,size,layout,state ]  #   获取虚拟磁盘信息: 

raid相关:
racadm storage get controllers   # 获取raid控制器: 
racadm storage get controllers -o -p name,status   # 获取raid控制器属性name、status: 
racadm storage resetconfig:RAID.Integrated.1-1   # 删除所有raid: 
racadm jobqueue create RAID.Integrated.1-1 -s TIME_NOW -r none ( forced | pwrcycle | graceful) [ -—realtime ]  #  提交storage作业: 
racadm storage createvd:RAID.Integrated.1-1 -rl r5 -size 300g  -pdkey:Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1,Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1,Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1 #  创建raid5,分配300G做系统:
racadm storage createvd:RAID.Integrated.1-1 -rl r5 -pdkey:Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1,Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1,Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1  #  创建raid5: 

用户相关:
    注:数字2、15为用户ID。
racadm get idrac.users.2    # 查看用户信息:
racadm set idrac.users.15.username chenss  #  添加用户:
racadm set idrac.users.15.password wuyancs #   设置密码:
racadm set idrac.users.15.Privilege 0x1ff   # 设置为idrac管理员:
racadm set idrac.users.15.enable enabled    # 启用用户:

日志相关:
racadm get System.LCD.CurrentDisplay  #   获取前置面板LCD显示信息:

系统相关:
racadm serveraction powerup  #  开机: 
racadm serveraction powerdown  #  关机: 
racadm serveraction powercycle  #  重启: 
racadm serveraction powerstatus  #  状态: 
racadm get iDRAC.SNMP   # 获取idrac snap info:

获取帮助信息

# SSH 到远程服务器
[root@localhost /]# ssh root@10.10.10.8
root@10.10.254.8's password:

-----

/admin1-> racadm help

 help                 -- Display list of RACADM sub commands with help string
 help [subcommand]    -- display usage summary for a subcommand
 arp                  -- display the networking ARP table
 autoupdatescheduler  -- Automatic Platform Update of the devices on the server.
 clearasrscreen       -- clear the last ASR (crash) screen
 clearpending         -- clear pending attribute(s) value of a Device Class
 closessn             -- close a session
 clrsel               -- clear the System Event Log (SEL)
 config               -- Deprecated: modify RAC configuration properties
 coredump             -- display the last RAC coredump
 coredumpdelete       -- delete the last RAC coredump
 debug                -- Field Service Debug Authorization facility commands
 eventfilters         -- Alerts configuration commands
 fwupdate             -- update the RAC firmware
 get                  -- display RAC configuration properties
 getconfig            -- Deprecated: display RAC configuration properties
 gethostnetworkinterfaces -- Display host network interface details
 getled               -- Get the state of the LED on a module.
 getniccfg            -- display current network settings
 getraclog            -- display the RAC log
 getractime           -- display the current RAC time
 getsel               -- display records from the System Event Log (SEL)
 getsensorinfo        -- display system sensors
 getssninfo           -- display session information
 getsvctag            -- display service tag information
 getsysinfo           -- display general RAC and system information
 gettracelog          -- display the RAC diagnostic trace log
 getuscversion        -- Deprecated: display the current USC version details
 getversion           -- display the current version details
 ifconfig             -- display network interface information
 inlettemphistory     -- inlet temperature history operations
 license              -- License Manager commands
 lclog                -- LCLog operations
 frontpanelerror      -- hide LCD errors - color amber to blue
 netstat              -- display routing table and network statistics
 ping                 -- send ICMP echo packets on the network
 ping6                -- send ICMP echo packets on the network
 racdump              -- display RAC diagnostic information
 racreset             -- perform a RAC reset operation
 racresetcfg          -- restore the RAC configuration to factory defaults
 remoteimage          -- make a remote ISO image available to the server
 rollback             -- Rollback firmware to its previous version.
 serveraction         -- perform system power management operations
 set                  -- modify RAC configuration properties
 setled               -- Set the state of the LED on a module.
 setniccfg            -- modify network configuration properties
 sshpkauth            -- manage SSH PK authentication keys on the RAC
 sslcertdelete        -- delete an SSL certificate on the iDRAC
 sslcertview          -- view SSL certificate information
 sslcsrgen            -- generate a certificate CSR from the RAC
 sslencryptionstrength -- Deprecated: Display or modify the SSL Encryption strength.
 sslresetcfg          -- Reset iDRAC to apply new certificate. Until iDRAC is reset old certificate will be active.
 swinventory          -- Display the list of S/W Installed on the server.
 systemconfig         -- Backup &/or Restore of iDRAC Config and Firmware
 systemerase          -- Performs system erase on a selected component.
 testemail            -- test RAC e-mail notifications
 testtrap             -- test RAC SNMP trap notifications
 testalert            -- test RAC SNMP - FQDN trap notifications
 traceroute           -- print the route packets trace to network host
 traceroute6          -- print the route packets trace to network host
 techsupreport        -- Tech Support Report operations.
 usercertview         -- view user certificate information
 vflashpartition      -- manage partitions on the vFlash SD card
 vflashsd             -- perform vFlash SD Card initialization
 vmdisconnect         -- disconnect Virtual Media connections
 raid                 -- Monitoring and Inventory of H/W RAID connected to the server.
 storage              -- Monitoring and Inventory of H/W RAID connected to the server.
 hwinventory          -- Monitoring and Inventory of H/W NICs connected to the server.
 nicstatistics        -- Statistics for NICs connected to the server.
 fcstatistics         -- Statistics for FCs connected to the server.
 update               -- Platform Update of the devices on the server
 jobqueue             -- Jobqueue of of the jobs currently scheduled
 sensorsettings       -- Set the sensor threshold levels.
 diagnostics          -- Remote Diagnostic commands
 systemperfstatistics -- Display or Modify System Performance Statistics

 Groups

 BIOS                -- Configuration of BIOS attributes
 iDRAC               -- Configuration of iDRAC attributes
 LifecycleController -- Configuration of LifecycleController attributes
 Nic                 -- Configuration of NIC attributes
 Storage             -- Configuration of Storage attributes
 System              -- Configuration of System attributes
 FC                  -- Configuration of Fiber Channel attributes

For Help on configuring the properties of a group - racadm help set

-----------------------------------------------------------------------

racadm子命令帮助信息

/admin1-> racadm storage help get pdisks
Storage monitoring and inventory of hardware RAID connected to the system.

Usage :

racadm storage get status
racadm storage help <Object type I/II>
racadm storage get <Object type I>
racadm storage get <Object type I> -current
racadm storage get <Object type I> -pending
racadm storage get <Object type I> -o
racadm storage get <Object type I> -o -p <property names separated by comma>
racadm storage get <Object type I>:<FQDD's of Object type I separated by comma> -p
<property names separated by comma>
racadm storage get <Object type I>:<FQDD's of Object type I separated by comma>
racadm storage get <Object type II> --refkey <reference keys separated by comma>
racadm storage get <Object type II> --refkey <reference keys separated by comma> -o
racadm storage get <Object type II> --refkey <reference keys separated by comma> -o
 -p <property names separated by comma>

--------------------------------------------------------------------------------

Valid Options:

Object type I      : controllers, batteries, vdisks, pdisks, fans, emms, tempprobes
,psus, enclosures.
Object type II     : batteries, vdisks, pdisks, fans, emms, psus, tempprobes, enclosures.
-current <optional>: Displays only the current Raid objects from storage.If -pen
ding not mentioned it will consider as the default option
-pending           : Displays only the Pending Raid Objects from Storage.
-o                 : Displays all the properties of the selected Key or Object.
-p                 : Displays the property names with filter.
FQDD's             : Displays all the properties of the FQDD's Key.
--refkey           : Displays all the reference key of Object type.
help               : Displays each object type help.

NOTE: Maximum Property names can be specified in -p option is = 10.

NOTE: Maximum FQDD's or refkey can be specified is = 3.

--------------------------------------------------------------------------------

Usage Examples :

racadm storage get controllers
racadm storage get psus
racadm storage get controllers -o
racadm storage get controllers -o -current
racadm storage get controllers -o -pending
racadm storage get enclosures -o
racadm storage get controllers -o -p name,status
racadm storage get vdisks -o -p layout,status
racadm storage get controllers:RAID.INTEGRATED.0
racadm storage get emms:EMM.Slot.0:ENCLOSURE.EXTERNAL.0-0:RAID.INTEGRATED
.0
racadm storage get controllers:RAID.INTEGRATED.0 -p status
racadm storage get emms:EMM.Slot.0:ENCLOSURE.EXTERNAL.0-0:RAID.INTEGRATED
.0 -p status
racadm storage get batteries --refkey RAID.INTEGRATED.0
racadm storage get pdisks --refkey ENCLOSURE.EXTERNAL.0-0:RAID.INTEGRATED.0
racadm storage get batteries --refkey RAID.INTEGRATED.0 -o -p status,state,name
racadm storage get fans --refkey RAID.INTEGRATED.0 -o -p status,speed,name

racadm常用子命令:

内存相关:

  • 获取内存大小: racadm get BIOS.memSettings.SysMemSize
  • 获取内存工作速率: racadm get BIOS.MemSettings.SysMemSpeed
  • 获取内存类型: racadm get BIOS.MemSettings.SysMemType

磁盘相关:

  • 获取物理磁盘:racadm storage get pdisks -o [ -p status,size,layout,state ]
  • 获取虚拟磁盘信息:racadm storage get vdisks -o [ -p status,size,layout,state ]

BIOS相关:

  • 错误提示状态:racadm get BIOS.MiscSettings.ErrPrompt
  • 关闭错误提示: racadm set BIOS.MiscSettings.ErrPrompt Disabled
  • BIOS启动模式: racadm get BIOS.BiosBootSettings.BootMode(默认BIOS,另有UEFI)
  • 系统启动顺序: racadm get BIOS.BiosBootSettings.BootSeq
  • 更改系统启动顺序:racadm set BIOS.BiosBootSettings.BootSeq NIC.Integrated.1-1-1,HardDisk.List.1-1,Optical.SATAEmbedded.E-1
  • 提交BIOS objects job:jobqueue create BIOS.Setup.1-1
  • 获取sn: racadm get BIOS.SysInformation.SystemServiceTag
  • 获取型号: racadm get BIOS.SysInformation. SystemModelName
  • 获取bios版本: racadm get BIOS.SysInformation. SystemBiosVersion

网卡相关:

  • 获取网卡mac: racadm getsysinfo -s ( racadm nicstatistics | racadm racdump )
  • 获取网卡3是否开启pxe:racadm get nic.NICConfig.3.LegacyBootProto
  • 启用网卡pxe: racadm set nic.NICConfig.3.LegacyBootProto PXE
  • PXE配置应用生效: racadm jobqueue create NIC.Integrated.1-3-1
  • 提交NIC objects job:racadm jobqueue create NIC.Integrated.1-1 -r pwrcycle -s TIME_NOW -e 20120501100000

磁盘相关:

  • 获取物理磁盘: racadm storage get pdisks
  • 获取虚拟磁盘信息: storage get vdisks -o [ -p status,size,layout,state ]

raid相关:

  • 获取raid控制器: racadm storage get controllers
  • 获取raid控制器属性name、status: racadm storage get controllers -o -p name,status
  • 删除所有raid: racadm storage resetconfig:RAID.Integrated.1-1
  • 提交storage作业: racadm jobqueue create RAID.Integrated.1-1 -s TIME_NOW -r none ( forced | pwrcycle | graceful) [ -—realtime ]
  • 创建raid5,分配300G做系统: racadm storage createvd:RAID.Integrated.1-1 -rl r5 -size 300g -pdkey:Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1,Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1,Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1
  • 创建raid5: racadm storage createvd:RAID.Integrated.1-1 -rl r5 -pdkey:Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1,Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1,Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1

用户相关:

  • 查看用户信息:racadm get idrac.users.2
  • 添加用户:racadm set idrac.users.15.username chenss
  • 设置密码:racadm set idrac.users.15.password wuyancs
  • 设置为idrac管理员:racadm set idrac.users.15.Privilege 0x1ff
  • 启用用户:racadm set idrac.users.15.enable enabled
  • 注:数字2、15为用户ID。

IP相关:

  • 获取idrac ip info: racadm get iDRAC.IPv4[ Address | Static | Gateway ]
  • 修改 IP: racadm setniccfg -s 192.168.1.2 255.255.255.0 192.168.1.1
  • 或者像这样分开设置:
    racadm config -g cfgLanNetworking -o cfgNicEnable 1
    racadm config -g cfgLanNetworking -o cfgNicIpAddress 192.168.1.2
    racadm config -g cfgLanNetworking -o cfgNicNetmask 255.255.255.0
    racadm config -g cfgLanNetworking -o cfgNicGateway 192.168.1.1
    racadm config -g cfgLanNetworking -o cfgNicUseDhcp 0
  • 或者先获取关于 RAC 的所有信息: racadm getconfig -f rac.cfg

日志相关:

  • 获取前置面板LCD显示信息:racadm get System.LCD.CurrentDisplay

系统相关:

racadm serveraction <action>

而您将<action>替换为以下之一:

  • 开机: racadm serveraction powerup
  • 关机: racadm serveraction powerdown
  • 重启(在受管系统上发出电源循环操作): racadm serveraction powercycle
  • 显示服务器的当前电源状态 (“ON”, or “OFF”): racadm serveraction powerstatus
  • 在受管系统上执行重置(重新引导)操作: racadm serveraction hardreset
  • 获取idrac snap info:racadm get iDRAC.SNMP

如果您的Drac因任何原因崩溃,您可能需要重置它:
racadm racreset

备注:提交作业时,perc8的卡(H710)是不支持realtime参数的;realtime参数是从perc9(H730)才开始支持。

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!