In addition to enabling Diagnostic Providers (DP) from the administration console, you can also use them through scripts from the Wsadmin tool.
Read the wsadmin tool information about using the tool with scripts.
$AdminControl queryNames diagnosticProvider=true,*And you will see an output that displays all of the Diagnostic Providers in a format like this:
"WebSphere:name=Default Datasource,process=server1,platform=dynamicproxy,node= camelhair,JDBCProvider=Derby JDBC Provider, diagnosticProvider=true,j2eeType=JDBCDataSource,J2EEServer=server1,Server=server1, version=6.1.0.0,type=DataSource, mbeanIdentifier=cells/camelhairCell/nodes/camelhair/servers/server1/resources.xml# DataSource_1131113688564, JDBCResource=Derby JDBC Provider,cell=camelhairCell" "WebSphere:name=DefaultEJBTimerDataSource,process=server1,platform=dynamicproxy, node=camelhair, JDBCProvider=Derby JDBC Provider (XA),diagnosticProvider=true,j2eeType= JDBCDataSource,J2EEServer=server1,Server=server1,version=6.1.0.0,type=DataSource, mbeanIdentifier=cells/camelhairCell/nodes/camelhair/servers/server1/ resources.xml#DataSource_1000001, JDBCResource=Derby JDBC Provider (XA),cell=camelhairCell" WebSphere:name=WebcontainerDiagnosticProvider,process=server1,platform= dynamicproxy,node=camelhair,diagnosticProvider=true, version=6.1.0.0,type=WebcontainerEventProvider,mbeanIdentifier=null, cell=camelhairCell
This ObjectName stored in the DP variable can be used on the methods, or you can use the Diagnostic Provider name as text or a variable.
set DPNm [$AdminControl invoke $DS getDiagnosticProviderNameById $DP]
WebContainerDP
Now the DiagnosticProvider (WebContainer) is addressable by its objectname in variable DP, or by its DiagnosticProvider name in variable DPNm. If you would prefer, you can hard-code the DPName WebContainerDP as it is short enough.
set DS [lindex [$AdminControl queryNames name=DiagnosticService,*] 0]
$AdminControl invoke $DS configDumpFormattedById [list $DP .* true null]
Item Concatenated Name | Value |
---|---|
customProperties = | Null |
defaultVirtualHostName = | default_host |
jvmProps = | Null |
localeProps = | Null |
servletCachingEnabled = | false |
aliases = | *:9080;*:80;*:9443; |
$AdminControl invoke $DS configDumpFormatted [list $DPNm .*auto.* true null]
Item Concatenated Name | Value |
---|---|
autoLoadFiltersEnabled = | false |
autoRequestEncoding = | false |
autoResponseEncoding = | false |
autoLoadFiltersEnabled = | false |
autoRequestEncoding = | false |
autoResponseEncoding = | false |