InfoCenter Home >
6: Administer applications >
6.6: Tools and resources quick reference >
6.6.0: About user assistance >
6.6.0.2: Command line administration >
6.6.0.2.2: WebSphere Control Program (wscp) >
6.6.0.2.2.1: WebSphere Control Program (wscp) overview

6.6.0.2.2.1: WebSphere Control Program (wscp) overview

The WebSphere Control Program (wscp) is a command-line and scripting interface for administering resources in WebSphere Application Server Advanced Edition. It is based on Tcl (tool command language). Tcl is a portable command language that provides programming facilities, such as variables, procedures, conditionals, list-processing functions, and looping constructs. The wscp interface extends Tcl by providing a set of commands for manipulating WebSphere objects.

This section contains the following topics:


The Administrative Console and wscp

The administrative server manages the contents and activities of a domain by maintaining a repository. A repository is the database of information about all resources in a domain. The repository allows administration of a domain from any machine--all information is stored in a central location. The repository contains descriptive information about the applications that are configured to run in the domain. For example, it contains the names of all application servers, nodes, server groups, and J2EE resources (such as JDBC providers), and their current state (running, defined, or stopped).

All administration takes place through the manipulation of objects in the repository. Each resource in a domain corresponds to an object in the repository. For example, when you create an application server, a corresponding application server object is created in the repository.

Both the administrative console and the wscp interface can be used to administer the resources in a domain. They both modify the repository in response to user commands, and they both reflect any changes to the configuration and status of the domain. Console users access and modify the repository via a graphical user interface; wscp users manipulate objects in the repository by executing commands or scripts. The console and the wscp interface are compatible. The results of actions performed with wscp are reflected in the console interface, and vice versa.

Both the console and wscp can be used to do the following:

  • Define, configure, and manage application servers, cloned application servers, and other application server resources from any node in the network.

  • Install applications (by using wizards in the console and install commands and scripts in wscp).

  • Perform daily administrative operations, such as starting and stopping application servers and making changes to their configuration.

  • Replicate application servers to improve performance or availability or to simplify administration tasks (by defining and managing server groups).

  • Track the occurrence of specific events by setting and enabling tracing.

Benefits of using wscp

The wscp interface provides a high-level command-line administrative tool with programming capabilities. With wscp, you can do the following:

  • Use Tcl (tool command language) to extend and automate administrative operations through the use of scripts. For example, you can write a script to start and stop servers or applications as a group. You can also use scripts to create a basic configuration or (by invoking the XML Configuration Management Tool, XMLConfig) to store an existing configuration. The stored configuration can be used as a backup or to re-create a configuration on another machine.

  • Use Tcl to create custom procedures for specialized administrative tasks, such as making identical modifications to a particular attribute throughout the domain, or displaying the values of select attributes that need to be frequently monitored.

  • Issue UNIX or Windows NT commands from within a wscp session and incorporate them into scripts.

Limitations of using wscp

Although wscp offers many of the same administration tasks as the WebSphere Advanced Administrative Console, the following differences apply:

  • New configurations or changes to existing configurations made with wscp are not immediately reflected in the console. You must actively poll the administrative server repository to see the changes by selecting all or a portion of the Topology view in the console and then using the Refresh button.

    Similarly, if a resource is created or deleted in the console, the change will not be immediately reflected in wscp. You must explicitly refresh all object references in the repository cache by issuing a wscp list operation for the instance's object type. (Alternatively, exiting and reinvoking wscp also refreshes the cache.)

    To avoid problems due to inconsistent cached information, it is best to avoid issuing concurrent operations on the same object from within wscp and the console.

  • All administrative tasks that can be done with the console can be done with wscp, with the exception of higher-level aggregate tasks such as those in the wizards--for example, creating an application. Instead, wscp scripts can be created to provide the same functionality as provided by the wizards.

Supported object types

In wscp, a resource is represented as an object type. For example, the object type ApplicationServer represents an application server (enterprise bean server) and the object type DataSource represents a database. Each object type has attributes (called properties in the console) that describe the characteristics of the object. For example, application server object attributes include Executable, CurrentState, and WorkingDirectory. Data source object attributes include DatabaseName, MinPoolSize, and MaxPoolSize. An object type can be thought of as a template object that defines the characteristics of all objects of that type. Instances of the object type represent specific objects in the domain.

The wscp interface manipulates objects in the repository by performing operations on them. Examples of operations are create, start, show, modify, and stop. The following is a list of object types supported by wscp.

Note:
Any object that represents a live entity outside of the repository (for example, application servers), can be started and stopped with wscp. The attributes of several object types cannot be modified. The message EditorNotDefinedForThisProperty is displayed when you attempt to access these attributes.

  • ApplicationServer

  • DataSource

  • EnterpriseApp

  • GenericServer

  • J2CConnectionFactory

  • J2CResourceAdapter

  • JDBCDriver

  • JMSConnectionFactory

  • JMSDestination

  • JMSProvider

  • MailSession

  • Module

  • Node

  • ServerGroup

  • URL

  • URLProvider

  • VirtualHost

As the console does, wscp automatically provides default attributes and values for an object when the object is created. You need to specify values only for those attributes that are required and lack defaults. If needed, you can override the default value for any attribute when creating an object by specifying a value for that attribute.

In the repository, objects are represented as attribute lists. An attribute list is a collection of attribute-value pairs. The following output shows how wscp displays the attributes of a DataSource object named ds1:

{Name ds1} {FullName /JDBCDriver:connDrv/DataSource:ds1/}
{Description null} {ConfigProperties {{URL
jdbc:oracle:thin:@wssol2:1521:oraejs}}} {ConnTimeout 180}
{DatabaseName WAS} {DefaultPassword null} {DefaultUser null}
{DisableAutoConnectionCleanup False} {IdleTimeout 1800} {JNDIName
jdbc/carddb} {MaxPoolSize 10} {MinPoolSize 1} {OrphanTimeout 1800}
{StatementCacheSize 100}

See 6.6.0.2.2.3.2: Specifying lists in wscp commands for details on attribute lists.

In general, objects are created by specifying the object type, the operation to be performed, the name of the object instance, and one or more options. For example, to create a DataSource object, you specify the object type (DataSource), the operation (create), the name of the object instance to create, and if attributes are required, the -attribute option. The argument to the -attribute option is a list of attributes and their values. For example, the following wscp command (in interactive mode) creates a DataSource object named ds1 that is a resource for the WAS database. The database driver must also be specified:

wscp> DataSource create /JDBCDriver:DB2Driver/DataSource:ds1/
-attribute {{DatabaseName WAS}}

In the following example, the ApplicationServer start command is used to start an application server named myServer:

wscp> ApplicationServer start /Node:dev-pc/ApplicationServer:myServer/

See 6.6.0.2.2.2: Command syntax and usage for more example commands, detailed syntax, and an explanation of the convention for object names.

The following example uses the Tcl foreach command to iterate through all application servers in a domain and stop them:

wscp> foreach ejbserver [ApplicationServer  list] {ApplicationServer stop $ejbserver}

See 6.6.0.2.2.3.3: Example use of wscp and Tcl and 6.6.0.2.2.4: Example wscp commands, procedures, and scripts.


Supported services and commands

In addition to objects, wscp supports several services and commands that perform various administration tasks, such as configuring WebSphere Application Server, enabling global security, enabling tracing and data collection, manipulating Java Naming and Directory Interface (JNDI) contexts, and displaying help on wscp commands. These services are as follows:

  • Context

  • DrAdmin

  • Help

  • PmiService

  • Remote

  • SecurityConfig

  • SecurityRoleAssignment

  • XMLConfig
Go to previous article: WebSphere Control Program Go to next article: 6.6.0.2.2.2: Command syntax and usage

 

 
Go to previous article: WebSphere Control Program Go to next article: 6.6.0.2.2.2: Command syntax and usage