Configure Performance Manager Infrastructure using scripting
You can use scripting to configure a Performance Manager Infrastructure service. Before starting this task, the wsadmin tool must be running. See the Start the wsadmin scripting client article for more information.
Overview
Use the following steps to configure the Performance Manager Infrastructure (PMI) service for an appserver:
Procedure
- Identify the appserver and assign it to the s1 variable, for example:
- Use Jacl:
set s1 [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]
- Use Jython:
s1 = AdminConfig.getid('Cell:mycell/Node:mynode/Server:server1/')where:
set Jacl command s1 variable name $ Jacl operator for substituting a variable name with its value AdminConfig object representing the WebSphere Application Server configuration getid AdminConfig command Cell attribute mycell value of the Cell attribute Node attribute mynode value of the Node attribute Server attribute server1 value of the Server attribute Example output:
server1(cells/mycell/nodes/mynode/servers/server1|server.xml#Server_1)
- Identify the PMI service that belongs to the server and assign it to the pmi variable...
- Use Jacl:
set pmi [$AdminConfig list PMIService $s1]
- Use Jython:
pmi = AdminConfig.list('PMIService', s1) print pmiwhere:
set Jacl command pmi variable name $ Jacl operator for substituting a variable name with its value AdminConfig object representing the WebSphere Application Server configuration list AdminConfig command PMIService AdminConfig object s1 evaluates to the ID of the appserver specified in step number 1 Example output:
(cells/mycell/nodes/mynode/servers/server1|server.xml#PMIService_1)
- Modify the attributes...
- Use Jacl:
$AdminConfig modify $pmi {{enable true} {statisticSet ALL}}
- Use Jython:
AdminConfig.modify(pmi, [['enable', 'true'], ['statisticSet','ALL']]This example enables PMI service and sets the specification levels for all of components in the server. The following are the valid specification levels for the components:
NONE No statistics are enabled. BASIC Statistics specified in J2EE 1.4, as well as top statistics like CPU usage and live HTTP sessions are enabled. This set is enabled out-of-the-box and provides basic performance data about runtime and application components. EXTENDED Basic set plus key statistics from various WAS components like WLM and Dynamic caching are enabled. This set provides detailed performance data about various runtime and application components. ALL All statistics are enabled. CUSTOM Enable or disable statistics selectively.
- Save the configuration changes. See the Saving configuration changes with the wsadmin tool article for more information.
- In a network deployment environment only, synchronize the node. See the Synchronizing nodes with the wsadmin tool article for more information.
Use the AdminConfig object for scripted administration
Enabling PMI using the wsadmin tool
Related Reference
Commands for the AdminConfig object