WAS v8.5 > Reference > Jython script libraryServer query scripts
The scripting library provides 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 app_server_root/scriptLibraries/servers/V70 directory. Use the following script procedures to query the application server configuration:
- checkIfServerExists
- checkIfServerTemplateExists
- getJavaHome
- getServerProcessType
- getServerPID
- help
- listJVMProperties
- listServers
- listServerTemplates
- listServerTypes
- queryMBeans
- showServerInfo
- viewProductInformation
checkIfServerExists
This script determines whether the server of interest exists in your 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 your 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
This script displays 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
This script displays 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
This script displays 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
This script displays the script procedures 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
This script displays the properties 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
This script displays the servers that exist in your configuration. We 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
This script displays the server templates in your 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
This script displays the server types available on the node of interest. To run the script, specify the node name, as defined in the following table:
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.
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
This script displays server configuration properties for the server of interest. The script displays the cell name, server type, product version, node name, and server name.
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
This script displays the application server product version.
Syntax
AdminServerManagement.viewProductInformation()
Example usage
AdminServerManagement.viewProductInformation()
Related
Use the script library to automate the application serving environment using wsadmin.sh
Automating application configurations using wsadmin.sh
Reference:
Server settings configuration scripts
Server configuration scripts