This discussion is archived
1 Reply Latest reply: Feb 5, 2013 9:21 PM by Kishore Rout RSS

List of Running Servers only

935907 Newbie
Currently Being Moderated
Hi,

In one of the environments there are over 100 managed servers running in a domain.
I need to find only those server names which are in RUNNING state.
I am using :
mbServers= getMBean("Servers")
servers= mbServers.getServers()
for server in servers :
serverName= server.getName()
print serverName

which lists all the 100+ managed servers' names.

Please suggest how can I get the names of only the RUNNING servers (and not the servers which are SHUTDOWN).

Thanks,
Prakash
  • 1. Re: List of Running Servers only
    Kishore Rout Journeyer
    Currently Being Moderated
    Hi,
    Below scripts will display name of the running server with PID. You have change the domain name and managed server name according to your environment. You need to execute it in shell from server.

    Script:
    ###############################################################
    #The following script gives out process id's of all servers in the base_domain
    ###############################################################


    echo "The DEV (SOA/OBI) domain process id's are as follows"



    echo "please wait.........."
    echo " "

    WLS_Admin_SOA=`/u02/app/oracle/product/fmw/jdk1.6.0_31/bin/sparcv9/jps -v | grep -w AdminServer | grep -w soa_domain | awk '{print $1}'`
    WLS_Admin_OBI=`/u02/app/oracle/product/fmw/jdk1.6.0_31/bin/sparcv9/jps -v | grep -w AdminServer | grep -w bifoundation_domain | awk '{print $1}'`

    nodeMgr=`/u02/app/oracle/product/fmw/jdk1.6.0_31/bin/sparcv9/jps -v | grep -w NodeManager | awk '{print $1}'`

    WLS_UCM1=`/u02/app/oracle/product/fmw/jdk1.6.0_31/bin/sparcv9/jps -v | grep -w ucm_server | awk '{print $1}'`
    WLS_SOA1=`/u02/app/oracle/product/fmw/jdk1.6.0_31/bin/sparcv9/jps -v | grep -w soa_server | awk '{print $1}'`
    IBR_Server=`/u02/app/oracle/product/fmw/jdk1.6.0_31/bin/sparcv9/jps -v | grep -w ibr_server | awk '{print $1}'`
    WLS_NSTIP1=`/u02/app/oracle/product/fmw/jdk1.6.0_31/bin/sparcv9/jps -v | grep -w nstip_server | awk '{print $1}'`

    WLS_WSM1=`/u02/app/oracle/product/fmw/jdk1.6.0_31/bin/sparcv9/jps -v | grep -w wc_spaces | awk '{print $1}'`


    echo " "
    echo "SOA_domain_Admin_Server= $WLS_Admin_SOA"
    echo "OBI_domain_Admin_Server= $WLS_Admin_OBI"
    echo " "
    echo "NM PID = $nodeMgr"
    echo " "
    echo "UCM - Pid= $WLS_UCM1"
    echo "SOA - PID= $WLS_SOA1"
    echo "IBR - PID= $IBR_Server"
    echo "NSTIP - PID= $WLS_NSTIP1"
    echo " "
    echo "WC - Spaces= $WLS_WSM1"
    echo " "


    Mark if this helps you.
    Regards,
    Kishore

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points