Cluster parameters

Hello All,

I want to display all the properties and parameters.
Display all the settings for Datasource - connection pool, timeout , max and min connections
All Cluster / JVM properties - heapsize, classpath, log rotation, virtual host etc ..

Any suggestion thanks

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HonorGodSoftware EngineerCommented:
> I want to display all the properties and parameters.

  Do you have any idea just how much information this could generate?

> Any suggestion


- I would start obtaining cluster information for each cluster.
  To do this, we can have / use an overall loop over the clusters in the current configuration using
  something like:
for cluster in AdminConfig.list( 'ServerCluster' ).splitlines() :
  name  = AdminConfig.showAttribute( cluster, 'name' )
  enHA  = AdminConfig.showAttribute( cluster, 'enableHA' )
  ng    = AdminConfig.showAttribute( cluster, 'nodeGroupName' )
  local = AdminConfig.showAttribute( cluster, 'preferLocal' )
  sType = AdminConfig.showAttribute( cluster, 'serverType' )
  mbrs  = AdminConfig.showAttribute( cluster, 'members' )[ 1:-1 ].split( ' ' )

Open in new window

  Then, you could display the information of interest for the cluster, and then process the cluster members.

Does this help?

Note: If your cluster member names contain a space, this complicates things a bit because the "split( ' ' ) " will get confused.
HonorGodSoftware EngineerCommented:
Instead of obtaining the attributes of the cluster one at a time, you might want to consider using a routine such as "showAsDict()", like this:

So, instead of the 6 calls to AdminConfig.showAttribute(), like we see above, it would be something like:
clusterInfo = '''
         name: %(name)s
     enableHA: %(enableHA)s
nodeGroupName: %(nodeGroupName)s
  preferLocal: %(preferLocal)s
   serverType: %(serverType)s

memberInfo = '''
memberName: %(memberName)s
  nodeName: %(nodeName)s
    weight: %(weight)d
  uniqueId: %(uniqueId)s

def showAsDict( configId ) :
  'showAsDict( configId ) - Return a dictionary of the configID ) result.'
  result = {}
  try :
    # The result of the should be a string containing many
    # lines.  Each line of which starts and ends with brackets.  The "name"
    # portion should be separated from the associated value by a space.
    for item in configId ).splitlines() :
      if ( item[ 0 ] == '[' ) and ( item[ -1 ] == ']' ) :
        key, value = item[ 1:-1 ].split( ' ', 1 )
        if ( value[ 0 ] == '"' ) and ( value[ -1 ] == '"' ) :
          value = value[ 1:-1 ]
        result[ key ] = value
  except NameError, e :
    print 'Name not found: ' + str( e )
  except :
    Type, value = sys.exc_info()[ :2 ]
    print 'Exception  type: ' + str( Type )
    print 'Exception value: ' + str( value )
  return result

for cluster in AdminConfig.list( 'ServerCluster' ).splitlines() :
  cDict = showAsDict( cluster )
  print clusterInfo % cDict
  for member in cDict[ 'members' ][ 1:-1 ].split( ' ' ) :
    mDict = showAsDict( member )
    print memberInfo % mDict

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HonorGodSoftware EngineerCommented:
Thanks for the grade & points

Good luck & have a great day.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Application Servers

From novice to tech pro — start learning today.