Solved

Add functionality to support connectionpool, sessions & other details at existing Jython Websphere script

Posted on 2010-09-08
13
874 Views
Last Modified: 2013-12-11
This is a new thread to add functionality to support connectionpool, sessions at existing script discussed http://www.experts-exchange.com/Software/Server_Software/Application_Servers/Java/IBM_Websphere/Q_26400327.html


check-was-py.txt
0
Comment
Question by:crazywolf2010
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 41

Expert Comment

by:HonorGod
ID: 33626083
What information do you want displayed for ConnectionPools ?
agedTimeout : 0
             connectionTimeout : 180
 freePoolDistributionTableSize : 0
                maxConnections : 10
                minConnections : 1
    numberOfFreePoolPartitions : 0
  numberOfSharedPoolPartitions : 0
numberOfUnsharedPoolPartitions : 0
                    properties : []
                   purgePolicy : EntirePool
                      reapTime : 180
                stuckThreshold : 0
                     stuckTime : 0
                stuckTimerTime : 0
         surgeCreationInterval : 0
                surgeThreshold : -1
                testConnection : true
        testConnectionInterval : 0
                 unusedTimeout : 1800

Open in new window

0
 

Author Comment

by:crazywolf2010
ID: 33626950
I would prefer all of these details. Better have everything & filter out later what is most needed.

Do you see a way to run these scripts with switches remotely?

I will explain what I means here...
1. I am trying to create websphere basic monitoring framework on my central RHEL node. I wish to run scripts like check-was-py.txt with options at remote node with click of a mouse. I wish to know an easiest way.
I can probably use wsadmin with [-conntype SOAP [-host host_name] [-port port_number] [-user userid] [-password password] & [-f <script_file_name>]
 to run things at remote node.

2. At this stage I am creating XML file thru http://localhost:9080/wasPerfTool/servlet/perfservlet (performance servlet) and copying manually at node before running check-was-py.
I read something which says using curl and directly downloading xml data for processing check-was-py script.

Thanks


0
 
LVL 41

Accepted Solution

by:
HonorGod earned 500 total points
ID: 33627122
Q: Do you see a way to run these scripts with switches remotely?
A: Certainly.

Technique #1-
- If you have the same version of WebSphere installed on your local machine, you can simply execute wsadmin, and specify the remote hostname and port# parameters:

See "-host" and "-port" below

Technique #2
- You could use some remote execution technique (e.g., ssh, or rexec) to execute wsadmin remotely.

> I read something which says using curl and directly downloading xml data for processing check-was-py script.
That sounds interesting...

> I would prefer all of these details.

  You realize, of course, that displaying all of the columns (especially with verbose column headings) makes for a very wide table, right?
# ./wsadmin.sh -help
WASX7001I: wsadmin is the the executable for WebSphere scripting.
Syntax:

wsadmin
        [ -h(elp)  ]
        [ -?  ]
        [ -c <command> ]
        [ -p <properties_file_name>]
        [ -profile <profile_script_name>]
        [ -f <script_file_name>]
        [ -javaoption java_option]
        [ -lang  language]
        [ -wsadmin_classpath  classpath]
        [ -profileName profile]
        [ -conntype
                SOAP
                        [-host host_name]
                        [-port port_number]
                        [-user userid]
                        [-password password] |
                RMI
                        [-host host_name]
                        [-port port_number]
                        [-user userid]
                        [-password password] |
                NONE
        ]
        [ -jobid <jobid_string>]
        [ -tracefile <trace_file>]
        [ -appendtrace <true/false>]
        [ script parameters ]

Where   "command" is a command to be passed to the script processor;
        "properties_file_name" is a java properties file to be used;
        "profile_script_name" is a script file to be executed before the
                main command or file;
        "script_file_name" is a command to be passed to the script processor;
        "java_option" is a java standard or non-standard option to be passed
                to the java program;
        "language" is the language to be used to interpret scripts;
                supported values are "jacl" and "jython".
        "classpath" is a classpath to be appended to built-in one;
        "-conntype"  specifies the type of connection to be used;
                the default argument is "SOAP"
                a conntype of "NONE" means that no server connection is made
                and certain operations will be performed in local mode;
        "host_name"  is the host used for the SOAP or RMI connection;
                the default is the local host;
        "port_number"  is the port used for the SOAP or RMI connection;
        "userid"  is the userid required when the server is running in
                secure mode;
        "password"  is the password required when the server is running in
                secure mode;
        "script parameters"  is anything else on the command line.  These
                are passed to the script in the argv variable; the number of
                parameters is available in the argc variable.
        "jobid_string" is a jobID string to be used to audit each invocation
                of wsadmin;
        "trace_file" is the log file name and location where wsadmin trace
                output is directed;

If no command or script is specified, an interpreter shell is
created for interactive use. To leave an interactive scripting session,
use the the "quit" or "exit" commands.

Several commands, properties files, and profiles may be specified
on a single command line.  They are processed and executed in
order of their specification.

Open in new window

0
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 

Author Comment

by:crazywolf2010
ID: 33627792
You realize, of course, that displaying all of the columns (especially with verbose column headings) makes for a very wide table, right?
-- Got it so let's handpick these columns.

agedTimeout : 0
             connectionTimeout : 180
                maxConnections : 10
                minConnections : 1
                   purgePolicy : EntirePool
                      reapTime : 180
                 unusedTimeout : 1800
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 33630403
ok, next question..

From the above, it would seem that you want the configured values, not currently active ones.
Is that correct?
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 33630877
Check this, and let me know what you think...

./wsadmin.sh -f check_was.py -i connectionpool -s server1
check-was.py.txt
0
 

Author Comment

by:crazywolf2010
ID: 33634498
I just tried attached script & following error returned..

WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[-i, connectionpool, -s, server_member2]"
 agedTimeout | connectionTimeout | maxConnections | minConnections | purgePolicy | reapTime | unusedTimeout
-------------+-------------------+----------------+----------------+-------------+----------+---------------
Exception  type: exceptions.ImportError
Exception value: no module named AdminConfig
Exception: <class exceptions.KeyError at 472063011>
    value: <exceptions.KeyError instance at 254283560>
Processing:
WASX7017E: Exception received while running file "/home/was61/was_scripts/check_was.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
  File "<string>", line 627, in ?
  File "<string>", line 359, in main
  File "<string>", line 182, in connectionpool
NameError: mb
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 33637621
Interesting.  one moment please.
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 33639230
Please try this, and let me know.
check-was.py.txt
0
 

Author Comment

by:crazywolf2010
ID: 33660709
Hi Mate,
I still have these errors..

WASX7209I: Connected to process "dmgr" on node eugbbopg03lt_Manager using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[-i, connectionpool, -s, server_member1]"
WASX7017E: Exception received while running file "/home/was61/check_was.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
  File "<string>", line 639, in ?
  File "<string>", line 376, in main
  File "<string>", line 166, in connectionpool
KeyError: kind
0
 

Author Comment

by:crazywolf2010
ID: 33671443
Hi HonorGod,
Hope you will have some time to look at this error.

Regards.
0
 

Author Comment

by:crazywolf2010
ID: 33778054
Hi HonorGod,
Hope you will have some time this week to look at attached error.

WASX7209I: Connected to process "dmgr" on node eugbbopg03lt_Manager using SOAP connector;  The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[-i, connectionpool, -s, server_member1]"
WASX7017E: Exception received while running file "/home/was61/check_was.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
  File "<string>", line 639, in ?
  File "<string>", line 376, in main
  File "<string>", line 166, in connectionpool
KeyError: kind

Regards
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 35060644
sorry.  I didn't realize that you had an unanswered question.

Line 167 should be changed from:
--------------------------------------------------
  Exception  type: %(kind)s
--------------------------------------------------
to
--------------------------------------------------
  Exception  type: %(Type)s
--------------------------------------------------

Thanks for the grade & points.

Good luck & have a great day.
0

Featured Post

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

-Xmx and -Xms are the two JVM options often used to tune JVM heap size.   Here are some common mistakes made when using them:   Assume BigApp is a java class file for the below examples. 1.         Missing m, M, g or G at the end …
This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question