IBM Support

Learning more about wsadmin

Troubleshooting


Problem

Learning more about wsadmin is the first step in the troubleshooting process. This document provides you with educational information that can help you learn more about this topic.

Resolving The Problem

Tab navigation

Overview


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 does not apply to the Liberty profile.

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.

You can find more information on the usage of wsadmin in Knowledge Center in the article Using wsadmin scripting.

wsadmin scripting environment

The wsadmin tool contains facilities so that you can manage and customize the scripting environment. The wsadmin launcher utility is used to launch a scripting process.

  • For Windows® platforms:
    wsadmin.bat
  • For UNIX® platforms
    wsadmin.sh
This launch utility accepts arguments to specify the scripting language, any properties files to read, any profiles to execute, connection information, and optionally the name of a script to execute. Instead of entering a large amount of information at the command line when invoking wsadmin (especially if it is static information) you can specify information in a property file.


Sample scripts

The script library code is located in the (appServerRoot)/scriptLibraries directory. Within this directory, the scripts are organized into subdirectories according to functionality.


Property files

There are four levels of property files used by wsadmin:
  • System:
    Located by $WAS_HOME
  • User:
    Located by Java™ system property user.home
  • Environment Variable:
    Governed by environment variable WSADMIN_PROPERTIES
  • Invocation:
    Located by the -p option on the command line

Starting wsadmin

    • -f (from a script file)
    • -c (from command line)
    • -profile (loads more than 1 script file)
    • -conntype NONE (local mode)

There are 3 ways to connect to myServer

    1. Edit the wsadmin.properties file to reflect your server information:
    2. com.ibm.ws.scripting.connectionType=SOAP
      com.ibm.ws.scripting.port=(serverSoapPort)
      com.ibm.ws.scripting.host=(serverHostName)
    3. Create new properties (for example, myserver.properties) and use the -p option:
    4. (profileRoot)\bin> wsadmin -p myserver.properties
    5. Use the -port option:
    6. (profileRoot)\bin> wsadmin -port (serverSoapPort)
Online help

After starting the wsadmin tool, you can get help by the following ways:
  • To obtain general help, run the help command.
    • Using Jacl:
    • $AdminTask help
    • Using Jython:
    • print AdminTask.help()
  • To list the available command groups, run the help command with the -commandGroups parameter.
    • Using Jacl:
    • $AdminTask help -commandGroups
    • Using Jython:
    • print AdminTask.help('-commandGroups')
  • To list the available commands, run the help command with the -commands parameter.
    • Using Jacl:
    • $AdminTask help -commands
    • Using Jython:
    • print AdminTask.help('-commands')
  • To obtain help about a command group, run the help command with the group name.
    • Using Jacl:
    • $AdminTask help JCAManagement
    • Using Jython:
    • print AdminTask.help('JCAManagement')
  • To obtain help about an administrative command, run the help command with the parameter name.
    • Using Jacl:
    • $AdminTask help createJ2CConnectionFactory
    • Using Jython:
    • print AdminTask.help('createJ2CConnectionFactory')
  • To obtain help on a command step, use the step-specific help. Step-specific help provides the following data:
    • A description for the command step.
    • Information indicating if this step supports collection. A collection includes objects of the same type. In a command step, a collection contains objects that have the same set of parameters.
    • Information regarding each step parameter with its name and description. If a step parameter is required, an asterisk (*) is located in front of the name.
    • The following example obtains help on a command step:
      • Using Jacl:
      • $AdminTask help createCluster clusterConfig
      • Using Jython:
      • print AdminTask.help('createCluster', 'clusterConfig')
    • Use a wildcard character to search for help for a specific command.
      • To use a wildcard search pattern to search for the administrative command names that contain SSLConfig, specify:
      • print AdminTask.help("-commands", "*SSLConfig*")
      • To use a wildcard search pattern to search for the administrative command names that start with create, specify:
      • print AdminTask.help("-commands", "create*")
    • You can use a regular Java expression pattern or a wildcard pattern to specify command name for AdminTask.help('–commands') and AdminConfig list, types, and listTemplates functions.
      • To use a regular Java expression pattern to search for the administrative command names that start with create, specify:
      • print AdminTask.help("-commands", "create.*")
      • To use a Java expression pattern to search for the administrative command names that contain SSLConfig, specify:
      • print AdminTask.help("-commands", ".*SSLConfig.*")

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Administrative Scripting Tools (for example: wsadmin or ANT)","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.0.0.0;8.5.5;8.5;8.0;7.0","Edition":"Base;Network Deployment","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSNVBF","label":"Runtimes for Java Technology"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Java SDK","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21242693