Salesforce

Script to Gather Stack data on running Progress processes.

« Go Back

Information

 
TitleScript to Gather Stack data on running Progress processes.
URL NameP117065
Article Number000164124
EnvironmentProduct: Progress
Version: 8.x, 9.x
Product: OpenEdge
Version: 10.x. 11.x
Platform: UNIX
Question/Problem Description
Script to gather Stack data on Progress processes running on UNIX
This script is useful for example when OpenEdge is hanging
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
#!/bin/ksh
me=`whoami`
if [ $me != "root" ]
        then
                {
                        echo "You are not logged in as root."
                        echo "Root permissions are needed to run "
                        echo "some of the utilities in this script."
                        exit
                }
fi

if [ -z "$DLC" ]
        then
                {
                        echo "DLC is not set script cannot proceed."
                        exit
                }
fi

DATETIME=`date +%m%d%Y-%H%M%S`
sleep 5
`mkdir $DATETIME`


if [ -d "${DATETIME}" ]
        then
                {
                        cd "$DATETIME"
                }
        else
                {
                        echo "Unable to create temporary directory $DATETIME to store files."
                }
fi

#If any PROBUILD executables are made then they should also
#be searched for and added to the PSLIST variable.
PROSRV=${PROSRV-_mprosrv}
PROEXE=${PROEXE-_progres}
PROSHUT=${PROSHUT-_mprshut}
PROAPSV=${PROAPSV-_proapsv}
PROMAPSV=${PROMAPSV-_mproapsv}
PROUTIL=${PROUTIL-_proutil}
pslist=`ps -ef|grep -v grep|grep -i $PROEXE|awk '{print $2}'`
pslist="$pslist `ps -ef|grep -v grep|grep -i $PROSRV|awk '{print $2}'`"
pslist="$pslist `ps -ef|grep -v grep|grep -i $PROSHUT|awk '{print $2}'`"
pslist="$pslist `ps -ef|grep -v grep|grep -i $PROAPSV|awk '{print $2}'`"
pslist="$pslist `ps -ef|grep -v grep|grep -i $PROMAPSV|awk '{print $2}'`"
pslist="$pslist `ps -ef|grep -v grep|grep -i $PROUTIL|awk '{print $2}'`"
pslist="$pslist `ps -ef|grep -v grep|grep -i _rfutil|awk '{print $2}'`"
pslist="$pslist `ps -ef|grep -v grep|grep -i _dbutil|awk '{print $2}'`"
pslist="$pslist `ps -ef|grep -v grep|grep -i _sqlsrv2|awk '{print $2}'`"\
ostype=`uname`

if [ $ostype = "AIX" ]
        then
 {
  i=0
         for i in $pslist
  do
  {
   procstack $i>>$i.stack
   sleep 2
   procstack $i>>$i.stack
  }
  done
tar --exclude=\*.tar --exclude=\*.gz -cvzf protrace$DATETIME.tar .`find . -name protrace\* -print`
echo "Please send the protrace$DATETIME.tar.gz file to Progress."
 }
fi

if [ $ostype = "SunOS" ]
        then
 {
 me=`/usr/ucb/whoami`
 if [ -x `whence pstack` ]
             then
                {
                  pstack $pslist>>pstack.out
                  sleep 2
                  pstack $pslist>>pstack.out
tar --exclude=\*.tar --exclude=\*.gz -cvzf protrace$DATETIME.tar `find . -name protrace\* -print`
                }
             else
                {
                echo "Couldn't find pstack.">>pstack.out
                i=0
                for i in $pslist
                  do
                    {
                        kill -s USR1 $i
                        sleep 2
                        kill -s USR1 $i
                    }
                  done
tar --exclude=\*.tar --exclude=\*.gz -cvzf protrace$DATETIME.tar `find / -name protrace\* -print`
echo "Please send the protrace$DATETIME.tar.gz file to Progress."
                }
        fi
}
fi

if [ $ostype = "Linux" ]
 then
 {
 i=0
 for i in $pslist
  do    
  {
   kill -s USR1 $i
   sleep 2
   kill -s USR1 $i
  }
  done
tar --exclude=\*.tar --exclude=\*.gz -cvzf protrace$DATETIME.tar `find / -name protrace\* -print`
echo "Please send the protrace$DATETIME.tar.gz file to Progress."
 }
fi

if [ $ostype = "HP-UX" ]
 then 
 {
  i=0
  for i in $pslist
         do
                {
                  kill -s USR1 $i
                  sleep 2
                  kill -s USR1 $i 
                }
         done
tar --exclude=\*.tar --exclude=\*.gz -cvzf protrace$DATETIME.tar `find / -name protrace\* -print`
echo "Please send the protrace$DATETIME.tar.gz file to Progress."
 }
fi
.
Workaround
Notes
Keyword Phrase
Last Modified Date11/20/2020 7:33 AM

Powered by