Do you happen to have f60webmx processes that run for days or hours on end, consuming up to 100% of your forms tier CPUs? I do, and I decided to do something about it.
The following script will kill forms processes that hog the CPU past a defined time limit. I have set the process time threshold at 4 hours, and it has been running in a production environment for ~8 months. No users have complained so far, but I recently updated the script to capture the user, responsibility, and form information if available. I plan on calling some of the users to see if their forms sessions were valid or not. Use the script at your own risk, and if you improve upon it, please forward me the code or a link to it, so that we can all benefit from the update.
#!/bin/ksh
#
# Script used to kill forms processes running 4 hours or more.
#
# Usage: kill_runaway_forms.sh
#
######################################################
#
# History: Created 2007-05-09 by Shad
# Update 2007-12-14 by Shad - Added SQL to get form info.
#
######################################################
PROCESS="f60webmx webfile" # Process name to check
HOSTNAME=`hostname`
NOTIFY="you@email.com"
if [ -z $TWO_TASK ]
then
echo "Exiting. TWO_TASK is not set."
exit
fi
ps -ef -o pid,time,args | \
grep -v grep | \
grep "$PROCESS" | \
awk '$2 ~ /[0-9]-[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/ || $2 ~ /[0-9][4-9]:[0-9][0-9]:[0-9][0-9]/' | \
while read LINE
do
PROCESS_ID=`echo $LINE | awk '{print $1}'`
PROCESS_TIME=`echo $LINE | awk '{print $2}'`
PROCESS_NAME=`echo $LINE | awk '{print $3}'`
echo "PROCESS_ID: $PROCESS_ID"
echo "PROCESS_TIME: $PROCESS_TIME"
echo "PROCESS_NAME: $PROCESS_NAME"
mailx -s "Killed $PROCESS_NAME $PROCESS_ID on $HOSTNAME" $NOTIFY <