Wsadmin Details
To administer the WebSphere Application Server environment, wsadmin includes some specialized administrative objects.
Object Name Description
AdminConfig | Object used to view and manipulate configuration elements (xml files). |
AdminControl | Object used to view and manipulate active application server objects (MBeans) |
AdminApp | Object used to install and manipulate applications. |
AdminTask | Object used to execute administrative and server management commands. |
Help | Object used to provide usage information about the administrative objects. |
1. AdminConfig Overview : Looking at the AdminConfig.help() text, you see that this object can be used to perform several operations on WebSphere Application Server configuration objects. These operations include the following:
• List
• Create
• Remove
• Display
• Modify
AdminConfig methods:
list()
getid()
getObjectName()
showAttribute()
AdminControl methods:
getAttribute()
getCell()
2. AdminControl Overview : The AdminControl methods here are grouped together to help you understand their respective roles
The AdminControl Object
getNode()
completeObjectName()
startServer()
stopServer()
3. AdminApp Overview : The AdminApp object operates on applications. AdminApp.help() provides the complete list of method calls, and the details about each method can be displayed by calling AdminApp.help(‘methodName’ ).
The following types of operations can be performed on an application:
– Information
– Install
-Uninstall
– Modify
$WAS_HOME/Dmgr/bin/wsadmin.sh -conntype none -lang jython
Find out more info on an erorr message WASX7023E
wsadmin>print Help.message(‘WASX7023E’)
Explanation: An error was reported from the connector when trying to establish a connection to the host.
User action: Examine the accompanying exception information and the information in the wsadmin.traceout file to determine the cause of the error.
Locate configured ports for a system
wsadmin>print AdminTask.reportConfiguredPorts()
Ports configured in cell server1_Cell
Node server1_Manager / Server dmgr
Server1:7277 CELL_DISCOVERY_ADDRESS
Server1:9809 BOOTSTRAP_ADDRESS
Server1:8879 SOAP_CONNECTOR_ADDRESS
*:9060 WC_adminhost
*:9352 DCS_UNICAST_ADDRESS
*:9043 WC_adminhost_secure
List Server ports used by WAS, please replace Dmgr with Node Names
wsadmin>print AdminTask.listServerPorts(‘Dmgr’);
[CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS [ [port 9403] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[WC_adminhost [ [port 9060] [node localhost_Manager] [host *] [server Dmgr] ]]
[DCS_UNICAST_ADDRESS [ [port 9352] [node localhost_Manager] [host *] [server Dmgr] ]]
[BOOTSTRAP_ADDRESS [ [port 9809] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[SAS_SSL_SERVERAUTH_LISTENER_ADDRESS [ [port 9401] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[SOAP_CONNECTOR_ADDRESS [ [port 8879] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[CELL_DISCOVERY_ADDRESS [ [port 7277] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[ORB_LISTENER_ADDRESS [ [port 9100] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[CSIV2_SSL_MUTUALAUTH_LISTENER_ADDRESS [ [port 9402] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[WC_adminhost_secure [ [port 9043] [node localhost_Manager] [host *] [server Dmgr] ]]
Check if the current configuration is correct
wsadmin>print AdminTask.reportConfigInconsistencies();
Configuration consistency report for cell server1_Cell
No consistency problems were found.
Print Server Configuration
wsadmin>print AdminConfig.list(‘Server’);
Dmgr(cells/localhost_Cell/nodes/localhost_Manager/servers/Dmgr|server.xml#Server_1)
ihs-localhost(cells/localhost_Cell/nodes/localhost_Node01/servers/ihs-localhost|server.xml#Server_1264773909852)
nodeagent(cells/localhost_Cell/nodes/localhost_Node01/servers/nodeagent|server.xml#Server_1120677326772)
server_member1(cells/localhost_Cell/nodes/localhost_Node01/servers/server_member1|server.xml#Server_1265379120807)
server_member2(cells/localhost_Cell/nodes/localhost_Node01/servers/server_member2|server.xml#Server_1265379122341)
Disable Application Security
[was61@bin]$ ./opt/IBM/WebSphere/AppServer/profiles/Profile01/Dmgr/bin/wsadmin.sh -conntype NONE
wsadmin>AdminTask.isAppSecurityEnabled();
‘true’
wsadmin>securityoff();
LOCAL OS security is off now but you need to restart server1 to make it affected.
wsadmin> $AdminConfig save;
WebSphere Version
wsadmin>svr = AdminControl.queryNames( ‘type=Server,*’ )
wsadmin>print AdminControl.invoke( svr, ‘getVersionsForAllProducts’ )
WASX7015E: Exception running command: “AdminControl.invoke( svr, ‘getVersionsForAllProducts’ )”; exception information:
com.ibm.ws.scripting.ScriptingException: WASX7025E: Error found in String “WebSphere:name=dmgr,process=dmgr,platform=proxy,node=Server1_Manager,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/Server1_Cell/nodes/Server1_Manager/servers/dmgr/server.xml#Server_1,cell=Server1_Cell,spec=1.0,processType=DeploymentManager
WebSphere:name=nodeagent,process=nodeagent,platform=proxy,node=Server1_Node01,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/Server1_Cell/nodes/Server1_Node01/servers/nodeagent/server.xml#Server_1120677326772,cell=Server1_Cell,spec=1.0,processType=NodeAgent
WASX7015E: Exception running command: “AdminControl.invoke( svr, ‘getVersionsForAllProducts’ )”; exception information:
com.ibm.ws.scripting.ScriptingException: WASX7025E: Error found in String “WebSphere:name=dmgr,process=dmgr,platform=proxy,node=eugbbopg03lt_Manager,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/eugbbopg0 3lt_Cell/nodes/eugbbopg03lt_Manager/servers/dmgr/server.xml#Server_1,cell=eugbbopg03lt_Cell,spec=1.0,processType=DeploymentManager
WebSphere:name=nodeagent,process=nodeagent,platform=proxy,node=eugbbopg03lt_Node01,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/eugbbopg03lt_Cell/nodes/eugbbopg03lt_Node01/servers/nodeagent/server.xml#Ser ver_1120677326772,cell=eugbbopg03lt_Cell,spec=1.0,processType=NodeAgent
WebSphere:name=server_member1,process=server_member1,platform=proxy,node=eugbbopg03lt_Node01,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/eugbbopg03lt_Cell/nodes/eugbbopg03lt_Node01/servers/se rver_member1/server.xml#Server_1259674425316,cell=eugbbopg03lt_Cell,spec=1.0,processType=ManagedProcess
WebSphere:name=server_member2,process=server_member2,platform=proxy,node=eugbbopg03lt_Node01,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/eugbbopg03lt_Cell/nodes/eugbbopg03lt_Node01/servers/se rver_member2/server.xml#Server_1259674426040,cell=eugbbopg03lt_Cell,spec=1.0,processType=ManagedProcess”; cannot create ObjectName.
[…] ASM ftp/http Access […]