管理卡模式设置

同事的代码,各品牌服务器设置管理卡 独立/共享 模式,记录一下。

#!/bin/bash
set -x

service ipmi restart

type=`dmidecode -t system | awk '/Manufacturer:/{ if(match($0,/Dell/)) print "DELL"; else if(match($0,/HP/)) print "HP"; else if(match($0,/IBM/)) print "IBM"; else print "Uknown"; }'`

if [ ${type} = "IBM" ] ;then
	if [ ! -f /opt/ibm/toolscenter/asu/asu64 ] ; then
		rsync 10.217.13.235::raid/banqian/IBM/*.rpm /tmp/ -avz -P
		rpm -ivh /tmp/ibm_utl*.rpm
	fi
	/opt/ibm/toolscenter/asu/asu64 set IMM.SharedNicMode shared
	/opt/ibm/toolscenter/asu/asu64 show IMM.SharedNicMode | awk '/^IMM.SharedNicMode/'
elif   [ ${type} =  "DELL" ] ;then
	#docmd1=`wget http://10.210.74.208/imtools/imsite/test/dell/OpenIPMI-2.0.16-99.dell.4.99.6.el5.x86_64.rpm`
	#docmd2=`wget http://10.210.74.208/imtools/imsite/test/dell/OpenIPMI-libs-2.0.16-99.dell.4.99.6.el5.x86_64.rpm`
	#docmd3=`wget http://10.210.74.208/imtools/imsite/test/dell/OpenIPMI-tools-2.0.16-99.dell.4.99.6.el5.x86_64.rpm`
	#docmd4=`rpm -ivh *.rpm`
	service ipmi restart
	ipmitool raw 0x30 0x24 0x00
	sleep 2 
	ipmitool raw 0x30 0x25
elif [ ${type} = "HP" ] ;then
	if [ ! -f /sbin/hponcfg ] ; then
		rsync 10.217.13.235::raid/banqian/HP/* /tmp/ -avz -P
		rpm -ivh /tmp/hp*.rpm
	fi
	/sbin/hponcfg -f /tmp/Shared_Network_Port.xml
  	/sbin/hponcfg -f /tmp/Get_Network.xml | awk '/SHARED_NETWORK_PORT/'
fi

 

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注