Date Created: Wed 02-Jan-2008

Related Document Categories:


    #!/bin/ksh
    # Korn Shell Functions file
    #
    # Author: Steve Robinson / Koushik Ghosh
    # Date Created: November 2007
    # Arguments: subfolder for enviroment
    # Decription: This script lists all the was process to mkae it easy to kill tasks in am emergency.
    # Version: 1.1
    # History:
    # 23-November-2007 - Created.
    # 01-January-2008 - Updated to trim spaces
    #############################################################################################################
    Script=`basename $0|awk ' BEGIN { FS="."} { print $1 } '`
    if [ $# != 1 ]; then
    echo "Correct Usage: ${Script} {ENVIRONMENT (like: dev, inst01, inst02 or inst03}"
    fi

    ENVIRONMENT=$1
    ENVPATH=/apps/was/ws6/$ENVIRONMENT
    if [ -d $ENVPATH ]; then
    total=`ps -ef | grep /apps/was/ws6/$ENVIRONMENT |tr -s " "| cut -d " " -f3`
    echo ""
    for i in $total
    do
    val=`pargs $i 2>/dev/null|cut -d":" -f2-10|grep -i [a-z0-9]|tail -1`
    pid=`echo PID [$i]`
    server=`echo SERVER [$val ]`
    FORMAT="%-8s%-10s%-10s%-12s\n"

    if [[ $val != "" ]] ; then
    ##echo $pid $server
    printf $FORMAT PID $i SERVER $val
    fi
    done
    else
    echo "ERROR: no environment is available under $ENVPATH"
    fi
    echo ""

Middleware Mentor - Steven Charles Robinson

About Me

Steve Robinson has been working in IT for over 15 years and has provided solutions for many large-enterprise corporate companies across the world. Steve specialises in Java and Middleware consulting. Steve comes from both an administration and development background.

Before moving to JEE, Steve was an accomplished developer and consultant for both IBM Lotus Notes and Microsoft .NET Technologies.

Follow Steve as @stevencrobinson on twitter.

Read my books?

IBM WebSphere Application Server 8.0 Administration Guide

IBM WebSphere Application Server 8.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Categories

Oracle WebLogic Categories

JBoss Categories

Other Categories