Sunday, June 1, 2014

Understanding WSAdmin

The wsadmin commands can be divided up into four basic groups (actually objects): AdminApp, AdminConfig, AdminControl, AdminTask, and Help.


AdminApp is the set of commands involved with the installation, removal and editing of applications.  The best way to find information on the available commands is to search on “AdminApp” in the InfoCenter and select the result named “Commands for the AdminApp object”.

AdminConfig is the set of commands used to alter specific items within the configuration. There are commands within the AdminConfig object that allow you to create, remove,
and modify attributes of objects within the configuration.  The best way to find information on the available commands is to search on “AdminConfig” in the InfoCenter and select the result named “Commands for the AdminConfig object”.

AdminControl is the set of commands used to control objects within the configuration. These are the commands used to start and stop servers, start and stop applications, test connections, start node synchronization, etc.  The best way to find information on the available commands is to search on “AdminControl” in the InfoCenter and select the result named “Commands for the AdminControl object”.

AdminTask is the set of commands used to perform specific tasks using the wsadmin interface.  It would be used for such things as creating or deleting a server, managing the port configuration, running reports on the configuration, etc.  Most everything that you would do with the AdminTask commands could also be done using combinations of the AdminApp, AdminConfig, and AdminControl commands, but someone in wsadmin development has packaged them up into useful commands and delivered them under the AdminTask object.  The best way to find information on the available commands is to search on “AdminTask” in the InfoCenter and select the result named “Commands for the AdminTask object”.  At the bottom of that entry you would find links to the commands associated with the various groups of the AdminTask object (ClusterConfigCommands, PortManagement, AdminstrationReport, etc.).

There is help available at a “base” level:



print Help.help();


will give a list of the objects and statements for which help is available.

There is help available on each of the other objects mentioned, for instance the AdminTask object:

print AdminTask.help()

will provide a list of the available help options for the AdminTask object.  Drilling down a further level:

print AdminTask.help(“-commands”)

will print a list of all of the commands available under the AdminTask object. Continuing to an even finer level:

print AdminTask.help("listServerPorts")

will provide help on the specific command, listServerPorts, of the AdminTask object.

Naturally, the most difficult part of writing a script is to know which of the hundreds of commands is the correct one for each task.  There is some help available in the WebSphere V6.1 adminconsole, using the command assistance notifications.  To enable this option, you set it in the adminconsole >> System administration >> Console preferences section.




Once it is set, after you have done something in the adminconsole that you would like to duplicate in a script, you would click on the command assistance link in the help box on the right hand side of the console.


If Global Security is turned off, the script will run without any prompting of username/password. 

If Global Security is turned ON, the script will prompt for username and password, to disable prompting follow below 2 methods:

1) Run the script line below:
 bin/wsadmin.sh -username wasadmin -password wasadmin –lang jython –f FILE_NAME NODE_NAME 

2) Open soap.client.props under <PROFILE_PATH>/properties and do below settings:



  •   com.ibm.SOAP.securityEnabled=true
  •   com.ibm.SOAP.loginUserid=wasadmin 
  •   com.ibm.SOAP.loginPassword=wasadmin

No comments:

Post a Comment