#!/bin/sh ############################################################################ # # Script: installWily # # Purpose: Install Wily and customize for the environment # # Ver Date Description Analyst # --- -------- --------------------------------------------- ------------ # 1.0 03/23/11 Initial Build Davis # 1.1 04/11/11 Forced setting for JAVA_HOME due to AIX Davis # readlink incompatibility # 1.2 04/28/11 Identify WAS version & modify appropriate PBL Davis # 1.3 07/05/11 Added installation of 8.x agents, Davis # added new parameter for agent version # 1.4 09/28/11 Added new non-prod MOM, WebSphere on Solaris Davis # 1.5 10/03/11 Added logic for PPK for WebSphere Portal & MQ Davis # 1.6 10/19/11 Cleaned up JRE version lookup for Solaris Davis ############################################################################ SCRIPT_PATH=`dirname $0` SCRIPT_NAME=`basename $0` OS_VERSION=`uname -s` readonly SCRIPT_PATH readonly SCRIPT_NAME readonly OS_VERSION cd $SCRIPT_PATH || exit 1 usage() { print " Usage: $SCRIPT_NAME -d -e -a -i -u -g -f -v [-l -m -p] Installs the Wily product from tarball to /wily, looks for to gather application server info, must be (WebSphere|WebLogic), and customizes for . The owner of the wily directory contents are set to and the group set to . You must provide the fully qualified path to . This is necessary in order to allow execution of this script from any location on the system. So it is not necessary for and $SCRIPT_NAME to be in the same location. You must provide the (8|9) to ensure the script knows which version of the Java agent to be deployed. -l for installation of PPK for Websphere Portal -m for installation of PPK for WebSphere MQ -p preserves all existing content and runs only the customization steps. -f becomes optional when -p is used. N.B.: Script is only compatible with Introscope8.x|9.x deploying on AIX|Linux|Solaris running WebSphere|WebLogic. Script should also work with other Java agents, but may require additional code to modify platform specific properties. " exit 1 } die() { # Print an error message and exit with given status # call as: die status "message" ["message" ...] exitstat=$1; shift for i in "$@"; do print -R "$i" done exit $exitstat } #------------------------------ # Parse command line #------------------------------ PRESERVE=0 PORTAL=0 MQ=0 while getopts a:d:e:f:g:i:n:lmpu:v: arg; do case $arg in a) APP_SVR="$OPTARG";; d) APP_DIR="$OPTARG";; e) ENV="$OPTARG";; f) WILYTAR="$OPTARG";; g) GROUP="$OPTARG";; i) INSTALL_DIR="$OPTARG";; l) PORTAL=1;; m) MQ=1;; p) PRESERVE=1;; u) USER="$OPTARG";; v) VERSION="$OPTARG";; ?) usage;; esac done readonly APP_DIR readonly WILYTAR readonly GROUP readonly INSTALL_DIR readonly PORTAL readonly MQ readonly PRESERVE readonly USER readonly VERSION shift $(($OPTIND - 1)) # check to see that all arguments have been passed if [ $PRESERVE -eq 0 ]; then [ -z "$APP_SVR" -o -z "$APP_DIR" -o -z "$ENV" -o -z "$WILYTAR" -o -z "$INSTALL_DIR" -o -z "$USER" -o -z "$GROUP" -o -z "$VERSION" ] && usage else [ -z "$APP_SVR" -o -z "$APP_DIR" -o -z "$ENV" -o -z "$INSTALL_DIR" -o -z "$USER" -o -z "$GROUP" -o -z "$VERSION" ] && usage fi print "Script $SCRIPT_NAME starting on `date +%Y/%m/%d\ %H:%M:%S`" #------------------------------ # Verification steps #------------------------------ #convert case on $APP_SVR APP_SVR=$(echo "$APP_SVR"| tr -s '[:lower:]' '[:upper:]') readonly APP_SVR #convert case on $ENV ENV=$(echo "$ENV"| tr -s '[:lower:]' '[:upper:]') readonly ENV case $APP_SVR in WEBSPHERE|WEBLOGIC) ;; *) die 1 "ERROR: Unknown application server type.";; esac case $OS_VERSION in SunOS) export PATH="/usr/ucb:/usr/xpg4/bin:$PATH" if [ $APP_SVR == "WEBLOGIC" ]; then # check environment variables if [ ! -f $APP_DIR/bea/weblogic/[0-9]/common/bin/commEnv.sh ]; then die 1 "ERROR: Unable to locate WebLogic common environment script." else . $APP_DIR/bea/weblogic/[0-9]/common/bin/commEnv.sh fi # determine jre version javaVersion=`$JAVA_HOME/jre/bin/java -version 2>&1 | grep "java version" | cut -d' ' -f3 | sed 's/"//g' | cut -d'_' -f1` elif [ $APP_SVR == "WEBSPHERE" ]; then # check environment variables if [ ! -f $APP_DIR/bin/setupCmdLine.sh ]; then die 1 "ERROR: Unable to locate WebSphere common environment script." else . $APP_DIR/bin/setupCmdLine.sh fi # determine jre version javaVersion=`$JAVA_HOME/jre/bin/java -version 2>&1 | grep "java version" | cut -d' ' -f3 | sed 's/"//g' | cut -d'_' -f1` # identify WebSphere version wasVersion=`$APP_DIR/bin/versionInfo.sh | awk '/^Version/ && !/Directory/ { print $2 }' | cut -d "." -f1` fi print "JRE version: $javaVersion" ;; AIX) # check environment variables #if [ ! -f $APP_DIR/bin/setupCmdLine.sh ]; then # die 1 "ERROR: Unable to locate WebSphere common environment script." #else # . $APP_DIR/bin/setupCmdLine.sh #fi JAVA_HOME=$APP_DIR/java # determine jre version $JAVA_HOME/bin/java -version 2>&1 | grep "^java version" | sed 's/"//g' | read j j javaVersion print "JRE version: $javaVersion" # identify WebSphere version wasVersion=`$APP_DIR/bin/versionInfo.sh | awk '/^Version/ && !/Directory/ { print $2 }' | cut -d "." -f1` ;; Linux) #if [ ! -f $APP_DIR/bin/setupCmdLine.sh ]; then # die 1 "ERROR: Unable to locate custom WebSphere environment script." #else # . $APP_DIR/bin/setupCmdLine.sh #fi JAVA_HOME=$APP_DIR/java # determine jre version javaVersion=`$JAVA_HOME/bin/java -version 2>&1 | grep "java version" | cut -d' ' -f3 | sed 's/"//g' | cut -d'_' -f1` print "JRE version: $javaVersion" # identify WebSphere version wasVersion=`$APP_DIR/bin/versionInfo.sh | awk '/^Version/ && !/Directory/ { print $2 }' | cut -d "." -f1` print "WAS version: $wasVersion" ;; *) die 1 "ERROR: Unknown operating system." ;; esac case $javaVersion in 1.4.0) agentProfile="IntroscopeAgent.profile" if [ $APP_SVR == "WEBSPHERE" ]; then PBL="websphere-typical.pbl" elif [ $APP_SVR == "WEBLOGIC" ]; then PBL="weblogic-typical.pbl" else PBL="default-typical.pbl" fi ;; 1.5.0) if [ $APP_SVR == "WEBSPHERE" ] && [ $VERSION == "9" ]; then agentProfile="IntroscopeAgent.NoRedef.profile" PBL="websphere-typical-NoRedef.pbl" if [ $PORTAL == 1 ]; then PBL="$PBL,websphereportal.pbl" fi if [ $MQ == 1 ]; then PBL="$PBL,webspheremq.pbl" fi elif [ $APP_SVR == "WEBLOGIC" ]; then agentProfile="IntroscopeAgent.profile" PBL="weblogic-typical.pbl" else agentProfile="IntroscopeAgent.profile" PBL="default-typical.pbl" fi ;; 1.6.0) if [ $APP_SVR == "WEBSPHERE" ] && [ $VERSION == "9" ]; then agentProfile="IntroscopeAgent.profile" PBL="websphere-typical.pbl" if [ $PORTAL == 1 ]; then PBL="$PBL,websphereportal.pbl" fi if [ $MQ == 1 ]; then PBL="$PBL,webspheremq.pbl" fi elif [ $APP_SVR == "WEBLOGIC" ]; then agentProfile="IntroscopeAgent.profile" PBL="weblogic-typical.pbl" else agentProfile="IntroscopeAgent.profile" PBL="default-typical.pbl" fi ;; *) die 1 "ERROR: Unsupported java version: $javaVersion" ;; esac # if you run as WAS user, then you can comment out the if block. #if [ `id -un` != "root" ]; then # die 1 "ERROR: Must run as root" #else # print "You are running as `id -un`. Filesystem permissions will be set to $USER:$GROUP at the completion of the configuration step." #fi if ! `groups $USER | grep -q "^.*$GROUP"` > /dev/null ; then die 1 "ERROR: $USER does not exist or is not part of the $GROUP group." fi if [ ! -r $WILYTAR ] && [ $PRESERVE -eq 0 ]; then die 1 "ERROR: $WILYTAR does not exist or is not readable." fi #------------------------------ # Setup for the environment #------------------------------ EM_D1=dev1.em.com EM_D2=dev2.em.com EM_DPORT=5001 EM_P1=prod1.em.com EM_P2=prod2.em.com EM_PPORT=5001 case $ENV in DEV|QA|UAT) EM_FQDN1=$EM_D1 EM_FQDN2=$EM_D2 EM_PORT=$EM_DPORT autoprobelog="logs/AutoProbe.log" agentlog="logs/IntroscopeAgent.log" agentloglevel="INFO, logfile" remotedynamicinstrument="true" dynamicinstrument="true" ACCESS="loose" ;; PROD) EM_FQDN1=$EM_P1 EM_FQDN2=$EM_P2 EM_PORT=$EM_PPORT autoprobelog="logs/AutoProbe.log" agentlog="/dev/null" agentloglevel="OFF" remotedynamicinstrument="false" dynamicinstrument="false" ACCESS="tight" ;; *) die 1 "ERROR: invalid environment: $ENV" ;; esac #------------------------------ # Copy in wily contents. First remove all files contained in the tar file # to avoid tar errors when overwriting an active file or one without write # permission. But don't simply remove ALL files under wily/ since we # want to preserve any custom files that may have been added. #------------------------------ if [ $PRESERVE -eq 0 ]; then cd $INSTALL_DIR || die 1 "ERROR: failed cd $INSTALL_DIR" if [ ! -d wily/ext ]; then print "No existing extension files to remove" else print "Removing existing extension files" rm -r wily/ext/* fi tar tf $WILYTAR | while read file; do [ -f $file ] && rm -f $file [ -d $file ] && chmod u+w $file done print "Unpacking wily source" tar xf $WILYTAR || die 1 "ERROR: failed to unpack $WILYTAR" fi #------------------------------ # Create AutoProbe Connector # N.B.: when installing Java Agent 8.x and you're instrumenting # IBM JRE 1.5, you must use the prependTOJVMRuntimePath or else you'll experience # a large amount of CPU overhead. Please see Wily Legacy KB 1317 for details. #------------------------------ case $javaVersion in 1.4.0) cd $INSTALL_DIR/connector || die 1 "ERROR: failed cd $INSTALL_DIR" $JAVA_HOME/java -jar CreateAutobeProbeConnector.jar -current -output AP.jar ;; 1.5.0) if [ $APP_SVR == "WEBSPHERE" ] && [ $VERSION == "8" ]; then $JAVA_HOME/jre/bin/java -jar -Dcom.wily.introscope.prependToJVMRuntimePath=$JAVA_HOME/jre/lib/vm.jar CreateAutoProbeConnector.jar -current -output AP.jar fi ;; 1.6.0) : ;; esac #------------------------------ # Modify wily profile #------------------------------ print "Modifying Wily profile" cp -p $INSTALL_DIR/wily/$agentProfile $INSTALL_DIR/wily/$agentProfile.bak baseEm="introscope.agent.enterprisemanager" factory="com.wily.isengard.postofficehub.link.net.DefaultSocketFactory" baseAgent="introscope.agent" autoprobe="introscope.autoprobe" readonly baseEm readonly factory readonly baseAgent readonly autoprobe addedHost=0 addedPort=0 addedFactory=0 addedSQL=0 addedCPU=0 addedMaxLength=0 # configure agent based on APP_SVR if [ $APP_SVR = "WEBLOGIC" ]; then cat $INSTALL_DIR/wily/$agentProfile | while read line; do if print -- "$line" | grep -q "^$baseEm.transport.tcp.host\."; then if [ $addedHost -eq 0 ]; then print "$baseEm.transport.tcp.host.EM1=$EM_FQDN1,$EM_FQDN2" addedHost=1 fi elif print -- "$line" | grep -q "^$baseEm.transport.tcp.port\."; then if [ $addedPort -eq 0 ]; then print "$baseEm.transport.tcp.port.EM1=$EM_PORT" addedPort=1 fi elif print -- "$line" | grep -q "^$baseEm.transport.tcp.socketfactory\."; then if [ $addedFactory -eq 0 ]; then print "$baseEm.transport.tcp.socketfactory.EM1=$factory" addedFactory=1 fi elif print -- "$line" | grep -q "^$baseAgent.blame.type"; then if [ $addedCPU -eq 0 ]; then print "$baseAgent.blame.type=boundary" print "\n" print "#######################" print "# Aggregate CPU Utilization" print "#" print "# ================" print "# Allowable values: true, false" print "# Default is false" print "# Displays aggregate CPU calculations on a per-JVM basis." print "# You must restart the managed application before the changes to this property take effect." print "$baseAgent.disableAggregateCPUUtilization=true" print "\n" addedCPU=1 fi elif print -- "$line" | grep -q "^$baseAgent.sqlagent.sql.maxlength"; then addedMaxLength=1 elif print -- "$line" | grep -q "^$baseAgent.sqlagent.useblame"; then if [ $addedSQL -eq 0 ]; then print "$baseAgent.sqlagent.useblame=true" addedSQL=1 fi if [ $addedMaxLength -eq 0 ]; then print "$baseAgent.sqlagent.sql.maxlength=500" addedMaxLength=1 fi else print -- "$line" fi done | sed \ -e "s?^$autoprobe.logfile=.*?$autoprobe.logfile=$autoprobelog?" \ -e "s?^$autoprobe.directivesFile=.*?$autoprobe.directivesFile=pbl/$PBL,hotdeploy?" \ -e "s?^log4j.logger.IntroscopeAgent=.*?log4j.logger.IntroscopeAgent=$agentloglevel?" \ -e "s?^log4j.appender.logfile.File=.*?log4j.appender.logfile.File=$agentlog?" \ -e "s?^log4j.appender.logfile.MaxBackupIndex=.*?log4j.appender.logfile.MaxBackupIndex=1?" \ -e "s/^$baseEm.connectionorder=.*/$baseEm.connectionorder=EM1,EM2/" \ -e "s?^#$baseEm.failbackRetryIntervalInSeconds=.*?$baseEm.failbackRetryIntervalInSeconds=120?" \ -e "s?^#$baseAgent.reduceAgentMemoryOverhead=.*?$baseAgent.reduceAgentMemoryOverhead=true?" \ -e "s?^$baseAgent.jmx.enable=.*?$baseAgent.jmx.enable=true?" \ -e "s?^$baseAgent.jmx.name.primarykeys=.*?$baseAgent.jmx.name.primarykeys=Type,Name?" \ -e "s?^$baseAgent.jmx.name.jsr77.disable=.*?$baseAgent.jmx.name.jsr77.disable=true?" \ -e "s?^$baseAgent.jmx.name.filter=.*?$baseAgent.jmx.name.filter=ThreadPoolRuntime:ExecuteThreadIdleCount,ThreadPoolRuntime:ExecuteThreadTotalCount,ThreadPoolRuntime:HoggingThreadCount,ThreadPoolRuntime:PendingUserRequestCount,ThreadPoolRuntime:QueueLength,ThreadPoolRuntime:StandbyThreadCount,ThreadPoolRuntime:Throughput,JDBCDataSourceRuntime|*:ActiveConnectionsCurrentCount,JDBCDataSourceRuntime|*:ActiveConnectionsHighCount,JDBCDataSourceRuntime|*:ConnectionDelayTime,JDBCDataSourceRuntime|*:ConnectionsTotalCount,JDBCDataSourceRuntime|*:CurrCapacity,JDBCDataSourceRuntime|*:CurrCapacityHighCount,JDBCDataSourceRuntime|*:FailedReserveRequestCount,JDBCDataSourceRuntime|*:FailuresToReconnectCount,JDBCDataSourceRuntime|*:HighestNumAvailable,JDBCDataSourceRuntime|*:HighestNumUnavailable,JDBCDataSourceRuntime|*:LeakedConnectionCount,JDBCDataSourceRuntime|*:NumAvailable,JDBCDataSourceRuntime|*:NumUnavailable,JDBCDataSourceRuntime|*:WaitingForConnectionCurrentCount,JDBCDataSourceRuntime|*:WaitingForConnectionFailureTotal,JDBCDataSourceRuntime|*:WaitingForConnectionHighCount,JDBCDataSourceRuntime|*:WaitingForConnectionSuccessTotal,JDBCDataSourceRuntime|*:WaitingForConnectionTotal,JDBCDataSourceRuntime|*:WaitSecondsHighCount,JMSDestinationRuntime|*:BytesCurrentCount,JMSDestinationRuntime|*:BytesHighCount,JMSDestinationRuntime|*:BytesPendingCount,JMSDestinationRuntime|*:BytesReceivedCount,JMSDestinationRuntime|*:ConsumersCurrentCount,JMSDestinationRuntime|*:ConsumersHighCount,JMSDestinationRuntime|*:ConsumersTotalCount,JMSDestinationRuntime|*:MessagesCurrentCount,JMSDestinationRuntime|*:MessagesDeletedCurrentCount,JMSDestinationRuntime|*:MessagesHighCount,JMSDestinationRuntime|*:MessagesPendingCount,JMSDestinationRuntime|*:MessagesReceivedCount,WorkManagerRuntime|*:CompletedRequests,WorkManagerRuntime|*:PendingRequests,WorkManagerRuntime|*:StuckThreadCount,ExecuteQueueRuntime|*:ExecuteThreadCurrentIdleCount,ExecuteQueueRuntime|*:ExecuteThreadTotalCount,ExecuteQueueRuntime|*:PendingRequestCurrentCount,ExecuteQueueRuntime|*:ServicedRequestTotalCount,WebAppComponentRuntime|*:OpenSessionsCurrentCount,WebAppComponentRuntime|*:OpenSessionsHighCount,WebAppComponentRuntime|*:SessionsOpenedTotalCount,WebAppComponentRuntime|*:SessionTimeoutSecs?" \ -e "s?^$baseAgent.jmx.excludeStringMetrics=.*?$baseAgent.jmx.excludeStringMetrics=true?" \ -e "s?^$baseAgent.leakhunter.enable=.*?$baseAgent.leakhunter.enable=false?" \ -e "s?^$baseAgent.leakhunter.logfile.location=.*?$baseAgent.leakhunter.logfile.location=/dev/null?" \ -e "s?^#$baseAgent.weblogic.crossjvm=.*?$baseAgent.weblogic.crossjvm=true?" \ -e "s?^# $baseAgent.metricClamp=.*?$baseAgent.metricClamp=5000?" \ -e "s?^$baseAgent.remoteagentdynamicinstrumentation.enabled=.*$baseAgent.remoteagentdynamicinstrumentation.enabled=$remotedynamicinstrument?" \ -e "s?^$autoprobe.dynamicinstrument.enabled=.*?$autoprobe.dynamicinstrument.enabled=$dynamicinstrument?" \ -e "s?^#$autoprobe.dynamicinstrument.pollIntervalMinutes=.*?$autoprobe.dynamicinstrument.pollIntervalMinutes=2?" \ -e "s?^#$autoprobe.dynamicinstrument.instrumentList=.*?$autoprobe.dynamicinstrument.instrumentList=all?" \ -e "s?^#$autoprobe.dynamicinstrument.avoidClassLoaders=.*?$autoprobe.dynamicinstrument.avoidClassLoaders=System?" \ -e "s?^#$autoprobe.dynamicinstrument.classFileSizeLimitInMegs=.*?$autoprobe.dynamicinstrument.classFileSizeLimitInMegs=1?" \ > $INSTALL_DIR/wily/$$.profile else cat $INSTALL_DIR/wily/$agentProfile | while read line; do if print -- "$line" | grep -q "^$baseEm.transport.tcp.host\."; then if [ $addedHost -eq 0 ]; then print "$baseEm.transport.tcp.host.EM1=$EM_FQDN1,$EM_FQDN2" addedHost=1 fi elif print -- "$line" | grep -q "^$baseEm.transport.tcp.port\."; then if [ $addedPort -eq 0 ]; then print "$baseEm.transport.tcp.port.EM1=$EM_PORT" addedPort=1 fi elif print -- "$line" | grep -q "^$baseEm.transport.tcp.socketfactory\."; then if [ $addedFactory -eq 0 ]; then print "$baseEm.transport.tcp.socketfactory.EM1=$factory" addedFactory=1 fi elif print -- "$line" | grep -q "^$baseAgent.blame.type"; then if [ $addedCPU -eq 0 ]; then print "$baseAgent.blame.type=boundary" print "\n" print "#######################" print "# Aggregate CPU Utilization" print "#" print "# ================" print "# Allowable values: true, false" print "# Default is false" print "# Displays aggregate CPU calculations on a per-JVM basis." print "# You must restart the managed application before the changes to this property take effect." print "$baseAgent.disableAggregateCPUUtilization=true" print "\n" addedCPU=1 fi elif print -- "$line" | grep -q "^$baseAgent.sqlagent.sql.maxlength"; then addedMaxLength=1 elif print -- "$line" | grep -q "^$baseAgent.sqlagent.useblame"; then if [ $addedSQL -eq 0 ]; then print "$baseAgent.sqlagent.useblame=true" addedSQL=1 fi if [ $addedMaxLength -eq 0 ]; then print "$baseAgent.sqlagent.sql.maxlength=500" addedMaxLength=1 fi else print -- "$line" fi done | sed \ -e "s?^$autoprobe.logfile=.*?$autoprobe.logfile=$autoprobelog?" \ -e "s?^$autoprobe.directivesFile=.*?$autoprobe.directivesFile=pbl/$PBL,hotdeploy?" \ -e "s?^log4j.logger.IntroscopeAgent=.*?log4j.logger.IntroscopeAgent=$agentloglevel?" \ -e "s?^log4j.appender.logfile.File=.*?log4j.appender.logfile.File=$agentlog?" \ -e "s?^log4j.appender.logfile.MaxBackupIndex=.*?log4j.appender.logfile.MaxBackupIndex=1?" \ -e "s/^$baseEm.connectionorder=.*/$baseEm.connectionorder=EM1,EM2/" \ -e "s?^#$baseEm.failbackRetryIntervalInSeconds=.*?$baseEm.failbackRetryIntervalInSeconds=120?" \ -e "s?^#$baseAgent.reduceAgentMemoryOverhead=.*?$baseAgent.reduceAgentMemoryOverhead=true?" \ -e "s?^$baseAgent.pmi.enable=.*?$baseAgent.pmi.enable=true?" \ -e "s?^$baseAgent.pmi.enable.threadPool=.*?$baseAgent.pmi.enable.threadPool=true?" \ -e "s?^$baseAgent.pmi.enable.servletSessions=.*?$baseAgent.pmi.enable.servletSessions=true?" \ -e "s?^$baseAgent.pmi.enable.connectionPool=.*?$baseAgent.pmi.enable.connectionPool=true?" \ -e "s?^$baseAgent.pmi.enable.bean=.*?$baseAgent.pmi.enable.bean=true?" \ -e "s?^$baseAgent.pmi.enable.transaction=.*?$baseAgent.pmi.enable.transaction=true?" \ -e "s?^$baseAgent.pmi.enable.webApp=.*?$baseAgent.pmi.enable.webApp=true?" \ -e "s?^$baseAgent.pmi.enable.jvmRuntime=.*?$baseAgent.pmi.enable.jvmRuntime=true?" \ -e "s?^$baseAgent.pmi.enable.system=.*?$baseAgent.pmi.enable.system=false?" \ -e "s?^$baseAgent.pmi.enable.cache=.*?$baseAgent.pmi.enable.cache=false?" \ -e "s?^$baseAgent.pmi.enable.orbPerf=.*?$baseAgent.pmi.enable.orbPerf=true?" \ -e "s?^$baseAgent.pmi.enable.j2c=.*?$baseAgent.pmi.enable.j2c=true?" \ -e "s?^$baseAgent.pmi.enable.webServices=.*?$baseAgent.pmi.enable.webServices=false?" \ -e "s?^$baseAgent.pmi.enable.wlm=.*?$baseAgent.pmi.enable.wlm=false?" \ -e "s?^$baseAgent.pmi.enable.wsgw=.*?$baseAgent.pmi.enable.wsgw=false?" \ -e "s?^$baseAgent.pmi.enable.alarmManager=.*?$baseAgent.pmi.enable.alarmManager=false?" \ -e "s?^$baseAgent.pmi.enable.hamanager=.*?$baseAgent.pmi.enable.hamanager=false?" \ -e "s?^$baseAgent.pmi.enable.objectPool=.*?$baseAgent.pmi.enable.objectPool=false?" \ -e "s?^$baseAgent.pmi.enable.scheduler=.*?$baseAgent.pmi.enable.scheduler=false?" \ -e "s?^$baseAgent.jmx.enable=.*?$baseAgent.jmx.enable=false?" \ -e "s?^$baseAgent.jmx.name.jsr77.disable=.*?$baseAgent.jmx.name.jsr77.disable=true?" \ -e "s?^$baseAgent.jmx.name.filter=.*?$baseAgent.jmx.name.filter=?" \ -e "s?^$baseAgent.jmx.excludeStringMetrics=.*?$baseAgent.jmx.excludeStringMetrics=true?" \ -e "s?^$baseAgent.leakhunter.enable=.*?$baseAgent.leakhunter.enable=false?" \ -e "s?^$baseAgent.leakhunter.logfile.location=.*?$baseAgent.leakhunter.logfile.location=/dev/null?" \ -e "s?^#$baseAgent.websphere.crossjvm=.*?$baseAgent.websphere.crossjvm=true?" \ -e "s?^# $baseAgent.metricClamp=.*?$baseAgent.metricClamp=5000?" \ -e "s?^$baseAgent.remoteagentdynamicinstrumentation.enabled=.*?$baseAgent.remoteagentdynamicinstrumentation.enabled=$remotedynamicinstrument?" \ -e "s?^$autoprobe.dynamicinstrument.enabled=.*?$autoprobe.dynamicinstrument.enabled=$dynamicinstrument?" \ -e "s?^#$autoprobe.dynamicinstrument.pollIntervalMinutes=.*?$autoprobe.dynamicinstrument.pollIntervalMinutes=2?" \ -e "s?^#$autoprobe.dynamicinstrument.instrumentList=.*?$autoprobe.dynamicinstrument.instrumentList=all?" \ -e "s?^#$autoprobe.dynamicinstrument.avoidClassLoaders=.*?$autoprobe.dynamicinstrument.avoidClassLoaders=System?" \ -e "s?^#$autoprobe.dynamicinstrument.classFileSizeLimitInMegs=.*?$autoprobe.dynamicinstrument.classFileSizeLimitInMegs=1?" \ > $INSTALL_DIR/wily/$$.profile fi cp $INSTALL_DIR/wily/$$.profile $INSTALL_DIR/wily/$agentProfile rm $INSTALL_DIR/wily/$$.profile #------------------------------ # Modify PBL #------------------------------ if [ $OS_VERSION == AIX ] || [ $OS_VERSION == Linux ]; then cd $INSTALL_DIR/wily/pbl || die 1 "ERROR: failed cd $INSTALL_DIR/wily/pbl" print "Modifying $PBL" case $wasVersion in 6) cp -p $PBL $PBL.bak cat $PBL | sed -e "s?^../pbd/ws70x.pbd?#../pbd/ws70x.pbd?" > $$.pbl cp $$.pbl $PBL rm $$.pbl ;; 7) cp -p $PBL $PBL.bak cat $PBL | sed -e "s?^../pbd/ws60x.pbd?#../pbd/ws60x.pbd?" > $$.pbl cp $$.pbl $PBL rm $$.pbl ;; *) die 1 "Unsupported WebSphere version: $wasVersion" ;; esac fi #------------------------------ # Set permissions #------------------------------ print "Setting filesystem permissions" cd $INSTALL_DIR || die 1 "ERROR: failed cd $INSTALL_DIR" chown -R $USER:$GROUP wily if [ $ACCESS == tight ]; then # $GROUP group can read, others can't; all can write to logs if [ $OS_VERSION = "SunOS" ]; then find wily -perm -u+r | xargs -I {} chmod g+r {} chmod -R o-r wily chmod -R go-w wily chmod -R o+w wily/logs find wily -perm -u+x | xargs -I {} chmod g+x {} chmod -R o-x wily else find wily -perm -u+r | xargs -I "{}" chmod g+r "{}" chmod -R o-r wily chmod -R go-w wily chmod -R o+w wily/logs find wily -perm -u+x | xargs -I "{}" chmod g+x "{}" chmod -R o-x wily fi else # $GROUP group can write, others can read; all can write to logs if [ $OS_VERSION = "SunOS" ]; then find wily -perm -u+r | xargs -I {} chmod go+r {} find wily -perm -u+w | xargs -I {} chmod g+w {} chmod -R o-w wily chmod -R o+w wily/logs find wily -perm -u+x | xargs -I {} chmod go+x {} else find wily -perm -u+r | xargs -I "{}" chmod g+r "{}" find wily -perm -u+w | xargs -I "{}" chmod g+w "{}" chmod -R o-w wily chmod -R o+w wily/logs find wily -perm -u+x | xargs -I "{}" chmod go+x "{}" fi fi #------------------------------ # Done #------------------------------ print "Script $SCRIPT_NAME finished on `date +%Y/%m/%d\ %H:%M:%S`" exit 0