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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

websphere and the cmd line

Status
Not open for further replies.

QAteste

Technical User
Jun 14, 2002
23
US
Is there a way to list the application servers that websphere is managing from the command line?

Is there a way to get there status, ie if they are running, from the command line?

Is there a way to stop/start them from the command line?

TIA
- Dave Johnson
 
You could use TCL language to write scripts which administrate WebSphere App Server. Invoke WSCP mode of WebSphere and execute commands on the prompt.

eg.

/WebSphere/AppServer/bin/wscp.sh
wscp> ApplicationServer list

The above command would list application servers available on your node. There are many more commands which could be executed from this mode. Create file with .tcl extension containing these commands, helps you to execute a set of commands in one shot.
 
If you are in a unix environment, you could try this little script that basically just parses the ps command to find what WebSphere related processes are running. Try it and see if you like it:
Code:
#!/usr/bin/ksh

echo "owner pid   ppid  process"
ps -ef | grep java | awk '
/com.ibm.ejs/ {
a=substr($0,index($0,"com.ibm.ejs.sm")+15)
if (index(a,"EJBServerProcess")>0) {
 b=substr(a,index(a,"EJBServerProcess")+17)
 c=substr(b,0,index(b,":")-1)
 a="server.ManagedServer " c
}
else {
 b=substr(a,0,index(a," ")-1)
 a=b
}
printf("%5s %d %d %s\n",$1,$2,$3,a );}'

your mileage may vary, see dealer for details - you may need to adjust the values in the substr to return the correct process names.

Good luck. Einstein47
("Vision without action is a daydream - Action without vision is a nightmare. Japanese Proverb")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top