#!/bin/bash if [ $# -ne 2 ] ; then echo "Usage: $0 email-notify machine" echo " Set the indicated WN to peacefully idle down Condor jobs" echo " Email will be sent to email-notify when the last job stops" exit 1 fi setupDir=`dirname $0` if [ -e $setupDir/clusco_setup.sh ] ; then source $setupDir/clusco_setup.sh elif [[ "$clusCoDir" == "" ]] ; then echo "Abort: No clusco_setup file found" exit 2 fi mach=$2 # Need to strip off any domain extensions here for matching purposes # machine=`echo $mach | sed -e s/[.]/\ /g | awk '{print $1}'` line=`grep "${machine}\"" $clusCoDir/nodeinfo.csv` if [ $? -ne 0 ] ; then echo "Indicated $machine is not in the DB file" exit 3 fi notifyWhom=$1 echo "Peacefully idling $machine in Condor" localMachine=$(python $clusCoCmd $machine NAME_PRIVATE) rackNum=`echo $localMachine | awk -F- '{print $2}'` if (( rackNum == 113 || rackNum == 115 )) ; then sshDest="msut3-condor.msulocal" else sshDest="aglbatch.local" fi ssh -x root@${sshDest} "/root/tools/notify_peaceful.sh $localMachine $notifyWhom"