參考文檔:
http://www.javashuo.com/article/p-kaoipjhy-bs.html
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-ushtml
遠程管理DELL服務器可經過IPMI或者OMSA的方式。linux
Dell RACADM(遠程訪問控制器管理)實用程序是一個命令行工具,容許經過iDRAC或DRAC遠程或本地管理Dell服務器。
RACADM提供與iDRAC / DRAC圖形用戶界面(GUI)相似的功能,還能夠使用RACADM遠程管理Dell Chassis Management Controller(CMC)。
RACADM命令能夠從管理站遠程運行和/或在受管系統上本地運行。
RACADM命令容許您查看受管系統信息,在受管系統上執行電源操做,執行固件更新,配置設置等。因爲RACADM是從命令行界面(CLI)運行的,所以系統管理員能夠建立以一對多方式控制和更新Dell系統的腳本。ios
術語git
一、安裝依賴包
聯網YUM安裝必須的基本組件,主要是SNMP客戶端,若是不打算用於監控,可忽略,wget,perl 是OMSA安裝需用到的,自RHEL/CentOS 6.4後的2.6.32.358內核變更,因此要額外安裝一個 OpenIPMI 包,不然OMSA沒法正常啓動。軟件包注意區分大小寫bootstrap
yum install -y net-snmp net-snmp-devel net-snmp-utils wget perl OpenIPMI
二、安裝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
解決方法:ruby
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安裝便可。bash
方式二:服務器
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, 命令示例以下:
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: 用戶相關: 注:數字二、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
內存相關:
磁盤相關:
BIOS相關:
網卡相關:
磁盤相關:
raid相關:
用戶相關:
IP相關:
日誌相關:
系統相關:
racadm serveraction <action>
而您將<action>替換爲如下之一:
若是您的Drac因任何緣由崩潰,您可能須要重置它:racadm racreset
備註:提交做業時,perc8的卡(H710)是不支持realtime參數的;realtime參數是從perc9(H730)纔開始支持。