[cod] 1.3 servers being told not to report?

escapedturkey escapedturkey at escapedturkey.com
Thu Apr 16 06:14:07 EDT 2009


I run the following scripts, with qstat, to see if a server is alive or 
not (along with a CPU monitoring script). Is the COD WaW master telling 
servers not to report or run if they run version 1.3?

Thank you. :)

run_serverstatus.bsh:

#!/bin/bash
hour=`date +%H`
if [ "$hour" = "04" ];
then
exit 0
fi
cd /home
ls -1p|grep /|grep -v install|cut -d "/" -f1 > serverstatususers
for user in `cat serverstatususers`
do
su - $user -c "cd && /usr/bin/serverstatus.bsh -f config &"
done
rm -f /home/serverstatususers
exit $?


#!/bin/bash

# Who to e-mail when a process is killed.

contact="escapedturkey at escapedturkey.com"

# Define location of appending log file.

archive="/var/log/killed.log"

#----
# Game Server variables. Add or delete variable lines here.  Only those 
listed will be parsed.
#----
ServerVars=(	"username"
		"password"
		"gamespy_login"
		"gamespy_password"
		"server_ini"
		"start_map"
		"game"
		"rcon_password"
		"restart_time"
		"gametype"
		"mutator"
		"game_directory"
		"game_base"
		"server_exec"
		"server_vm"
		"server_dedicated"
		"server_ip"
		"server_port"
		"server_profile"
		"maxplayers"
		"server_sv_maxclients"
		"server_sv_pure"
		"server_sv_punkbuster"
		"server_mod_directory"
		"server_config"
		"server_config1"
		"server_config2"
		"statgame"
		"mod"
		"module"
		"optionsfile"
		"mpcustomizations"
		"binary"
		"misc"
		"tickrate"
		"server_logfile"
		"server_log_name"
		"bfv_remote_ftp_username"
		"bfv_remote_ftp_password"
		"bfv_remote_ftp_address"
		"bfv_remote_remote_directory"
		"bfvmod"
		"bf1942_remote_ftp_username"
		"bf1942_remote_ftp_password"
		"bf1942_remote_ftp_address"
		"bf1942_remote_remote_directory"
		"bf1942mod"
		"mohaa_remote_ftp_username"
		"mohaa_remote_ftp_password"
		"mohaa_remote_ftp_address"
		"halflife_remote_ftp_username"
		"halflife_remote_ftp_password"
		"halflife_remote_remote_directory"
		"remote_ftp_username"
		"remote_ftp_password"
		"remote_ftp_address"
		"remote_site_directory"
		"ftp_username"
		"vac"
		"ftp_password"
		"ftp_address"
         "remote_directory"  )

#----
# Usage or help file.
#----
usage()
{
   echo "USAGE: $0 -f serverfile.cfg [ -c cronfile ] "
   echo "       -f server.cfg    : Specify a valid server config file to 
use. This option is Required!"
   echo "       -c crontab.file  : Optional- Load a specific crontab 
file to use.  "
   echo "       e.g.  $0 -f myconfig.cfg   loads myconfig.cfg only"
   echo "    	     $0 -f other.cfg -c mycron.cron   loads other.cfg and 
installs a new crontab from mycron.cron file"
   echo " "
   exit 1
}


#----
# Parse the config file.  This will only read in variables defined in 
ServerVars.
#----
ParseCfg()
{
   #echo "Parsing Config file $configfile"
   if [ -e $tmp1 ]; then rm $tmp1; fi
   for X in ${ServerVars[@]}
   do
     # load configs into a tmp file, ignore everything else
     grep "^$X" $configfile >> $tmp1
   done

   # check if config is empty; no vars found in source file
   # source it if OK
   if [ -s $tmp1 ]; then
     . $tmp1
     rm $tmp1
   else
     echo "* No Valid config variables found in $configfile!!"
     echo "exiting.... "
     exit 1
   fi
}



#----
# Load crontab file.  If there are any errors, the proggy should exit
#----
LoadCron()
{
   crontab $cronfile > $tmp2 2>&1
   test -s $tmp2
   if [ $? -eq 0 ]; then
     echo "* Error: Invalid crontab file!"
     cat $tmp2
     rm $tmp2
     echo "exiting...."
     exit 1
   fi
   rm $tmp2
}


###########################
# MAIN CODE
###########################
configfile=
cronfile=
tmp1=".config.tmp"
tmp2=".err.tmp"
tf1=".temp"

#----
# check for correct # of args
#----
if [ $# -lt 2 ]; then usage; fi

#----
# Check first arg
#----
case "$1" in
   -f) if [ ! -s $2 -o ! -f $2 ]; then
  	echo "* Invalid server config filename $2!"
	echo " "
	usage
       else
	configfile="$2"
	ParseCfg
       fi
       ;;
    *) usage
esac

#----
# Is there a second arg? then Check second arg
#----

if [ $# -eq 4 ]; then
   case "$3" in
     -c) if [ "$4" = "NULL" ]; then
     	  break
         elif [ -z $4 -o ! -s $4 -o ! -f $4 ]; then
	  echo "*Invalid crontab filename $4!"
	  echo " "
	  usage
         else
        	  cronfile="$4"
	  LoadCron
         fi
         ;;
      *) usage
   esac
fi

#----
# Runs Server
#----

case "$server_exec" in
    "q3ded" )
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -q3s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -q3s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "ioq3ded.i386" )
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -q3s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -q3s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "oa_ded.i386" )
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -q3s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -q3s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "smokinguns_dedicated.x86" )
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -q3s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -q3s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "ioUrTded.i386" )
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -q3s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -q3s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "cod_lnxded")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -cods $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -cods $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "coduo_lnxded")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -cods $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -cods $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "cod2_lnxded")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -cods $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -cods $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "cod4_lnxded-bin")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -cods $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -cods $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "codwaw_lnxded-bin")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -cods $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -cods $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
   "linuxjampded")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -jk3s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -jk3s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "jkiided")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -jk3s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -jk3s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "mohaa_lnxded")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -maqs $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -maqs $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "spearhead_lnxded")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -maqs $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -maqs $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "sof2ded")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -sof2s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -sof2s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "wolfded.x86")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -rws $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -rws $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "etded.x86")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -woets $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -woets $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "iostvefded-1.34.i386" )
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -efs $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -efs $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "iostvefded-1.37.i386" )
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -efs $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -efs $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "linuxstvefded_1.2-static" )
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -efs $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -efs $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "wopded.i386" )
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -q3s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -q3s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "ucc-bin")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -q3s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -q3s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
"ut3-bin")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -gs4 $server_ip:6500 | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -gs4 $server_ip:6500 | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "nexuiz-linux-x86_64-dedicated" )
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -nexuizs $server_ip:$server_port | awk '{print 
$2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -nexuizs $server_ip:$server_port | awk '{print 
$3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "nexuiz-linux-686-dedicated" )
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -nexuizs $server_ip:$server_port | awk '{print 
$2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -nexuizs $server_ip:$server_port | awk '{print 
$3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
"r1q2ded")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -q2s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -q2s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "r1q2ded-old")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -q2s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -q2s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "r1q2ded-x86_64")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -q2s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -q2s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "wsw_server")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -warsows $server_ip:$server_port | awk '{print 
$2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -warsows $server_ip:$server_port | awk '{print 
$3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "srcds_run")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -a2s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -a2s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "dods")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -a2s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -a2s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "tf2")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -a2s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -a2s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "l4d")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -a2s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -a2s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "hlds_run")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -a2s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -a2s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "doomded.x86")
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -dm3s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -dm3s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "preyded.x86" )
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -preys $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -preys $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "q4ded.x86" )
cpupid=(`ps ux | grep -v grep | grep $server_exec | awk '{print $2}'`)

if [ -z "$cpupid" ]; then

exit 0

fi

status1=(`qstat -old -R -q4s $server_ip:$server_port | awk '{print $2}'`)

if [ "$status1" = "DOWN" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi

status2=(`qstat -old -R -q4s $server_ip:$server_port | awk '{print $3}'`)

if [ "$status2" = "response" ]; then

# Logs killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 >> $archive

# E-mail killed process

top -c -b -n 1 | grep "$cpupid" | grep -v grep | head -n 1 | mail -s 
"Excessive CPU Process killed at $HOSTNAME" $contact

# Kill the process

kill -9 $cpupid

exit 0

fi
;;
    "etqwded.x86" )
# get qstat svn
exit 0
;;
esac

exit 0
    		
#EOF








More information about the cod mailing list