Scripting is a non-graphical alternative that you can use to configure and manage WebSphere Application Server.
The WebSphere Application Server wsadmin tool provides the ability to run scripts. The wsadmin tool supports a full range of product administrative activities.
The wsadmin tool supports two scripting languages: Jacl and Jython. Five objects are available when you use scripts:
- AdminControl: Use to run operational commands.
- AdminConfig: Use to run configurational commands to create or modify WebSphere Application Server configurational elements.
- AdminApp: Use to administer applications.
- AdminTask: Use to run administrative commands.
- Help: Use to obtain general help.
Procedure
The following examples launch the wsadmin tool:
-
Launch the wsadmin tool using Jython:wsadmin.bat -lang jython
-
Launch the wsadmin tool using Jythonwsadmin.sh -lang jython
-
Launch the wsadmin tool using Jython when security is enabled:wsadmin.bat -lang jython -user wsadmin -password wsadmin
-
Launch the wsadmin tool using Jython when security is enabled:wsadmin.sh -lang jython -user wsadmin -password wsadmin
-
Launch the wsadmin tool using Jacl with no options:wsadmin.bat -lang jacl
-
Launch the wsadmin tool using Jacl with no options:wsadmin.sh -lang jacl
- Run scripting commands as individual commands
- Run the wsadmin tool with the -c option.
On a Unix operating system, if you invoke a command that includes a dollar sign character ($) using the wsadmin -c option, the command line attempts to substitute a variable. To avoid this problem, escape the dollar sign character with a backslash character (\). For example: wsadmin -c "\$AdminApp install ...".
The following examples run commands individually:-
Run the list command for the AdminApp object using Jython: wsadmin -c "$AdminApp list"
-
Run the list command for the AdminApp object using Jython: wsadmin.sh -lang jython -c 'AdminApp.list()'
-
Run the list command for the AdminApp object using Jacl: wsadmin -lang jython -c "AdminApp.list()"
-
Run the list command for the AdminApp object using Jacl: wsadmin.sh -c "\$AdminApp list"
orwsadmin.sh -c '$AdminApp list'
Run the a1.py script using
Jython:wsadmin.sh -lang jython -f al.py
-
Choose one of the following:
No comments:
Post a Comment