Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Analysing array with wlst

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I need to obtain running status for my WebLogic servers.
As it has to be run through command line, I would like to script it it python.
My needs is to have 3 arrays :
- Monitoring threads (the array that shows "Active Execute Threads", "Execute Thread Total Count", "Hogging Thread Count", etc.)
- Monitoring/JTA/Transactions by Names (an array with all transactions and its values "Transactions", "Commits", "Rollbacks", etc.)
- Monitoring/JTA/XA Ressources (an array with all ressources and its values "Transactions", "Commits", "Rollbacks", etc.)

So far, I have the following script but it only works fot the first array.
Could you help me debbuging this script ?

 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This script does not work at all for me.  What do you see when you run it?
I find line 37 rather ominous.  Are you redirecting output to "/dev/null"?  That would make debugging difficult to say the least.
 
Olivier Gerault
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks for your reply.
Indeed, the /dev/null is not efficient for debug purpose.
Nevertheless the problem is not at this point.

The first part of the script works correctly ('affichage des status')
The second and third one don't ('affichage des transactions par nom' and 'affichage des ressources XA')

The second part, i.e., I can't find the getTransactionRolledBackTotalCount.
I don't know where to find it.
I find all transactions name in /<domain_name>/domainRuntime/ServerServices/<instance>/RuntimeService/ServerRuntime/<instance>/JTARuntime/JTARuntime/TransactionResourceRuntimeMBeans
Then, I can find getTransactionTotalCount and getTransactionCommittedTotalCount but not the other parameters:
- Timeout Rollbacks
- Resource Rollbacks
- Application Rollbacks
- System Rollbacks

The same problem appends for the third part but I think that if I understand my mistake for the second one, I hope I would be able to solve it alone for the third one, as well ;)

Regards,

Olivier
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Olivier Gerault wrote:
Indeed, the /dev/null is not efficient for debug purpose.
Nevertheless the problem is not at this point.



The issue is not efficiency.  The issue is that if the script did have an problem, you'd never know it because you're redirecting output to /dev/null.

One of the useful features of Python in general, and WLST as well, is that you can use it as an interactive shell, like Windows command line or the Unix shell.  You can start WLST, issue commands in it and observe the output.  WLST also exposes the inner workings of Weblogic as a virtual file system, so one can explore it with file-like commands (note the "cd" commands in your script at line 56, 92 and elsewhere as well as the "ls" commands on line 40 and 43 ).  I would recommend using the interactive terminal to execute your script (except for line 37) and when you hit a problem, using the file commands to see if you can resolve it.
What I suspect is going on is that your script was written for one version of Weblogic and you are using it on a different version so the virtual file system is different.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic