Thursday, November 20, 2014

wsadmin check global security


 the below  function  if security is enabled will return True else False.


def isGlobalSecurityEnabled():
    securityon = AdminTask.isGlobalSecurityEnabled()
    return securityon

Another Usage:


security=AdminTask.isGlobalSecurityEnabled()
if security == 'true':
 print "Global security Enabled"
else:
 print "Global Security not Enabled"

wsadmin check application exist or not

appname="Yourappname"
isapppresent=AdminConfig.getid("Deployment:"+appname+"/")
if len(isapppresent) > 0:
   print "the application %s is present" % appname
else:
  print "the application  %s is not present"  % appname
 

wsadmin get hostname of a node

node=AdminControl.getNode()
ns=AdminConfig.getid("/Node:"+node+"/")
AdminConfig.showAttribute(ns,'hostName')