需求:通过服务器远程管理IP批量升级戴尔IDRAC固件
工具:racadm、ipmitool、Remote Access Configuration Tool
下载:
第一步,将要更新BMC IP写入 ip.conf
10.22.170.80
10.22.182.97
10.22.163.74
10.22.183.12
第二步,验证当前BMC帐号 userlist.sh
#!/bin/bashtrue >userlist.txtwhileread line;doip=`echo $line|awk ‘{print $1}‘`
ipmitool-H $ip -I lanplus -U userid -P password user list >/dev/nullret=$?
if [ $ret -eq 0]then printf "$ip OK\n">>userlist.txtelse printf "$ip ERR\n">>userlist.txtfi
done < ./ip.conf
第三步,编辑批量ping脚本 server_ping.sh
#!/bin/bashtrue >out.txtwhileread line;doip=`echo $line|awk ‘{print $1}‘`ping -w 1 -c 1 $ip>/dev/nullret=$?
if [ $ret -eq 0]then printf "$ip OK\n">>out.txtelse printf "$ip ERR\n">>out.txtfi
done &