Network Deployment (Distributed operating systems), v8.0 > Reference > Jython script library


Server query scripts

The scripting library provides multiple script procedures to automate your server configurations. This topic provides usage information for scripts that query the application server configuration. We can run each script individually, or combine procedures to create custom automation scripts for the environment.

All server management script procedures are located in the WAS_HOME/scriptLibraries/servers/V70 directory. Use the following script procedures to query the application server configuration:



checkIfServerExists

This script determines whether the server of interest exists in the configuration. To run the script, specify the node name and server name arguments, as defined in the following table:

checkIfServerExists argument descriptions. Run the script to see if a server exists.

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.

Syntax

AdminServerManagement.checkIfServerExists(nodeName, serverName)

Example usage

AdminServerManagement.checkIfServerExists("myNode", "myServer")


checkIfServerTemplateExists

This script determines whether the server template of interest exists in the configuration.

To run the script, specify the template name arguments, as defined in the following table:

checkIfServerTemplateExists argument descriptions. Run the script to see if a template exists.

Argument Description
templateName Name of the server template of interest.

Syntax

AdminServerManagement.checkIfServerTemplateExists(templateName)

Example usage

AdminServerManagement.checkIfServerTemplateExists("newServer")


getJavaHome

Display the Java home value.

To run the script, specify the node name and server name arguments, as defined in the following table:

getJavaHome argument descriptions. Run the script to see the Java home value.

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.

Syntax

AdminServerManagement.getJavaHome(nodeName, serverName)

Example usage

AdminServerManagement.getJavaHome("myNode", "myServer")


getServerProcessType

Display the type of server process for a specific server. To run the script, specify the node and server name arguments for the server of interest, as defined in the following table:

getServerProcessType argument descriptions. Run the script to see the type of server process.

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.

Syntax

AdminServerManagement.getServerProcessType(nodeName, serverName)

Example usage

AdminServerManagement.getServerProcessType("myNode", "server1")


getServerPID

Display the running server process ID for a specific target. To run the script, specify the node and server name arguments for the server of interest, as defined in the following table:

getServerPID argument descriptions. Run the script to see a running server process ID.

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.

Syntax

AdminServerManagement.getServerPID(nodeName, serverName)

Example usage

AdminServerManagement.getServerPID("myNode", "server1")


help

Display the script procedures that the AdminServerManagement script library supports.

To display detailed help for a specific script, specify the name of the script of interest, as defined in the following table:

help argument description. Run the script to see help.

Argument Description
scriptName Name of the script of interest.

Syntax

AdminServerManagement.help(scriptName)

Example usage

AdminServerManagement.help("getServerProcessType")


listJVMProperties

Display the properties that are associated with your JVM configuration.

To run the script, specify the node name, server name, and optionally the JVM property of interest, as defined in the following table:

listJVMProperties argument descriptions. Run the script to see JVM properties.

Argument Description
nodeName Optionally specifies the name of the node of interest.
serverName Optionally specifies the name of the server of interest.
JVMProperty Optionally specifies the JVM property to query.

Syntax

AdminServerManagement.listJVMProperties(nodeName, serverName, JVMProperty)

Example usage

AdminServerManagement.listJVMProperties("myNode", "myServer", "")


listServers

Display the servers that exist in the configuration. You can optionally specify the node name or server type to query for a specific scope, as defined in the following table:

listServers argument descriptions. Run the script to see what servers exist.

Argument Description
serverType Name of the server to query.
nodeName Name of the node to query.

Syntax

AdminServerManagement.listServers(serverType, nodeName)

Example usage

AdminServerManagement.listServers("APPLICATION_SERVER", "myNode")


listServerTemplates

Display the server templates in the configuration.

To run the script, specify the template version, server type, and template name, as defined in the following table:

listServerTemplates argument descriptions. Run the script to see what templates exists.

Argument Description
templateVersion Optionally specifies the version of the template of interest.
serverType Optionally specifies the type of server. Valid values include the GENERIC_SERVER, WEB_SERVER, APPLICATION_SERVER , and PROXY_SERVER server types.
templateName Optionally specifies the name of the template of interest.

Syntax

AdminServerManagement.listServerTemplates(templateVersion, serverType, templateName)

Example usage

AdminServerManagement.listServerTemplates("", "APPLICATION_SERVER", "default")


listServerTypes

Display the server types that are available on the node of interest.

To run the script, specify the node name, as defined in the following table:

Table 10. listServerTypes argument descriptions. Run the script to see the server types.

Argument Description
nodeName Optionally specifies the name of the node of interest.

Syntax

AdminServerManagement.listServerTypes(nodeName)

Example usage

AdminServerManagement.listServerTypes("myNode")


queryMBeans

This script queries the application server for Managed Beans (MBeans). Enhance the operation of an application server by defining command-line information for starting or initializing the application server process. Process definition settings define runtime properties such as the program to run, arguments to run the program, and the working directory.

Table 11. queryMBeans argument descriptions. Run the script with the node name and server name arguments.

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
mbeanType Type of MBean to query.

Syntax

AdminServerManagement.queryMBeans(nodeName, serverName, mbeanType)

Example usage

AdminServerManagement.queryMBeans("myNode", "server1", "Server")


showServerInfo

Display server configuration properties for the server of interest. The script displays the cell name, server type, product version, node name, and server name.

Table 12. showServerInfo argument descriptions. Run the script with the node name and server name arguments.

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.

Syntax

AdminServerManagement.showServerInfo(nodeName, serverName)

Example usage

AdminServerManagement.showServerInfo("myNode", "myServer")


viewProductInformation

Display the application server product version.

Syntax

AdminServerManagement.viewProductInformation()

Example usage

AdminServerManagement.viewProductInformation()

Use the script library to automate the application serving environment using wsadmin.sh
Automate application configuration


Related


Server settings configuration scripts
Server configuration scripts

+

Search Tips   |   Advanced Search