Re: Runaway Process - Urgent

From: Harvey, Bruce T. (BTHarvey@LMUS.LEGGMASON.COM)
Date: Fri Feb 20 2004 - 06:59:16 EST


Here's a script I wrote that you can use ... it's a dumb script, but it
compares iterations of ps to each other ... you'll need to grep -v the
processes that "appear" to be running away (databases and autosys-type job
schedulers), but this does the trick here

Bruce T. Harvey
Legg Mason Wood Walker, Inc.
Corporate Technology - UNIX Admin.
Red Run 2nd Floor - Owings Mills, MD
(410) 580-7383 - BTHarvey@LeggMason.com
-------------------------------------------------------

######################################### cut here
####################################################
#!/usr/bin/ksh

cleanup() {
        rm -f /tmp/runaway.catcher.[0-9]
        exit $1
}

echo "Snapshot #1 of 10 ... \c"
ps -ef | grep -v ps | grep -v awk | grep -v grep | grep -v dataserver | grep
-v runaway | awk '{ print $1, $2, $3, $5, $7, $8, $9; }' - >/
tmp/runaway.catcher.0
sleep 1
echo "#2 \c"
ps -ef | grep -v ps | grep -v awk | grep -v grep | grep -v dataserver | grep
-v runaway | awk '{ print $1, $2, $3, $5, $7, $8, $9; }' - >/
tmp/runaway.catcher.1
sleep 1
echo "3 \c"
ps -ef | grep -v ps | grep -v awk | grep -v grep | grep -v dataserver | grep
-v runaway | awk '{ print $1, $2, $3, $5, $7, $8, $9; }' - >/
tmp/runaway.catcher.2
sleep 1
echo "4 \c"
ps -ef | grep -v ps | grep -v awk | grep -v grep | grep -v dataserver | grep
-v runaway | awk '{ print $1, $2, $3, $5, $7, $8, $9; }' - >/
tmp/runaway.catcher.3
sleep 1
echo "5 \c"
ps -ef | grep -v ps | grep -v awk | grep -v grep | grep -v dataserver | grep
-v runaway | awk '{ print $1, $2, $3, $5, $7, $8, $9; }' - >/
tmp/runaway.catcher.4
sleep 1
echo "6 \c"
ps -ef | grep -v ps | grep -v awk | grep -v grep | grep -v dataserver | grep
-v runaway | awk '{ print $1, $2, $3, $5, $7, $8, $9; }' - >/
tmp/runaway.catcher.5
sleep 1
echo "7 \c"
ps -ef | grep -v ps | grep -v awk | grep -v grep | grep -v dataserver | grep
-v runaway | awk '{ print $1, $2, $3, $5, $7, $8, $9; }' - >/
tmp/runaway.catcher.6
sleep 1
echo "8 \c"
ps -ef | grep -v ps | grep -v awk | grep -v grep | grep -v dataserver | grep
-v runaway | awk '{ print $1, $2, $3, $5, $7, $8, $9; }' - >/
tmp/runaway.catcher.7
sleep 1
echo "9 \c"
ps -ef | grep -v ps | grep -v awk | grep -v grep | grep -v dataserver | grep
-v runaway | awk '{ print $1, $2, $3, $5, $7, $8, $9; }' - >/
tmp/runaway.catcher.8
sleep 1
echo "10."
ps -ef | grep -v ps | grep -v awk | grep -v grep | grep -v dataserver | grep
-v runaway | awk '{ print $1, $2, $3, $5, $7, $8, $9; }' - >/
tmp/runaway.catcher.9
diff /tmp/runaway.catcher.0 /tmp/runaway.catcher.1 >/dev/null 2>&1
if [ "$?" = "0" ]
then
        echo "0 and 1 identical -- no runaways detected."
        cleanup 0
fi
diff /tmp/runaway.catcher.1 /tmp/runaway.catcher.2 >/dev/null 2>&1
if [ "$?" = "0" ]
then
        echo "1 and 2 identical -- no runaways detected."
        cleanup 0
fi
diff /tmp/runaway.catcher.2 /tmp/runaway.catcher.3 >/dev/null 2>&1
if [ "$?" = "0" ]
then
        echo "2 and 3 identical -- no runaways detected."
        cleanup 0
fi
diff /tmp/runaway.catcher.3 /tmp/runaway.catcher.4 >/dev/null 2>&1
if [ "$?" = "0" ]
then
        echo "3 and 4 identical -- no runaways detected."
        cleanup 0
fi
diff /tmp/runaway.catcher.4 /tmp/runaway.catcher.5 >/dev/null 2>&1
if [ "$?" = "0" ]
then
        echo "4 and 5 identical -- no runaways detected."
        cleanup 0
fi
diff /tmp/runaway.catcher.5 /tmp/runaway.catcher.6 >/dev/null 2>&1
if [ "$?" = "0" ]
then
        echo "5 and 6 identical -- no runaways detected."
        cleanup 0
fi
diff /tmp/runaway.catcher.6 /tmp/runaway.catcher.7 >/dev/null 2>&1
if [ "$?" = "0" ]
then
        echo "6 and 7 identical -- no runaways detected."
        cleanup 0
fi
diff /tmp/runaway.catcher.7 /tmp/runaway.catcher.8 >/dev/null 2>&1
if [ "$?" = "0" ]
then
        echo "7 and 8 identical -- no runaways detected."
        cleanup 0
fi
diff /tmp/runaway.catcher.8 /tmp/runaway.catcher.9 >/dev/null 2>&1
if [ "$?" = "0" ]
then
        echo "8 and 9 identical -- no runaways detected."
        cleanup 0
fi
echo "Possible Runaway ... here are the diffs from the last two runs:"
echo "8 and 9:"
diff /tmp/runaway.catcher.8 /tmp/runaway.catcher.9
echo "\nand 7 and 8:"
diff /tmp/runaway.catcher.7 /tmp/runaway.catcher.8
cleanup 1
################################################### cut here
##############################################

-----Original Message-----
From: Green, Simon [mailto:Simon.Green@EU.ALTRIA.COM]
Sent: Friday, February 20, 2004 5:47 AM
To: aix-l@Princeton.EDU
Subject: Re: Runaway Process - Urgent

Simplest way might be using topas, or another such monitoring program.
Or "ps aux | more".

--
Simon Green
Altria ITSC Europe Ltd
AIX-L Archive at https://new-lists.princeton.edu/listserv/aix-l.html
New to AIX? http://publib-b.boulder.ibm.com/redbooks.nsf/portals/UNIX
N.B. Unsolicited email from vendors will not be appreciated.
Please post all follow-ups to the list.
> -----Original Message-----
> From: Kumar, Praveen (cahoot) [mailto:Praveen.Kumar@CAHOOT.COM]
> Sent: 20 February 2004 10:04
> To: aix-l@Princeton.EDU
> Subject: Runaway Process - Urgent
>
>
> Hi *,
>        I am looking for a run away process on one of my
> system, using the
> command ps -ef|grep \\[     which i used to use on another system and
> determine the run away process, but on this system if i run
> the same it
> gives me an error saying
>
> USF3PRES5[/home/ITC0004]:ps -ef|grep \\[
> grep: 0652-226 Maximum line length of 2048 exceeded.
>  ITC0004 33768 31366   1 10:01:28  pts/5  0:00 grep \[
>
>
> can someone tell me how to determine the runaway process...
IMPORTANT:  The security of electronic mail  sent through the Internet
is not guaranteed.  Legg Mason therefore recommends that you do not
send confidential information to us via electronic mail, including social
security numbers, account numbers, and personal identification numbers.
Delivery, and timely delivery, of electronic mail is also not
guaranteed.  Legg Mason therefore recommends that you do not send time-sensitive
or action-oriented messages to us via electronic mail, including
authorization to  "buy" or "sell" a security or instructions to conduct any
other financial transaction.  Such requests, orders or instructions will
not be processed until Legg Mason can confirm your instructions or
obtain appropriate written documentation where necessary.


This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:37 EDT