API to find whether a WLS domain is in locked state - weblogic

I am trying to find whether there exist some API which tells whether a given Domain in weblogic server is locked or not. Before deploying an application on a server we need to lock the entire domain because parallel deployment is not allowed.
There are many server level APIs which tell whether server is up and running or down. But I couldn't find any domain level APIs.

You can use the following wlst script to check if the console is locked
connect('username','password','t3://server_name:7001')
cm=getConfigManager()
if cm.isEditor() == 1:
print 'WebLogic console is locked !!'
else:
print 'WebLogic console is NOT locked'

Related

How to create a login on a test server without active directory domain?

I'm trying to create a login on our test server with:
CREATE LOGIN [<DOMAIN>\<LOGIN>] FROM WINDOWS;
GO
As opposed to the live server the test server does not have any active directory. So it fails with:
Windows NT user or group 'DOMAIN\LOGIN' not found. Check the name again.
Worth to be mentioned, that on the test server we use a backup of a database dump from the last release and apply new migrations to this dump. This means, that this error would not occur, if a more recent dump from the live server was used, where the active directory login already exists.
To enable proper testing, we discussed three possible options:
Recreate the active directory on the test server: I would like to avoid this, because nobody really wants to administer an additional active directory clone for testing purposes.
Use a more recent database dump: The problem here is, that the live server is not ours and we only have restricted access to it. It is possible, but still not the optimal solution in regard to practicability. Also, it would mean, that we would play in migrations to the live server before having tested them on the test server.
Alternative SQL syntax: I am aware, that there alternative ways of creating logins, e.g., CREATE LOGIN <login_name> WITH PASSWORD. But I could not think of any way, which allows us to create logins depending on which system we are on.
Option 3 is our strong favorite, but we are missing a piece to the puzzle. Anything we are missing here?
You can create a new user on your local computer.
And then add this new user to the instance.
CREATE LOGIN [<domainName or your hostName>\<login_name>] FROM WINDOWS;

IBM Worklight Console - audit trail of tasks performed on console

I am using IBM Worklight 6 and for auditing purposes would like to know if I it is possible to log the details of tasks performed on the Worklight Console, i.e. log the details when deploying new version of app/adapter?
Regards,
Tom
Worklight, or more specifically, the application server that Worklight Server is deployed to (WAS, WAS Liberty profile, Tomcat), does not have the ability to filter logs into seperate files, for example for the purpose you have mentioned.
What you might be able to do is take the server log, and create your own manual filtering (by script, of course). What you will need to do is to find the prefix for each action done and filter using it.
In Eclipse (or your production environment) open server.xml > Logging and change the Console log level from Audit (default) to Info.
This in turn will produce the following log lines in the sever log:
[INFO ] FWLSE0084I: Adapter 'aaa' was deployed successfully. [project test]
In your script you can now filter for FWLSE0084I for adapters and similar prefixes for other actions, likely. I am not sure if all Worklight Console actions have prefixes, but if they are ones that require a connection to the server, then likely that they do.
http://i.stack.imgur.com/sZ0fj.png

Weblogic Bridge Message - Failure of server APACHE bridge:

Here in this case, when a client is trying to access a particular URI, they are able to get a SUCCESS response for GET, but for the POST message, they are recieving a 500 error. Which is nothing but INTERNAL SERVER ERROR.
please look at the ERROR below:
Weblogic Bridge Message
Failure of server APACHE bridge:
Cannot open TEMP post file '/tmp/_wl_proxy/_post_1818_8' for POST of 3978 bytes
Weblogic Bridge Message
Failure of server APACHE bridge:
Internal Server failure, APACHE plugin. Cannot continue.
Eventually this was resolved after giving a 777 permission to /tmp/_wl_proxy and the client was able to access the page SUCCESSFULLY.
If this is a permission issue, then apache should throw 403 error, but i dont know why it was throwing 500 error.
if there is a internal server error, then both GET and POST response should be 500, So if anyone can answer this , it would be a great learning experience. Thanks..!!
You many not want to give Write to all (777) permission to /tmp/_wl_proxy directory. Check which userID apache is running under and only give writer permission to that userID.
This could be also with tmp directory full.
Here is what I did to solve this problem:
Go to weblogic management console (http://:7001/console)
Go to the server section, you will probably find one of your servers' status not running. This is what I found in my case;
Some features couldn't be run unless you have administrative privilege, I advice you stop all servers and re-run them as an administrator as you follow your servers status in the administrative console.
If the above doesn't work, something has to do with your either report or form server configuration is hindering the servers from starting up. In all cases you need to monitor the administration console.

wlstModule connection information lost

When using wlst with a WebLogic 10.3.5.0 release I am puzzled by the following situation and hoping for an answer.
Given a standard wlst command to connect to a server
connect('weblogic','welcome1','t3s://localhost:7002')
it connects as expected to the AdminServer in my domain and presents the following prompt:
Connecting to t3s://localhost:7004 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'base_domain'.
wls:/base_domain/serverConfig>
However, if I perform the following command
import wlstModule as wlst
wlst.connect('weblogic','welcome1','t3s://localhost:7002')
I get the following response
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'base_domain'.
wls:/offline>
The situation I have is I have a common module for connecting the AdminServer and whilst the connection is successful, any other functions revolving around requiring a serverRuntimeConfig(), etc, do not work as it thinks it is not connected.
Does anybody have any idea on the correct mechanism for using the second approach for connecting and what else needs to occur to retain the connection state when using the imported wlstModule.
After struggling with this very problem, I seem to have found the answer.
after you start with java org.python.util.jython, you get a prompt.
>>>
here you can do
import wlstModule as wlst
hencefort you should use the wlst all the time!!
wlst.connect()
a = wlst.cmo.getServers()
print (a)
greetings,
Saulius

WebLogic 10 WLST command to stop a deployment

Is there a WLST command to stop a Weblogig deployment? (i.e. the opposite of the nmStart() command)
If so, what is it?
I am changing database passwords and I want to shutdown all deployments so all connections will close. Currently I have to log into the console to shut everything down and I am looking for a quicker way.
I'd say nmKill but I'm not sure about the terminology you are using. The nmStart is used to start a server in the current domain using Node Manager, not to start a "deployment".
By the way, the WLS Console provides a recording feature that writes out the edits you make in the console to a WLST script. This can be very handy if you are not a WLST expert. To turn on recording, click 'Record' (in the the toolbar near the top of the page). Then, make your edits in the console. Finally, turn the recording off when you're done.
The more usual method, which is independant of whether you're using node manager or not, would be the shutdown command which is also able to work at the cluster level.