Run the wsadmin tool
This topic describes how to start and stop an interactive wsadmin session and other ways to invoke wsadmin commands.
The interactive session is a shell environment in which you can run wsadmin commands and scripts.
You can also run a single command or script file without starting an interactive session, or run commands in a profile before the interactive session starts. The other ways that you can invoke wsadmin commands are:
- Run wsadmin commands individually
- Run wsadmin commands in a script
- Run wsadmin commands in a profile
To start an interactive wsadmin session, follow these steps:
Enter the Start Qshell (STRQSH) command on an OS/400 command line.
Use the cd command to change to the bin directory of the product installation root:
cd /QIBM/ProdData/WebAS5/Base/binorcd /QIBM/ProdData/WebAS5/ND/binAt the Qshell prompt, enter this command:
wsadmin -instance instancewhere instance is the name of the instance that you want to administer.
Before you exit the interactive session, run this command to save your configuration changes:
$AdminConfig saveIf you do not run this command, wsadmin discards your changes when you exit the interactive session.
To exit wsadmin, enter this command at the wsadmin prompt:
exitRun wsadmin commands individually
To run commands individually, specify the -c option when you run the wsadmin command.
wsadmin -instance instance -c '$AdminApp list' WASX7209I: Connected to process "server" on node node using SOAP connector; The type of process is: UnManagedProcess adminconsole DefaultApplication ivtAppIn this example, instance is the name of your WebSphere Application Server instance, server is the name of your application server, and node is the name iSeries host server:
When you run commands with the -c parameter, configuration changes are saved automatically. You do not need to run the $AdminConfig save command.
Run wsadmin commands in a script
To run commands in a script, specify the -f option when you run the wsadmin command:
wsadmin -instance instance -f 'script.jacl' WASX7209I: Connected to process "server" on node node using SOAP connector; The type of process is: UnManagedProcess adminconsole DefaultApplication ivtAppIn this example, instance is the name of your WebSphere Application Server instance, server is the name of your application server, node is the name of the node where your instance runs, and script.jacl is the fully qualified path of a Jacl script that contains these commands:
set apps [$AdminApp list] puts $appsIf you run a script file that makes changes to your application server's configuration, include the $AdminConfig save command at the end of the script. If you do not include this command, wsadmin does not save your changes.
After you run a script, wsadmin returns you to the Qshell prompt.
Run wsadmin commands in a profile
The wsadmin tool starts an interactive session after it runs the commands in a profile.
To run commands in a profile, specify the -profile option when you run the wsadmin command.
wsadmin -instance instance -profile 'profile.jacl' WASX7209I: Connected to process "server" on node node using SOAP connector; The type of process is: UnManagedProcess Applications currently installed: adminconsole DefaultApplication ivtApp WASX7029I: For help, enter: "$Help help" wsadmin>In this example, instance is the name of your WebSphere Application Server instance, server is the name of your application server, node is the name of the node where your instance runs, and profile.jacl is the fully qualified path of a profile that contains these commands:
set apps [$AdminApp list] puts "Applications currently installed:\n$apps"