1.下载racadm命令
For Linux 7及以上版本: https://dl.dell.com/FOLDER07423496M/1/DellEMC-iDRACTools-Web-LX-10.1.0.0-4566_A00.tar.gz
For Linux 6版本: https://downloads.dell.com/FOLDER05223994M/1/OM-MgmtStat-Dell-Web-LX-9.2.0-3142_A00.tar.gz
For Esxi7.0版本 : https://dl.dell.com/FOLDER07432834M/1/DellEMC-iDRACTools-Web-ESX70i.VIB-10.1.0.0-4568_A00.zip
2.安装racadm命令
redhat7版本
tar -zxf DellEMC-iDRACTools-Web-LX-10.1.0.0-4566_A00.tar.gz
cd iDRACTools/racadm
sh install_racadm.sh
备注:安装完成后先退出当前终端,重新SSH登录
redhat6版本
tar -zxf OM-MgmtStat-Dell-Web-LX-9.2.0-3142_A00.tar.gz
cd linux/rac
sh install_racadm.sh
备注:安装完成后先退出当前终端,重新SSH登录
Esxi7.0版本,注意软件一定要写全路径
esxcli software vib install -d /vmfs/volumes/datastore1/DellEMC-iDRACTools-Web-ESX70i.VIB-10.1.0.0-4568_A00.zip
3.racadm getsensorinfo获取服务器硬件状态传感器状态,其中有内存、cpu状态
详细信息查看官网信息:
https://www.dell.com/support/manuals/en-us/poweredge-r750xs/idrac9_7.xx_racadm_pub/getsensorinfo?guid=guid-a0d65099-56ce-460b-baef-18ff746ffd02&lang=en-us
shell脚本检测内存,CPU,风扇,电源硬件故障
#!/bin/bash
/opt/dell/srvadmin/sbin/racadm getsensorinfo >check_hardware.log
check_hard (){
if [ -x /opt/dell/srvadmin/sbin/racadm ];then
cat check_hardware.log|grep '^DIMM'|grep -v Absent|awk '{print "内存条"$2"="$3}'|grep -v Ok
cat check_hardware.log|grep "CPU. Status"|awk '{print $1,$2"="$3}'|grep -v Ok
cat check_hardware.log|grep 'System Board Fan.A'|awk '{print $1,$2,$3"="$4}'|grep -v Ok
cat check_hardware.log|grep 'PS. Status'|awk '{if($3=="Present"){print $1,$2"=Ok"}else{print $1,$2"="$3}}'|grep -v Ok
fi
}
Host_status=$(check_hard)
if [ -z "$Host_status" ];then
echo "OK"
else
check_hard
fi