Connecting to a OBIEE domain using WLST

This is an example to connect to know the status of the OBIEE doamin using Weblogic Server Script.

import sys
import os

# Check the arguments to this script are as expected.
# argv[0] is script name.
argLen = len(sys.argv)
if argLen -1 != 4:
      print "ERROR: got ", argLen -1, " args."
      print "USAGE: wlst.cmd wls_connect.py WLS_HOST WLS_PORT WLS_USER WLS_PASSWORD"
      print " eg: wlst.cmd wls_connect.py localhost 7001 user1 password1"
      exit()

WLS_HOST = sys.argv[1]
WLS_PORT = sys.argv[2]
WLS_USER = sys.argv[3]
WLS_PW = sys.argv[4]

print 'Connecting to '+ WLS_HOST+ ':' + WLS_PORT + ' as user: ' + WLS_USER + ' ...'

# Connect to WLS
connect(WLS_USER, WLS_PW, WLS_HOST+ ':' + WLS_PORT);

print 'Connecting to Domain ...'
domainCustom()
cd ('oracle.biee.admin')
print 'Connecting to BIDomain MBean ...'
cd ('oracle.biee.admin:type=BIDomain,group=Service')

biinstances = get('BIInstances')
biinstance = biinstances[0]

print 'Connecting to BIInstance MBean ...'
cd ('..')
cd (biinstance.toString())

servicestatus=get('ServiceStatus')
print 'BIInstance MBean; ServiceStatus: ' + servicestatus

exit()


I have saved the above script as Domaintest.py in the following location:<OracleinstallationDir>\wlserver_10.3\common\bin>

In my case i have the script as shown in the figure. Once you run the command you will see the status:




3 comments:

  1. brillant piece of information, I had come to know about your web-page from my friend hardkik, chennai,i have read atleast 9 posts of yours by now, and let me tell you, your webpage gives the best and the most interesting information. This is just the kind of information that i had been looking for, i'm already your rss reader now and i would regularly watch out for the new posts, once again hats off to you! Thanx a million once again, Regards,obiee online training

    ReplyDelete
  2. Appreciation for nice Updates, I found something new and folks can get useful info about BEST obiee ONLINE TRAINING

    ReplyDelete