WLST get current sessions and connections weblogic - weblogic-10.x

i need a wlst script to get current sessions of a specific deployment and current connections of a managed server. weblogic version 10.3.6.0
Is there any wlst command to search an attribute name.

connect('user','pass','t3://ip:port')
serverRuntime()
get('/ApplicationRuntimes/application name/ComponentRuntimes/managed servername/application name/OpenSessionsCurrentCount')
get('/ServerChannelRuntimes/Default[http]/ConnectionsCount')
disconnect()

Related

Modification to Websphere Application server Admin Console URL

One of our app team has completed WAS server base installation. After the installation is complete he requires two things.
WebSphere admins to be able to access the WebSphere admin console via a URL
Users to be able to access the WAS Portal
To connect to the URL’s, they first connect to VPN and use the browser from base machine directly.By default we are seeing these urls.
Admin URL: https://hostnane.ibm.com:9043/ibm/console/logon.jsp
User URL https://hostname.ibm.com ( this one is hypothetical for now)
Application team wants to convert ibm.com to mycompany.com.
Can someone advise how can we change ?
Please do the next step by step:
1. How to change hostname on WebSphere Application Server
If you are moving your IBM WebSphere Application Server configuration or migrating your environment, you might have to change host names or migrate profiles from one machine to another.
For example, the old hostname is example.com, we want to change to was-tpx04.hq.com
If the host name of a server or its ports is incorrect, then you might experience problems such as errors when you attempt to stop a server.
First, correct the host name for an application server using the wsadmin.sh scripting tool and command line tools.
was-tpx04:/u01/IBM/WebSphere/AppServer/bin # ./wsadmin.sh -conntype NONE -lang jython
WASX7357I: By request, this scripting client is not connected to any server process. Certain configuration and application operations will be available in local mode.
WASX7031I: For help, enter: "print Help.help()"
wsadmin>AdminConfig.list('ServerIndex')
'(cells/exampleNode01Cell/nodes/exampleNode01|serverindex.xml#ServerIndex_1)'
wsadmin>AdminConfig.modify('(cells/exampleNode01Cell/nodes/exampleNode01|serverindex.xml#ServerIndex_1)', "[[hostName was-tpx04.hq.com]]")
''
wsadmin>AdminConfig.show('(cells/exampleNode01Cell/nodes/exampleNode01|serverindex.xml#ServerIndex_1)', 'hostName')
'[hostName was-tpx04.hq.com]'
wsadmin>AdminConfig.save()
''
wsadmin>exit
was-tpx04:/u01/IBM/WebSphere/AppServer/bin # ./stopServer.sh server1 -profileName AppSrv01
ADMU0116I: Tool information is being logged in file
/u01/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/stopServer.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: server1
ADMU3201I: Server stop request issued. Waiting for stop status.
ADMU4000I: Server server1 stop completed.
was-tpx04:/u01/IBM/WebSphere/AppServer/bin # ./startServer.sh server1 -profileName AppSrv01
ADMU0116I: Tool information is being logged in file
/u01/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1/startServer.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: server1
ADMU3200I: Server launched. Waiting for initialization status.
ADMU3000I: Server server1 open for e-business; process id is 52604
was-tpx04:/u01/IBM/WebSphere/AppServer/bin #
Now, the hostname looks as follows:
2. Second, you need to correct the host names for the ports that an
application server opens.
For the application server, select Servers > Application servers > application server > Ports.
Select a port whose host name needs changing.
Change the host name in the Host field; Click OK. Change the host name is was-tpx04.hq.com
Continue selecting ports and changing host names until you correct each of the host names for the server ports.
Save the changes to the master configuration.
Restart the server.

filenotfoundException when using startNode.bat command

I am trying to restart my node by running StartNode.bat in cmd. But it is giving me the following error,
ADMU0111E: Program exiting with error: java.io.FileNotFoundException: C:\Users{userid}\workspaces\was_profiles{profilename}\config\cells\localcell\nodes\localnode\servers\nodeagent\server.xml (The system cannot find the path specified.) When I checked the above path, server.xml is present in the path C:\Users{userid}\workspaces\was_profiles{profilename}\config\cells\localcell\nodes\localnode\servers\server1\server.xml. I am not sure how to restart my node. Also, I am restarting the node, since I get ORA error invalid username/password issue while trying to test my datasource connection in IBM websphere.
Most of the posts suggest me to restart websphere server and nodeagent as well. Eventually, when I start the nodeagent, I get the above error. I tried to use syncNode command, but could not find the deployment manager host name, port details for my application.
It looks like you have single server version installed, not network deployment. In that case you dont have node and deployment manager, but just single server.
You should use commands like:
startServer.bat server1 - to start the server
stopServer.bat server1 - to stop server

Is is possible to clone a application server in Websphere

I have deployed an application on server1 in Websphere 8.5.5
Can I clone it to create server2 with the same application deployment and datasources.
In case you are in an ND environment you can create a server template (From the console: Websphere Application Servers > Templates > New ) based on the server1 and then create server2 based on this template.
This way you easily get all configuration of server1 (datasources, jvm arguments etc) into server2.
You can install WAS at same level on second machine and then use "manageprofiles -backupProfile" and "manageprofiles -restoreProfile" commands to move profile to machine2. Then use the AdminTask.changeHostName ('[-interactive]') to change hostname on the machine.
You can change nodename to different nodename using renameNode.bat also. The only thing is there will be no command to change cellname and you will have same cellname as original server.
For more details please review the link below :
http://www-01.ibm.com/support/docview.wss?uid=swg27020204

Connecting to a weblogic cluster via JPDA

I have a weblogic cluster set up across two machines in a staging environment. I'd like to set up JPDA on at least one of the weblogic instances so I can debug remotely. Generally I use wlst.sh and jython scripts to startup the cluster via:
startNodeManager(...)
nmConnect(...)
nmStart(MyAdminServer)
connect(...) #connect to the admin server
start(...) #start the cluster
Where should I put the -Xdebug Xrunjdwp:transport... incantation so that I can attach to one of the weblogic instances? I had no problem setting this up on a single instance through my domain's startWebLogic.sh, but it doesn't seem to work with the cluster.
From here: https://forums.oracle.com/forums/thread.jspa?threadID=2233816 it looks like I want to put the debug string in startManagedWeblogic.sh but that doesn't seem to work with my jython script either.
Figured it out, from http://docs.oracle.com/cd/E13222_01/wls/docs90/server_start/nodemgr.html#1081870:
4. The Administration Server obtains the domain configuration from its config directory
I checked out the config directory under my domain and there was a suspicious file called config.xml. Within this file is the configuration for the weblogic nodes and where you want to put your JDPA config:
<server>
<name>my-target-machine</name>
...
<server-start>
...
<arguments>(your other config stuff) -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=n</arguments>

server not starting with NoServerDefinedException (RAD/WebSphere)

I am using RAD 7 with WebSphere 6.1, after creating a new profile and a new server I am unable to start the server. The server fails to start with this error:
ADMU0128I: Starting tool with the AppSrv03 profile ADMU3100I: Reading
configuration for server: newserver
ADMU0111E: Program exiting with
error:
com.ibm.websphere.management.exception.NoServerDefinedException: No
configuration defined for server: newserver
This implies that there is no server with the name newserver.
How did you create the profiles? If i recall correctly, if you create a standalone server profile in WAS 6.1 the name of the server is a sacred "server1".
You have to run scripts to change the name of the server from "server1" to anything meaningful. I am guessing you haven't done that.
Go to the runtimes directory of your RAD and run the command serverstatus.bat and this would list the server names for that profile (run it froom your profile's bin directory).
This should tell you the server names. Run start server from within the command line and ensure that the server runs's properly.
This is what I would do for a start to move forward
HTH
Manglu
What command are you using to start the server here? I am assuming "newserver" is the name of profile here, so you can start the server using the following command
startServer server1 -profileName newserver
If you have only one profile then you don't need to specify profile name
startServer server1

Resources