Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2010-09-08
13
Medium Priority
?
884 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 2000 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
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Verbose logging is used to diagnose garbage collector problems. By default, -verbose:gc output is written to either native_stderr.log or native_stdout.log.   It is also possible to redirect the logs to a user-specified file. This article will de…
This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

715 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