Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to identify whether a process is hanging in UNIX? 1

Status
Not open for further replies.

Shantha

Programmer
Jun 12, 2002
48
IN
Hai,

I need a script to monitor my webserver where I have to find whether any of the child process is hanging and doesnot close out the session.

Thanks & Regards,
Shanthalakshmi.
 
The way I have done it to do a ps -ef and check the CPU usage time for an absurd value.

Will post my script here tomorrow wnem I'm at work, can't access right now. IBM Certified Confused - MQSeries
IBM Certified Flabbergasted - AIX 5 pSeries System Administration
 
Something to play with, works as is on RedHat 7.2. Hopefully this is what you are looking for.

PARAM=`ps -e|grep [h]ttpd|awk '{ print$3 }'|sed -e 's/://'|sed -e 's/://'`
NAM=`ps -ef|grep [h]ttpd|awk '{ print$8 }'`
for i in $PARAM
do
ZAP=`expr $i`
if [ $ZAP -gt 6000 ] ; then
echo &quot;Please check listing for suspected dodgy HTTPD process: $NAM&quot;|mail -s &quot;<Hostname> HTTPD check&quot; your@emailaddress.com
fi
done
IBM Certified Confused - MQSeries
IBM Certified Flabbergasted - AIX 5 pSeries System Administration
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top