This is a 3 part tutorial series. This is the first of the three and in this i presented the basics of WSADMIN Tool and 5 objects we had with WSADMIN tool in websphere.
The idea behind this series of tutorials is to present here is something that can be easy for a beginner to understand and for an experienced guy to provide a quick access to the information.
WSADMIN is a scripting interface used at the command line. You can use the wsadmin tool to manage WebSphere Application Server as well as the configuration, application deployment, and server run-time operations.
WSADMIN tool can be run in 3 different modes
1. Interactive mode
This is the default mode. In this you’ll enter the command, wait for output and then enter the second command. This is useful for quick administrative tasks
>wsadmin> your Command
2. Inline mode
You can specify this mode by using –C after wsadmin. Here you will run one command at a time. The command will specified inline with wsadmin.
$wsadmin.sh –C your_command
3. Using a File Input
A script file can be given as input using –f option along with wsadmin.
$ wsadmin.sh –f your_script_file
How to use WSADMIN
wsadmin.sh host<host> port<port>
Host name is the name of the machine which has websphere running and port number is either SOAP or RMI port number of the websphere JVM to which you want to connect.
If the Global security is enabled…you will be asked for user name and password or you can specify it inline using –user and –password.
you can specify the language of the script file, the command, or an interactive shell using –lang. The possible languages include: Jacl and Jython
you can run the profile scripts before executing the actual wsadmin commands by using –profile option.
To specify the profile from which the wsadmin tool will run, you can use –profileName option.
Note: the wsadmin command will be available in bin directory of your DMGR as well as the bin your application server profiles.
you can use either SOAP or RMI to connect to the wsadmin and this can be specifeid using –conntype option.
WSADMIN Syntax and all options
wsadmin [-c <commands>] [-p <properties_file_name>] [-profile <profile_script_name>] [-profileName <profile_name>] [-f <script_file_name>] [-javaoption java_option] [-lang language] [-wsadmin_classpath classpath] [-conntype SOAP [-host host_name] [-port port_number] [-user userid] [-password password] | RMI [-host host_name] [-port port_number] [-user userid] [-password password] | NONE]
Example: wsadmin -lang jython -f test1.py -profile setup.py -conntype SOAP -port mymachinesoapportnumber -host mymachine -userid userid -password password
WSADMIN has 5 objects
- Help – The Help object provides general help and dynamic online information about the currently running MBeans. You can use the Help object as an aid in writing and running scripts with the AdminControl object.
- AdminConfig – Use the AdminConfig object to invoke configuration commands and to create or change elements of the WebSphere Application Server configuration
- AdminControl – Use the AdminControl object to invoke operational commands that deal with running objects in the WebSphere Application Server.
- AdminApp – Use the AdminApp object to install, modify, and administer applications.
- AdminTask – Use the AdminTask object to run an administrative command.
Next Part: Using the WSADMIN objects: [using Jython language]