Server query scripts
The scripting library provides multiple script procedures to automate the server configurations. See the 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 the configuration. To run the script, specify the node name and server name arguments, as defined in the following table:
argument descriptions. Run the script to see if a server
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 our configuration. To run the script, specify the template name arguments, as defined in the following table:
argument descriptions. Run the script to see if a template
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:
argument descriptions. Run the script to see the Java
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:
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:
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 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:
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 the 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:
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 the configuration. We can optionally specify the node name or server type to query for a specific scope, as defined in the following table:
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 the configuration. To run the script, specify the template version, server type, and template name, as defined in the following table:
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 that are available on the node of interest. To run the script, specify the node name, as defined in the following table:
argument descriptions. Run the script to see the server
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.
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.
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 tasks
Use the script library to automate the application serving environment Automating application configurations
Server settings configuration scripts Server configuration scripts