分类: 系统运维
2013-12-05 13:52:36
#!/bin/sh
#
# scott_hanson@dell.com –
#
# Script to install OMSA on ESX 3.x, configure firewall, and snmp settings
#
# PreReq : OMSA tar from support.dell.com, as of 5-19-2008 the latest is the
# one listed below in the OMSA_TAR variable.
#
# Create a working directory (WD) and copy this script and
# the tarball there, then execute the script.
#
# WARNING : If you’ve never installed OMSA on ESX, DON’T start with
# this script. Walk before you run, read the “Installing
# Dell OpenManage in a VMware ESX Server Software Environment”
# Available on dell.com/vmware under “Support Documents”
#
# Some variables you might like to change
WD=/root/omsa_script
OMSA_TAR=OM_5.4.0_ManNode_A01.tar.gz
COMMUNITY_NAME=public
SNMP_TRAP_DEST=192.168.50.117
# Creating working directory and untar OMSA
mkdir $WD/working
cd $WD/working
tar -zxvf $WD/$OMSA_TAR
# Installing and starting OMSA
# b = base code
# w = web interface
# r = DRAC services
# s = storage management
echo ‘*** Installing and starting OMSA Agent ***’
$WD/working/linux/supportscripts/srvadmin-install.sh -b -w -r -s
$WD/working/linux/supportscripts/srvadmin-services.sh restart
# Open port in firewall for OMSA web interface
echo ‘*** Opening port 1311 for OMSA web interface ***’
esxcfg-firewall -o 1311,tcp,in,OpenManageRequest
# Configuration of snmp settings
echo ‘*** Configuring snmp and restarting snmp service ***’
cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.BACKUP
sed -i “s/rocommunity.*/rocommunity $COMMUNITY_NAME/g” /etc/snmp/snmpd.conf
sed -i “s/trapcommunity.*/trapcommunity $COMMUNITY_NAME/g” /etc/snmp/snmpd.conf
sed -i “s/trapsink.*/trapsink $SNMP_TRAP_DEST/g” /etc/snmp/snmpd.conf
service snmpd restart
# Configuration of firewall for snmp
echo ‘*** Configuring firewall to allow snmp traffic ***’
esxcfg-firewall -e snmpd
# Cleanup
echo ‘*** Removing working files and directory ***’
rm -rf $WD/working
echo ‘*** OMSA installation and configuration complete ***’