Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 889
  • Last Modified:

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

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
crazywolf2010
Asked:
crazywolf2010
  • 7
  • 6
1 Solution
 
HonorGodCommented:
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
 
crazywolf2010Author Commented:
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
 
HonorGodCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
crazywolf2010Author Commented:
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
 
HonorGodCommented:
ok, next question..

From the above, it would seem that you want the configured values, not currently active ones.
Is that correct?
0
 
HonorGodCommented:
Check this, and let me know what you think...

./wsadmin.sh -f check_was.py -i connectionpool -s server1
check-was.py.txt
0
 
crazywolf2010Author Commented:
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
 
HonorGodCommented:
Interesting.  one moment please.
0
 
HonorGodCommented:
Please try this, and let me know.
check-was.py.txt
0
 
crazywolf2010Author Commented:
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
 
crazywolf2010Author Commented:
Hi HonorGod,
Hope you will have some time to look at this error.

Regards.
0
 
crazywolf2010Author Commented:
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
 
HonorGodCommented:
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.

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now