需求:通過服務器遠程管理IP批量升級戴爾IDRAC固件
工具:racadm、ipmitool、Remote Access Configuration Tool
下載:
第一步,將要更新BMC IP寫入 ip.conf
192.168.100.80 192.168.100.81 192.168.100.82
192.168.100.83
第二步,驗證當前BMC帳號 userlist.sh
#!/bin/bash true > userlist.txt while read line; do ip=`echo $line|awk '{print $1}'` ipmitool -H $ip -I lanplus -U userid -P password user list >/dev/null ret=$? if [ $ret -eq 0 ] then printf "$ip OK\n">>userlist.txt else printf "$ip ERR\n">>userlist.txt fi done < ./ip.conf
第三步,編輯批量ping腳本 server_ping.sh
#!/bin/bash true > out.txt while read line; do ip=`echo $line|awk '{print $1}'` ping -w 1 -c 1 $ip>/dev/null ret=$? if [ $ret -eq 0 ] then printf "$ip OK\n">>out.txt else printf "$ip ERR\n">>out.txt fi done < ./ip.conf
第四步,通過Remote Access Configuration Tool 查看當前戴爾設備的RDRAC版本
下載地址:http://www.dell.com/support/home/cn/zh/cndhs1/Drivers/DriversDetails?driverId=5T1PD
第五步,下載IDRAC固件版本和搭建FTP服務器
固件下載:http://www.dell.com/support/home/cn/zh/cndhs1/Drivers/DriversDetails?driverId=2091K&fileId=3576056388&osCode=W12R2&productCode=poweredge-r630&languageCode=cs&categoryId=LC
安裝ftp服務
yum install ftp
第六步,編寫批量升級IDRAC腳本 update_idrac_2.40.40.sh
#!/bin/bash user=user password=password while read ip; do racadm -r $ip -u $user -p $password fwupdate -f $ip anonymous 1 -d /pub/firmimg.d7 done < ip.conf
第七步,批量升級IDRAC固件
[root@host]# sh update_idrac_2.40.40.sh /sbin/racadm: line 13: printf: 0xError: invalid hex number Security Alert: Certificate is invalid - self signed certificate Continuing execution. Use -S option for racadm to stop execution on certificate-related errors. FTP firmware update has been initiated. This update process may take several minutes to complete. Please check the update status using fwupdate -s command.