一、racadm

racadm是直接操作dell自带的idrac的工具,ipmitool可以实现的操作通过它都可以执行,包括idrac、bios、nic、raid等等。


二、安装racadm

2.1、该工具包含在Dell OMSA组件里,安装OMSA即可


#!/bin/bash
 
#安装SNMP
yum -y  install  net-snmp
cp  -p  /etc/snmp/snmpd .conf  /etc/snmp/snmpd .conf.bak
 
#安装OMSA Agent
yum -y  install  libxslt libcmpiCppImpl0 libwsman1 sblim-sfcb sblim-sfcc openwsman-client openwsman-server
ping  -c 4 linux.dell.com
 
#配置DELL OMSA YUM安装源
wget -q -O - http: //linux .dell.com /repo/hardware/latest/bootstrap .cgi |  bash
 
#确认repo文件已生成
if  [ -f  /etc/yum .repos.d /dell-omsa-repository .repo ]; then
     echo  -e  "\033[34mdell-omsa-repository.repo ok\033[0m"
else
     exit
fi
 
#开始安装OMSA
yum -y  install  srvadmin-all
 
#安装srvadmin-cm软件包(srvadmin-cm是配合戴尔OpenManage Essentials进行清册,以及更新系统的)
yum -y  install  zlib.i686 compat-libstdc++-33.i686 libstdc++.i686 libxml2.i686
yum -y  install  srvadmin-cm
 
#启动OMSA进程(端口1311)
/opt/dell/srvadmin/sbin/srvadmin-services .sh start
 
#snmp配置文件修改
grep  -Ev  "^#|^$"  /etc/snmp/snmpd .conf.bak >  /etc/snmp/snmpd .conf
sed  -i  "s/notConfigUser/OMEUser/g"  /etc/snmp/snmpd .conf
sed  -i  "s/public/OME/g"  /etc/snmp/snmpd .conf
sed  -i  "s/notConfigGroup/OMEGroup/g"  /etc/snmp/snmpd .conf
sed  -i  "s/notConfigUser/OMEUser/g"  /etc/snmp/snmpd .conf
chkconfig snmpd on
service snmpd restart


2.2、安装racadm依赖组件

yum -y install openssl-devel 


三、批量重启服务器(DELL)脚本

#!/bin/bash
idrac_user= "XXX"
idrac_password= "XXX"
cat  /... /idrac .txt |  while  read  ip
do
         /opt/dell/srvadmin/sbin/racadm  -r $ip -u $idrac_user -p $idrac_password serveraction hardreset &>  /dev/null
         if  [ $? - eq  0 ]; then
                 echo  -e  "\033[34mServer:$ip has been reboot successful\033[0m"
         else
                 echo  -e  "\033[31mServer:$ip reboot failuer\033[0m"
         fi
done