EM GRID: How to Change DB Console Http Port

Posted by Sagar Patil

I fixed a failed 11g dbconsole installation using http://www.oracledbasupport.co.uk/standalone-11g-dbconsole-configuration But Dbconsole picked up port 5500 instead of our usual EM port 1159.

How can we change dbconsole port from 5500 to 1159?

Before proceeding take backup of these 3 files

–     /u01/app/oracle/product/11.2.0/dbhome_1/$HOST_NAME%SID%/sysman/config/emoms.properties
–    /u01/app/oracle/product/11.2.0/dbhome_1/$HOST_NAME%SID%/sysman/config/emd.properties
–    /u01/app/oracle/product/11.2.0/dbhome_1/oc4j/j2ee/OC4J_DBConsole_$HOST_NAME/config/server.xml

-bash-3.2$ emca -reconfig ports -DBCONTROL_HTTP_PORT 1159  -SID TEST
STARTED EMCA at 27-Aug-2010 11:02:03
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:

Do you wish to continue? [yes(Y)/no(N)]: y
27-Aug-2010 11:02:10 oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/TEST/emca_2010_08_27_11_02_03.log.
27-Aug-2010 11:02:10 oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) …
27-Aug-2010 11:02:33 oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) …
27-Aug-2010 11:02:58 oracle.sysman.emcp.EMDBPostConfig performReconfiguration
INFO: Database Control started successfully
27-Aug-2010 11:02:58 oracle.sysman.emcp.EMDBPostConfig performReconfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://dbserver1.dbdmz.net:1159/em <<<<<<<<<<<
Enterprise Manager configuration completed successfully
FINISHED EMCA at 27-Aug-2010 11:02:58

$ emca –help

-config dbcontrol db [-repos (create | recreate)] [-cluster] [-silent] [-backup] [parameters]: configure Database Control for a database
-config centralAgent (db | asm) [-cluster] [-silent] [parameters]: configure central agent management
-config all db [-repos (create | recreate)] [-cluster] [-silent] [-backup] [parameters]: configure both Database Control and central agent management

-deconfig dbcontrol db [-repos drop] [-cluster] [-silent] [parameters]: de-configure Database Control
-deconfig centralAgent (db | asm) [-cluster] [ -silent] [parameters]: de-configure central agent management
-deconfig all db [-repos drop] [-cluster] [-silent] [parameters]: de-configure both Database Control and central agent management

-addNode (db | asm) [-silent] [parameters]: configure EM for a newly added node for a database

-deleteNode (db | asm) [-silent] [parameters]: de-configure EM for for a database on node getting deleted

-addInst (db | asm) [-silent] [parameters]: configure EM for a new RAC instance
-deleteInst (db | asm) [-silent] [parameters]: de-configure EM for a specified RAC instance

-reconfig ports [-cluster] [parameters]: explicitly reassign Database Control ports
-reconfig dbcontrol -cluster [-silent] [parameters]: reconfigures RAC Database Control deployment

-displayConfig dbcontrol -cluster [-silent] [parameters]: displays information about the RAC Database Control configuration

-migrate -from dbcontrol -to centralAgent  [-repos drop] [-cluster] [-silent] [parameters]: migrates EM configuration from Database Control to central agent

-upgrade (db | asm | db_asm) [-cluster] [-silent] [parameters]: upgrades an earlier version of the EM configuration to the current version

-updateTargets crs [-silent] [parameters]: updates new crs home for all dbcontrol and central agents on crs upgrade

-restore (db | asm | db_asm) [-cluster] [-silent] [parameters]: restores the current version of the EM configuration to an earlier version

Parameters and Options:
[parameters]: [ -respFile fileName ] [ -paramName paramValue ]*
db: perform configuration operation for a database (including databases that use ASM)
asm: perform configuration operation for an ASM-only instance
db_asm: perform upgrade/restore operation for a database and an ASM instance
-repos create: create a new Database Control repository
-repos drop: drop the current Database Control repository
-repos recreate: drop the current Database Control repository and recreate a new one
-cluster: perform configuration operation for a RAC database
-silent: perform configuration operation without prompting for parameters
-backup: configure automatic backup for a database

Parameters for single instance databases
ORACLE_HOSTNAME: Local hostname
SID: Database SID
PORT: Listener port number
ORACLE_HOME: Database ORACLE_HOME
LISTENER_OH: Listener ORACLE_HOME
HOST_USER: Host username for automatic backup
HOST_USER_PWD: Host user password for automatic backup
BACKUP_SCHEDULE: Automatic backup schedule (HH:MM)
EMAIL_ADDRESS: Email address for notifications
MAIL_SERVER_NAME: Outgoing Mail (SMTP) server for notifications
ASM_OH: ASM ORACLE_HOME
ASM_SID: ASM SID
ASM_PORT: ASM port
ASM_USER_ROLE: ASM user role
ASM_USER_NAME: ASM username
ASM_USER_PWD: ASM user password
SRC_OH: ORACLE_HOME for the database to be upgraded
DBSNMP_PWD: Password for DBSNMP user
SYSMAN_PWD: Password for SYSMAN user
SYS_PWD: Password for SYS user
DBCONTROL_HTTP_PORT: Database Control HTTP port
AGENT_PORT: EM agent port
RMI_PORT: RMI port for Database Control
JMS_PORT: JMS port for Database Control
EM_SWLIB_STAGE_LOC:  Software library location
PORTS_FILE: Path to a static file specifying the ports to use (Default value : ${ORACLE_HOME}/install/staticports.ini).

Additional Parameters for cluster databases
CLUSTER_NAME: Cluster name
DB_UNIQUE_NAME: Database unique name
SERVICE_NAME: Service name
EM_NODE: Database Control node name
EM_NODE_LIST: Agent Node list [comma separated]

Note: For Desktop Class Install always pass parameter ORACLE_HOSTNAME
as “localhost” to any emca command

Standalone 11g dbconsole Configuration

Posted by Sagar Patil

I installed Oracle 11g today on RHEL 5.4 but dbconsole failed to startup. Here is a process to fix this issue.

Create   emca.rsp response file with following entries

ORACLE_HOSTNAME=dbserver1.dbdmz.oracledbasupport.net
SID=%TEST%
PORT=1521
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
LISTENER_OH=/u01/app/oracle/product/11.2.0/dbhome_1
DBSNMP_PWD=manager
SYSMAN_PWD=manager
SYS_PWD=manager

Now run emca with following options

-bash-3.2$ ./emca -config dbcontrol db -silent -respfile emca.rsp

STARTED EMCA at 27-Aug-2010 09:34:29
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

27-Aug-2010 09:34:30 oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/PRMUDST/emca_2010_08_27_09_34_29.log.
27-Aug-2010 09:34:33 oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) …
27-Aug-2010 09:35:47 oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
27-Aug-2010 09:35:51 oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library configured successfully.
27-Aug-2010 09:35:51 oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives …
27-Aug-2010 09:36:44 oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
27-Aug-2010 09:36:44 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) …
27-Aug-2010 09:37:09 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
27-Aug-2010 09:37:09 oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) …
27-Aug-2010 09:37:39 oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
27-Aug-2010 09:37:39 oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://dbserver1.dbdmz.oracledbasupport.net:5500/em <<<<<<<<<<<
27-Aug-2010 09:37:45 oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************  WARNING  ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /u01/app/oracle/product/11.2.0/dbhome_1/dbserver1.dbdmz.oracledbasupport.net_PRMUDST/sysman/config/emkey.ora.   Please ensure this file is backed up as the encrypted data will become unusable if this file is lost.

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at 27-Aug-2010 09:37:45

See if EM is responding

-bash-3.2$ wget https://dbserver1.dbdmz.oracledbasupport.net:5500/em
–2010-08-27 09:39:09–  https://dbserver1.dbdmz.oracledbasupport.net:5500/em
Resolving dbserver1.dbdmz.oracledbasupport.net… 172.30.10.39
Connecting to dbserver1.dbdmz.oracledbasupport.net|172.30.10.39|:5500… connected.
ERROR: cannot verify dbserver1.dbdmz.oracledbasupport.net’s certificate, issued by `/DC=com/C=US/ST=CA/L=EnterpriseManager on dbserver1.dbdmz.oracledbasupport.net/O=EnterpriseManager on dbserver1.dbdmz.oracledbasupport.net/OU=EnterpriseManager on dbserver1.dbdmz.oracledbasupport.net/CN=dbserver1.dbdmz.oracledbasupport.net/emailAddress=EnterpriseManager@dbserver1.dbdmz.oracledbasupport.net’:
Self-signed certificate encountered.
To connect to dbserver1.dbdmz.oracledbasupport.net insecurely, use `–no-check-certificate’.
Unable to establish SSL connection.

set bash prompt

Posted by Sagar Patil

I need to remind myself on what machine & directory I am working on constantly. The easiest way to do so would be setting PS1 prompt under bash shell.

For example,
Name of Server : Server1
Pwd : /opt/IBM/WebSphere/AppServer/profiles/Profile01/Node
TAG : [Dev] Uatf]

export TAG=Dev/Uatf/Test

export PS1=‘${HOSTNAME:0:10}-$(echo $PWD|awk “{print substr(\\$1,length(\\$1)-24,25)}”)-${TAG:0:4}# ‘

returned  Server1-/logs/uatf_server_member1-Dev#

To Display HOSTNAME In caps do

export PS1=’$(echo ${HOSTNAME:0:10}|tr “[a-z]” “[A-Z]”)-$(echo $PWD|awk “{print substr(\\$1,length(\\$1)-24,25)}”)-${TAG:0:4}# ‘

returned SERVER1-/logs/uatf_server_member1-Dev#

Websphere : Change application server ports

Posted by Sagar Patil

I have set of JVM ports (9080,9081) accessible thru firewall.  This week when I built new websphere clustered ND environment something went wrong and it picked up ports 9081,9082 instead of usual 9080,9081. Here is a process I used to alter them from 9081->9080 & 9082->9081

Login at deployment manager -> Sselect Servers -> Application Servers -> Server1 -> Scroll down at right  hand pane until Communications and select “Ports”


Click on Details and edit both port numbers 9081/9444


Finally generate and propagate plugin to reflect new port changes at IBM Http server “plugin-cfg.xml”

Old Plugin-cfg.xml Settings :

<ServerCluster CloneSeparatorChange=”false” GetDWLMTable=”false” IgnoreAffinityRequests=”true” LoadBalance=”Round Robin” Name=”cluster” PostBufferSize=”64″ PostSizeLimit=”-1″ RemoveSpecialHeaders=”true” RetryInterval=”60″>
<Server CloneID=”15a4r5p9p” ConnectTimeout=”0″ ExtendedHandshake=”false” LoadBalanceWeight=”2″ MaxConnections=”-1″ Name=”Server1_Node01_server_member1″ ServerIOTimeout=”0″ WaitForContinue=”false”>
<Transport Hostname=”Server1″ Port=”9081” Protocol=”http”/>
<Transport Hostname=”Server1″ Port=”9444” Protocol=”https”>
<Property Name=”keyring” Value=”/opt/IBM/WebSphere/Plugins/config/ihs-prpc/plugin-key.kdb”/>
<Property Name=”stashfile” Value=”/opt/IBM/WebSphere/Plugins/config/ihs-prpc/plugin-key.sth”/>
</Transport>
</Server>

Open /opt/IBM/WebSphere/Plugins/config/ihs-prpc/plugin-cfg.xml and make sure you see the new port changes

<ServerCluster CloneSeparatorChange=”false” GetDWLMTable=”false” IgnoreAffinityRequests=”true” LoadBalance=”Round Robin” Name=”cluster” PostBufferSize=”64″ PostSizeLimit=”-1″ RemoveSpecialHeaders=”true” RetryInterval=”60″>
<Server CloneID=”15a4r5p9p” ConnectTimeout=”0″ ExtendedHandshake=”false” LoadBalanceWeight=”2″ MaxConnections=”-1″ Name=”Server1_Node01_server_member1″ ServerIOTimeout=”0″ WaitForContinue=”false”>
<Transport Hostname=”Server1″ Port=”9080” Protocol=”http”/>
<Transport Hostname=”Server1″ Port=”9443” Protocol=”https”>
<Property Name=”keyring” Value=”/opt/IBM/WebSphere/Plugins/config/ihs-prpc/plugin-key.kdb”/>
<Property Name=”stashfile” Value=”/opt/IBM/WebSphere/Plugins/config/ihs-prpc/plugin-key.sth”/>
</Transport>
</Server>

Protected: GSK_ERROR_BAD_CERT error configuring SSL between Plug-in and Application Server V6.1

Posted by Sagar Patil

This content is password protected. To view it please enter your password below:

Wsadmin Details

Posted by Sagar Patil

To administer the WebSphere Application Server environment, wsadmin includes some specialized administrative objects.

Object Name Description

AdminConfig Object used to view and manipulate configuration elements (xml files).
AdminControl Object used to view and manipulate active application server objects (MBeans)
AdminApp Object used to install and manipulate applications.
AdminTask Object used to execute administrative and server management commands.
Help Object used to provide usage information about the administrative objects.

1. AdminConfig Overview  : Looking at the AdminConfig.help() text, you see that this object can be used to perform several operations on WebSphere Application Server configuration objects. These operations include  the following:
• List
• Create
• Remove
• Display
• Modify

AdminConfig methods:
list()
getid()
getObjectName()
showAttribute()
AdminControl methods:
getAttribute()
getCell()

2. AdminControl Overview  : The AdminControl methods here are grouped together to help you understand their respective roles

The AdminControl Object
getNode()
completeObjectName()
startServer()
stopServer()

3. AdminApp Overview  : The AdminApp object operates on applications. AdminApp.help() provides the complete list of method calls, and the details about each method can be displayed by calling AdminApp.help(‘methodName’ ).

The following types of operations can be performed on an application:
– Information
– Install
-Uninstall
– Modify

$WAS_HOME/Dmgr/bin/wsadmin.sh -conntype none -lang jython

Find out more info on an erorr message WASX7023E

wsadmin>print Help.message(‘WASX7023E’)
Explanation: An error was reported from the connector when trying to establish a connection to the host.
User action: Examine the accompanying exception information and the information in the wsadmin.traceout file to determine the cause of the error.

Locate configured ports for a system

wsadmin>print AdminTask.reportConfiguredPorts()
Ports configured in cell server1_Cell
Node server1_Manager / Server dmgr
Server1:7277 CELL_DISCOVERY_ADDRESS
Server1:9809 BOOTSTRAP_ADDRESS
Server1:8879 SOAP_CONNECTOR_ADDRESS
*:9060 WC_adminhost
*:9352 DCS_UNICAST_ADDRESS
*:9043 WC_adminhost_secure

List Server ports used by WAS, please replace Dmgr with Node Names

wsadmin>print AdminTask.listServerPorts(‘Dmgr’);
[CSIV2_SSL_SERVERAUTH_LISTENER_ADDRESS [ [port 9403] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[WC_adminhost [ [port 9060] [node localhost_Manager] [host *] [server Dmgr] ]]
[DCS_UNICAST_ADDRESS [ [port 9352] [node localhost_Manager] [host *] [server Dmgr] ]]
[BOOTSTRAP_ADDRESS [ [port 9809] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[SAS_SSL_SERVERAUTH_LISTENER_ADDRESS [ [port 9401] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[SOAP_CONNECTOR_ADDRESS [ [port 8879] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[CELL_DISCOVERY_ADDRESS [ [port 7277] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[ORB_LISTENER_ADDRESS [ [port 9100] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[CSIV2_SSL_MUTUALAUTH_LISTENER_ADDRESS [ [port 9402] [node localhost_Manager] [host localhost] [server Dmgr] ]]
[WC_adminhost_secure [ [port 9043] [node localhost_Manager] [host *] [server Dmgr] ]]

Check if the current configuration is correct

wsadmin>print AdminTask.reportConfigInconsistencies();
Configuration consistency report for cell server1_Cell
No consistency problems were found.

Print Server Configuration

wsadmin>print AdminConfig.list(‘Server’);
Dmgr(cells/localhost_Cell/nodes/localhost_Manager/servers/Dmgr|server.xml#Server_1)
ihs-localhost(cells/localhost_Cell/nodes/localhost_Node01/servers/ihs-localhost|server.xml#Server_1264773909852)
nodeagent(cells/localhost_Cell/nodes/localhost_Node01/servers/nodeagent|server.xml#Server_1120677326772)
server_member1(cells/localhost_Cell/nodes/localhost_Node01/servers/server_member1|server.xml#Server_1265379120807)
server_member2(cells/localhost_Cell/nodes/localhost_Node01/servers/server_member2|server.xml#Server_1265379122341)

Disable Application Security

[was61@bin]$ ./opt/IBM/WebSphere/AppServer/profiles/Profile01/Dmgr/bin/wsadmin.sh -conntype NONE

wsadmin>AdminTask.isAppSecurityEnabled();
‘true’
wsadmin>securityoff();

LOCAL OS security is off now but you need to restart server1 to make it affected.
wsadmin> $AdminConfig save;

WebSphere Version

wsadmin>svr = AdminControl.queryNames( ‘type=Server,*’ )

wsadmin>print AdminControl.invoke( svr, ‘getVersionsForAllProducts’ )
WASX7015E: Exception running command: “AdminControl.invoke( svr, ‘getVersionsForAllProducts’ )”; exception information:
com.ibm.ws.scripting.ScriptingException: WASX7025E: Error found in String “WebSphere:name=dmgr,process=dmgr,platform=proxy,node=Server1_Manager,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/Server1_Cell/nodes/Server1_Manager/servers/dmgr/server.xml#Server_1,cell=Server1_Cell,spec=1.0,processType=DeploymentManager
WebSphere:name=nodeagent,process=nodeagent,platform=proxy,node=Server1_Node01,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/Server1_Cell/nodes/Server1_Node01/servers/nodeagent/server.xml#Server_1120677326772,cell=Server1_Cell,spec=1.0,processType=NodeAgent

wsadmin>print AdminControl.invoke( svr, ‘getVersionsForAllProducts’ )
WASX7015E: Exception running command: “AdminControl.invoke( svr, ‘getVersionsForAllProducts’ )”; exception information:
com.ibm.ws.scripting.ScriptingException: WASX7025E: Error found in String “WebSphere:name=dmgr,process=dmgr,platform=proxy,node=eugbbopg03lt_Manager,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/eugbbopg0               3lt_Cell/nodes/eugbbopg03lt_Manager/servers/dmgr/server.xml#Server_1,cell=eugbbopg03lt_Cell,spec=1.0,processType=DeploymentManager
WebSphere:name=nodeagent,process=nodeagent,platform=proxy,node=eugbbopg03lt_Node01,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/eugbbopg03lt_Cell/nodes/eugbbopg03lt_Node01/servers/nodeagent/server.xml#Ser               ver_1120677326772,cell=eugbbopg03lt_Cell,spec=1.0,processType=NodeAgent
WebSphere:name=server_member1,process=server_member1,platform=proxy,node=eugbbopg03lt_Node01,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/eugbbopg03lt_Cell/nodes/eugbbopg03lt_Node01/servers/se               rver_member1/server.xml#Server_1259674425316,cell=eugbbopg03lt_Cell,spec=1.0,processType=ManagedProcess
WebSphere:name=server_member2,process=server_member2,platform=proxy,node=eugbbopg03lt_Node01,j2eeType=J2EEServer,version=6.1.0.31,type=Server,mbeanIdentifier=cells/eugbbopg03lt_Cell/nodes/eugbbopg03lt_Node01/servers/se               rver_member2/server.xml#Server_1259674426040,cell=eugbbopg03lt_Cell,spec=1.0,processType=ManagedProcess”; cannot create ObjectName.

Websphere : How to change HOSTNAME using ws_ant scripts

Posted by Sagar Patil

Today I have a new_server which I need to build to my websphere old_server.  The first thing to do is rename Hostname from old_server to new_server. Here is a script I used  to just do that.

Download “Configuration management scripts for V6 ConfigScripts.zip” from  http://www.ibm.com/developerworks/websphere/library/samples/SampleScripts.html

Sample exportImport.xml attached here http://www.oracledbasupport.co.uk/wp-content/uploads/2010/08/exportImport.xml

[websphere@new_server config_management]$ /opt/IBM/WebSphere/AppServer/bin/ws_ant.sh -profileName dmgr -buildfile exportImport.xml -DstartManager=yes -DoldHostName=old_server -DnewHostName=new_server change  HostName
Buildfile: exportImport.xml

checkRelease:
[wsadmin] WASX7357I: By request, this scripting client is not connected to any server process. Certain configuration and application operations will be available in local mode.
[wsadmin] Executing ValidateRelease.jacl script
[wsadmin] List of Node is new_server_Manager(cells/old_server_Cell/nodes/old_server_Manager|node.xml#Node_1)
[wsadmin] old_server_Node01(cells/old_server_Cell/nodes/old_server_Node01|node.xml#Node_1)

checkNewHost:
checkOldHost:

changeHostName:
[echo] Was Home is /opt/IBM/WebSphere/AppServer
[echo] User Install Root is /opt/IBM/WebSphere/AppServer/profiles/Profile01/dmgr
[echo] Config Root is /opt/IBM/WebSphere/AppServer/profiles/Profile01/dmgr/config
[echo] Cell name is old_server_Cell
[echo] Node name is old_server_Manager

changeServerIndexConfig:
[echo] Modifying serverindex.xml from old_server to new_server

changeHNServerConfig:
[echo] Modifying server.xml from old_server to new_server

changeWsadminProp:
[echo] Modifying wsadmin.properties from old_server to new_server

startManager:

doStartManager:
[exec] ADMU0116I: Tool information is being logged in file
[exec]            /opt/IBM/WebSphere/AppServer/profiles/Profile01/dmgr/logs/dmgr/startServer.log
[exec] ADMU0128I: Starting tool with the dmgr profile
[exec] ADMU3100I: Reading configuration for server: dmgr
[exec] ADMU3200I: Server launched. Waiting for initialization status.
[exec] ADMU3000I: Server dmgr open for e-business; process id is 22554

BUILD SUCCESSFUL
Total time: 28 seconds
[websphere@new_server config_management]$ ps -ef | grep java

Now let’s connect to the new DMGR using URL  https://new_node:9043/ibm/console/ . I could connect successfully with username /pwd as of old_server

Websphere : Jython script to return performance matrix details of Node

Posted by Sagar Patil

Here is a Jython script to return performance matrix detail of a node for following details :
Free and used JVM heap size,
Free and used Thread pools,
Free and used JDBC connection pools
Free and used Live sessions

[was61@Server1 .scripts]$ wsadmin.sh -f check_was.py -i heapsize -s  Server_member1

WASX7209I: Connected to process “dmgr” on node Server1_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, heapsize, -s, Server_member1]”
heapsize: node=Server1_Node01  server=Server_member1  used=1024.0 MB (52.44%)  free=928.6 MB

Download script from http://www.oracledbasupport.co.uk/wp-content/uploads/2010/08/Check-was Python Script.txt

The Jython script used is as below :

#———————————————————————-
# File Name: check_was.py
#   Purpose: Display user requested information about
#            WebSphere Application Server (WSAS) resources.
#
# Run “$WAS_HOME/Dmgr/bin/wsadmin.sh -conntype none -lang jython”
# wsadmin>print AdminConfig.list(‘Server’);
# dmgr(cells/Server1_Cell/nodes/Server1_Manager/servers/dmgr|server.xml#Server_1)
# ihs-prpc(cells/Server1_Cell/nodes/Server1_Node01/servers/ihs-prpc|server.xml#Server_1280149489851)
# server_member1(cells/Server1_Cell/nodes/Server1_Node01/servers/server_member1|server.xml#Server_1280159031517)
# server_member2(cells/Server1_Cell/nodes/Server1_Node01/servers/server_member2|server.xml#Server_1280159031764)
# nodeagent(cells/Server1_Cell/nodes/Server1_Node01/servers/nodeagent|server.xml#Server_1120677326772)
#
#———————————————————————-
”’Command: %(cmdName)s\n
Purpose: wsadmin script used to display user specified information about
WebSphere Application Server resources.\n
Usage: %(cmdName)s [options]\n
Required switches/options:
-i | –info       <value> = Type of information being requested
-s | –serverName <value> = Target serverName\n
Optional switches/options:
-n | –nodeName   <value> = Target nodeName\n
Information types/values:
connectionpool – Display Connection Pool details
heapsize       – Display Heap Size details
threadpool     – Display Thread Pool details
sessions       – Display Session Details\n
\nNotes:
– Long form option values may be separated/delimited from their associated
identifier using either a space, or an equal sign (‘=’).\n
– Short form option values may be sepearated from their associated letter
using an optional space.\n
– Text containing blanks must be enclosed in double quotes.\n
Examples:
wsadmin -f %(cmdName)s.py -i heapeize -s server1 -n node01\n”’

import os, re, sys, getopt;

__scriptName__ = ‘check_was’;
__version__    = ‘0.1’;
__updated__    = ’22 July 2010′;

#———————————————————————
# Name: localMode()
# Role: Return true (1) if AdminControl object is unavailable, false
#       (0) otherwise.
# Note: In localmode (i.e., -conntype none), this returns true (1)
#———————————————————————
def localMode() :
‘localMode() – Return true (1) if AdminControl object is unavailable, false (0) otherwise’
try :
host   = AdminControl.getCell();
result = 0;                        # No, we’re connected
except :
result = 1;                        # Yes, –contype none
return result;

#———————————————————————
# Name: beanNameAsDict()
# Role: Parse the specified MBean and return a dictionary of the name
#       value pairs
#———————————————————————
def beanNameAsDict( bean ) :
‘beanNameAsDict() – Parse the specified MBean and return a dictionary of the name value pairs’
result = {};
for pair in bean.split( ‘:’, 1 )[ 1 ].split( ‘,’ ) :
n, v = pair.split( ‘=’, 1 );
result[ n ] = v;
return result;

#———————————————————————
# Name: callerName
# Role: Utility routine used to determine, and return the name of the
#       calling function.
# Note: Dependends on sys._getframe()
#  See: http://code.activestate.com/recipes/66062/
#———————————————————————
def callerName() :
“callerName() – Returns the name of the calling routine (or ‘?’)”
return sys._getframe( 1 ).f_code.co_name;

#———————————————————————
# Name: configurable()
# Role: Return true (1) if AdminConfig object is available, false (0) otherwise
#———————————————————————
def configurable() :
‘configurable() – Return true (1) if AdminConfig object is available, false (0) otherwise’
try :
host   = AdminConfig.list( ‘Server’ );
result = 1;                        # True  = AdminConfig object is available
except :
result = 0;                        # False = AdminConfig object not available
return result;

#———————————————————————
# Name: configIdAsDict
# Role: Parse a config ID and return a dictionary of name/value pairs
# Note: Exception handler requires sys module
#       The keys in the returned dictionary come from the configID, so
#       are unlikely to match your defect expectations about exactly
#       what values are used (e.g., ‘nodes’ instead of “Node”)
#———————————————————————
def configIdAsDict( configId ) :
‘configIdAsDict( configId ) – Given a configID, return a dictionary of the name/value components.’
funName = callerName();              # Name of this function
result  = {};                        # Result is a dictionary
hier    = [];                        # Initialize to simplifiy checks
try :                                # Be prepared for an error
#—————————————————————–
# Does the specified configID match our RegExp pattern?
# Note: mo == Match Object, if mo != None, a match was found
#—————————————————————–
if ( configId[ 0 ] == ‘”‘ ) and ( configId[ -1 ] == ‘”‘ ) and ( configId.count( ‘”‘ ) == 2 ) :
configId = configId[ 1:-1 ];
mo = re.compile( r’^([\w ]+)\(([^|]+)\|[^)]+\)$’ ).match( configId );
if mo :
Name = mo.group( 1 );
hier = mo.group( 2 ).split( ‘/’ );
if mo and ( len( hier ) % 2 == 0 ) :
#—————————————————————
# hier == Extracted config hierarchy string
#—————————————————————
for i in range( 0, len( hier ), 2 ) :
( name, value ) = hier[ i ], hier[ i + 1 ];
result[ name ]  = value;
if result.has_key( ‘Name’ ) :
print ”’%s: Unexpected situation – “Name” attribute conflict,
Name = “%s”, Name prefix ignored: “%s””’ % ( funName, result[ ‘Name’ ], Name );
else :
result[ ‘Name’ ] = Name;
else :
print ”’%(funName)s:
Warning: The specified configId doesn\’t match the expected pattern,
and is ignored.
configId: “%(configId)s””’ % locals();
except :
( kind, value ) = sys.exc_info()[ :2 ];
print ”’%(funName)s: Unexpected exception.\n
Exception  type: %(kind)s
Exception value: %(value)s”’ % locals();
return result;

#———————————————————————
# Name: heapsize()
# Role: Display information about the heap for the specified server
#———————————————————————
def heapsize( configID ) :
‘heapsize() – Display used and free stats for the JVM of the specified server’
cDict = configIdAsDict( configID );
jvm   = AdminControl.queryNames( ‘type=JVM,process=%(servers)s,node=%(nodes)s,*’ % cDict );
if jvm :
used    = AdminControl.getAttribute( jvm, ‘heapSize’ );
free    = AdminControl.getAttribute( jvm, ‘freeMemory’ );
total   = int( used ) + int( free );
percent = float( used ) * 100.0 / float( total );
print ‘heapsize: node=%s  server=%s  used=%.1f MB (%.2f%%)  free=%.1f MB’ % ( cDict[ ‘nodes’ ], cDict[ ‘servers’ ], MB( used ), percent, MB( free ) );
else :
print ‘Specified server does not appear to be active: node=%(nodes)s  server=%(servers)s’ % cDict;

#———————————————————————
# Name: localMode()
# Role: Return true (1) if AdminControl object is unavailable, false
#       (0) otherwise.
# Note: In localmode (i.e., -conntype none), this returns true (1)
#———————————————————————
def localMode() :
‘localMode() – Return true (1) if AdminControl object is unavailable, false (0) otherwise’
try :
host   = AdminControl.getCell();
result = 0;                        # No, we’re connected
except :
result = 1;                        # Yes, –contype none
return result;

#———————————————————————
# Name: main()
# Role: Perform the actual work of the script
#———————————————————————
def main( cmdName = None ) :
missingParms = ‘%(cmdName)s: Insufficient parameters provided.\n’;
ambigServer  = ‘%(cmdName)s: Ambiguous server specified: %(serverName)s\n’;
badReqdParam = ‘%(cmdName)s: Invalid required parameter: %(key)s\n’;
badInfo      = ‘%(cmdName)s: As yet unimplemented “info” request: %(info)s\n’;
badNode      = ‘%(cmdName)s: Unknown node: %(nodeName)s\n’;
badServer    = ‘%(cmdName)s: Unknown server: %(serverName)s\n’;
serverReqd   = ‘%(cmdName)s: Missing required parameter: “serverName”.\n’;

if not cmdName :
cmdName = __scriptName__;

#——————————————————————-
# How many user command line parameters were specified?
#——————————————————————-
argc = len( sys.argv );                   # Number of arguments
if ( argc < 2 ) :                         # If too few are present,
print missingParms % locals();          #   tell the user, and
Usage( cmdName );                       #   provide the Usage info
else :                                    # otherwise
Opts = parseOpts( cmdName );            #   parse the command line

#——————————————————————-
# Assign values from the user Options dictionary, to make value
# access simplier, and easier.  For example, instead of using:
#   Opts[ ‘nodeName’ ]
# we will be able to simply use:
#   nodeName
# to access the value.
#——————————————————————-
for key in Opts.keys() :
val = Opts[ key ];
cmd = ‘%s=Opts[“%s”]’ % ( key, key );
#   print cmd;
exec( cmd );

#——————————————————————-
# Check required parameters
#——————————————————————-
if info not in [ ‘heapsize’, ‘sessions’, ‘connectionpool’, ‘threadpool’ ] :
print badInfo % locals();
Usage( cmdName );

if not serverName :
print serverReqd % locals();
Usage( cmdName );

#——————————————————————-
# Was the nodeName specified, and if so, does it exist?
#——————————————————————-
node = None;
if nodeName :
for nid in AdminConfig.list( ‘Node’ ).splitlines() :
if nid.startswith( nodeName + ‘(‘ ) :
node = nid;
if not node :
print badNode % locals();

#——————————————————————-
# Does the specified serverName exist (within the scope of the
# specified node)?
# Note: A scope of None is identical to not specifying a scope
#——————————————————————-
servers = [];
for sid in AdminConfig.list( ‘Server’, node ).splitlines() :
if sid.startswith( serverName + ‘(‘ ) :
servers.append( sid );
if len( servers ) < 1 :
print badServer % locals();
sys.exit();
elif len( servers ) > 1 :
print ambigServer % locals();
nodes = [];
for sid in servers :
nodes.append( configIdAsDict( sid )[ ‘nodes’ ] );
print ‘Specify one of the following nodes using the –nodeName option: ‘ + ( ‘, ‘.join( nodes ) );
sys.exit();
server = servers[ 0 ];

# print ‘Request for %s on %s’ % ( info, server );
if info == ‘heapsize’ :
heapsize( server );
else :
print ‘Not yet implemented: “%s”‘ % info

#———————————————————————
# Name: MB()
# Role: Convert the specified (integer) value [bytes] into MegaBytes
#———————————————————————
def MB( val ) :
‘MB() – Convert specified integer (byte) value into MegaBytes’
return int( val ) / ( 1024.0 * 1024.0 );

#———————————————————————
# Name: parseOpts()
# Role: Process the user specified (command line) options
#———————————————————————
def parseOpts( cmdName ) :
shortForm = ‘i:n:s:’;
longForm  = ‘info=,nodeName=,serverName=’.split( ‘,’ );
badOpt    = ‘%(cmdName)s: Unknown/unrecognized parameter%(plural)s: %(argStr)s\n’;
optErr    = ‘%(cmdName)s: Error encountered processing: %(argStr)s\n’;
problem   = ‘%(cmdName)s: Error option processing problem: %(opt)s\n’;

try :
opts, args = getopt.getopt( sys.argv, shortForm, longForm );
except getopt.GetoptError :
argStr = ‘ ‘.join( sys.argv );
print optErr % locals();
Usage( cmdName );

#——————————————————————-
# Initialize the Opts dictionary using the longForm key identifiers
#——————————————————————-
Opts = {};
for name in longForm :
if name[ -1 ] == ‘=’ :
name = name[ :-1 ]
Opts[ name ] = None;

#——————————————————————-
# Process the list of options returned by getopt()
#——————————————————————-
for opt, val in opts :
if opt in   ( ‘-i’, ‘–info’ )       : Opts[ ‘info’       ] = val
elif opt in ( ‘-n’, ‘–nodeName’ )   : Opts[ ‘nodeName’   ] = val
elif opt in ( ‘-s’, ‘–serverName’ ) : Opts[ ‘serverName’ ] = val
else :
print problem % locals();

#——————————————————————-
# Check for unhandled/unrecognized options
#——————————————————————-
if ( args != [] ) :        # If any unhandled parms exist => error
argStr = ‘ ‘.join( args );
plural = ”;
if ( len( args ) > 1 ) : plural = ‘s’;
print badOpt % locals();
Usage( cmdName );

#——————————————————————-
# Return a dictionary of the user specified command line options
#——————————————————————-
return Opts;

#———————————————————————
# Name: Usage()
# Role: Display usage information necessary to use this script.
#———————————————————————
def Usage( cmdName = None ) :
if not cmdName :
cmdName = __scriptName__;

print __doc__ % locals();       # Script docstring contains usage info
sys.exit();

#———————————————————————-
# Code execution begins
#———————————————————————-
if ( __name__ == ‘__main__’ ) or ( __name__ == ‘main’ ) :
if localMode() :
print ‘A connection to WebSphere Application Server is required.\n’;
Usage();
elif configurable() :
main();
else :
print ‘WebSphere Application Server scripting objects appear to be unavailable.\n’;
Usage();
else :
print ‘This script should be executed, not imported.\n’;
Usage( __name__ );


Time Travel & Websphere Node/Deployment manager synchronisation

Posted by Sagar Patil

I have websphere 6.x ND servers which time travel in future i.e 2011/2012.  One of machine time traveled to 2011, I then had to revert it back to current date i.e 2010. I can now see that configuration under following directories is not updated properly.

DMGR : Aug 5 2010 is the latest.

[was@Server1 Profile01]$ ls -l profiles/Profile01/dmgr/config/cells/Server1_Cell/nodes/Server1_Node01
total 136
-rw-rw-r– 1 was was   818 Aug  5 16:23 trust.p12
-rw-rw-r– 1 was was  3474 Aug  5 16:23 key.p12
-rw-rw-r– 1 was was 12552 Aug  3 13:24 serverindex.xml

[was@Server1 ~]$ ls -lrt profiles/Profile01/Node/config/cells/Server1_Cell/nodes/Server1_Node01
total 136
-rw-rw-r– 1 was was  2042 Aug 13  2011 trust.p12
-rw-rw-r– 1 was was  2770 Aug 13  2011 key.p12
-rw-rw-r– 1 was was 12552 Aug 15  2011 serverindex.xml

How does Deployment manager syncs Nodes with it’s new configuration?

In order for synchronization to work, the system clocks of the Deployment Manager, and Node Agent machines must be within a specific time range. Otherwise, the attempt to synchronize will fail, and you will get a message indicating that the time difference is too great.

If you have more than 5 min difference between dmgr and node. And you have admin security enabled. Then you will see LTPA token expiration errors…. While communicating with the Deployment Manager, the Node agent for example sync or discover process.

Where will I get this error message?

Yes.  The Deployment Manager is the one that attempts the synchronization with the node agents, so the status messages (i.e., success/failure) would be in the DM logs.

I often get too many file entries left at wstemp and temp directories under NodeAgent/Dmgr. They are failed sync files and would like to know if I can delete them.

WebSphere Application Server and config temp files

  • The node sends a sync request to cell (dmgr)
  • The cell manager identifies the modified documents, copies them to the temp folder (config/temp) and then sends the response to node with the URLs of modified documents.
  • The node then uses the File Transfer service to download the documents to local machine.
  • The file transfer service internally sets a flag that enables the file transfer server to delete the temp file once the download is complete.

Whenever there is a request to transfer a file, the dmgr creates a temp copy in the config/temp directory. <Install_Root>\config\temp\cells\<cell_name>\applications\ .

  • The dmgr deletes the temp copy only when the file is completely read and copied to the client.
  • The temp files get deleted only when the download process is complete and successful.

Why does dmgr/nodeagent use temp directories? Is there any reason for it?

The wstemp directory is where workspaces (save areas) are created when someone begins the process of changing a configuration in a node.
The wstemp directory is the workspace directory.  Any program that ask the workspace for a session (e.g. adminconsole and wsadmin)  a directory will be created.  If the session is not cleaned up
the directories will remain.  For wsadmin, the completion of wsadmin will clean the directory, note if you kill or wsadmin fails to work and crash, the folder will remain (these have script in the folder
name).

For adminconsole, each user will have their own folder. These folders will always remain because we maintain user preference during their sessions.  Also if the user does not logout, we keeps all configuration changes in this folder.  Once they log out, the user folder will be reduced to contain the minimum preference information for the next session login. You can remove all these files/folders and the dmgr will create new files (we highly recommmend stopping the dmgr before deleting these so users logged in don’t have errors).

These folders contain temporary files and can be manually deleted.  Websphere will automatically manage these files and if they are growing later, something is wrong because users are killing/not logging out.

Hers is a reference document which helps to understand and to debug the problems with wstemp workspace directories which contains workspace  directories named with ‘anonymousxxxx’ and ‘ Scriptxxxx’ .

Problem with workspace directories when created in wstemp directory
http://www-1.ibm.com/support/docview.wss?uid=swg21221297

More reading

IBM – WebSphere Application Server synchronization process explained
http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg21233075

IBM – What is file synchronization and how does it work?
http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg21108407

Weblogic : Monitor Weblogic through command line

Posted by Sagar Patil

Set the java environment. There is a script for setting the CLASSPATH and PATH so that this tool can work.

> source setWLSEnv.sh
CLASSPATH=/dsk2/local/bea81/jdk141_02/lib/tools.jar:/dsk2/local/bea81/weblogic81/server/lib/weblogic_sp.jar:
/dsk2/local/bea81/weblogic81/server/lib/weblogic.jar:/dsk2/local/bea81/weblogic81/server/lib/ojdbc14.jar:
:/dsk1/AdvIngres/ing26/ingres/lib/edbc.jar:/dsk1/AdvIngres/ing26/ingres/lib/edbc.jar

PATH=/dsk2/local/bea81/weblogic81/server/bin:/dsk2/local/bea81/jdk141_02/jre/bin:/dsk2/local/bea81/jdk141_02/bin:
/dsk1/AdvIngres/ing26/ingres/bin:/dsk1/AdvIngres/ing26/ingres/utility:/dsk1/AdvIngres/ing26/ingres/files:
/dsk1/AdvIngres/ing26/ingres/lib:/dsk1/AdvIngres/ing26/ingres/SUNWspro/bin:/sbin:/usr/sbin:/bin:/usr/bin:
/usr/ucb:/etc:/usr/etc:/opt/fw/bin:/var/adm/psmfc/bin:/usr/openwin/bin:/usr/local/bin:/usr/psmfc/bin:
/usr/ccs/bin:/usr/lib/nis:/opt/gnu/bin:/usr/local/bin

Your environment has been set.

Success

> java weblogic.Admin

weblogic.Admin is a command-line utility for managing WebLogic Server.

Try: weblogic.Admin help LIFECYCLE   Starting, stopping, discovering servers
weblogic.Admin help INFO        Retrieving info about WebLogic Server
weblogic.Admin help JDBC        Working with JDBC connection pools
weblogic.Admin help MBEAN       Working with WebLogic Server MBeans
weblogic.Admin help CLUSTER     Working with clusters
weblogic.Admin help ALL         Help for all commands

Usage: java [<SSL trust options>] weblogic.Admin
[ [-url | -adminurl] [<protocol>://]<listen-address>:<port>]
-username <username> -password <password>
<COMMAND> <ARGUMENTS>

Sample commands

get state
> java weblogic.Admin -username user -password pass GETSTATE myserver
Current state of “myserver” : RUNNING

get server config

> java weblogic.Admin -username user -password pass GET -pretty -type Server

get server stats
> java weblogic.Admin -username user -password pass GET -pretty -type ServerRuntime

get queue stats

> java weblogic.Admin -username user -password pass GET -pretty -type ExecuteQueueRuntime

get queue stats for just the default execute queue (the one that does application work)

This shows that there are 15 idle threads that can be used by the application and there are no pending requests. Also, this queue has serviced 415,607 requests.

get JVM stats

> java weblogic.Admin -username user -password pass GET -pretty -type JVMRuntime

get JDBC stats

We have connection pools configured, but are not using them, so this is not a useful source of information.

> java weblogic.Admin -username user -password pass GET -pretty -type JDBCConnectionPoolRuntime

Creating Users /Groups at Websphere

Posted by Sagar Patil

We have to create WAS groups before creating & assigning users.

Click on Manage groups and add a new groups , here “WAS Monitor”


Click on “Save “



Click on “Create” at  right hand pane & you will see a FORM like one below

Click on “Group Membership” and select WAS Operator role we just created.


Now refer to following post for stopping  and starting  websphere services
http://www.oracledbasupport.co.uk/websphere-security-switch-off-usernamepassword-prompt/#comment-2905

Script to Auto Start Primary/Standby Database under Linux

Posted by Sagar Patil

The following represents the Oracle recommended method for automating database startup and shutdown of Oracle 10g instances.

Once the instance is created, edit the “/etc/oratab” file setting the restart flag for each instance to ‘Y’.
dev:/u01/app/oracle/product/10.2.0:N
Change N to Y
dev:/u01/app/oracle/product/10.2.0:Y

Next, create a file called “/etc/init.d/dbora” as the root user, containing the following.

#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.

ORA_HOME=/u01/app/oracle/product/10.2.0/
ORA_OWNER=oracle

if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo “Oracle startup: cannot start”
exit
fi

case “$1” in
‘start’)
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su – $ORA_OWNER -c “$ORA_HOME/bin/dbstart $ORA_HOME”
;;
‘stop’)
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su – $ORA_OWNER -c “$ORA_HOME/bin/dbshut $ORA_HOME”
;;
esac

set the chmod command to set the privileges to 750
chmod 750 /etc/init.d/dbora

Associate the dbora service with the appropriate run levels and set it to auto-start using the following command.
chkconfig –add dbora

The default TNS listener (LISTENER) will be started by dbshut/dbstart scripts.

If you are using customized listener name like LISTENER_TEST, LISTENER_PRE then please edit dbshut and dbstart lines as below

— At DBSHUT
$ORACLE_HOME_LISTNER/bin/lsnrctl LISTENER stop    “Change to”
$ORACLE_HOME_LISTNER/bin/lsnrctl LISTENER_TEST stop

–AT DBSTART
$ORACLE_HOME_LISTNER/bin/lsnrctl LISTENER start    “Change to”
$ORACLE_HOME_LISTNER/bin/lsnrctl LISTENER_TEST start

The relevant instances should now startup/shutdown automatically at system startup/shutdown

Websphere : How to Create Self Signed SSL Certificate for HTTPServer

Posted by Sagar Patil

What is SSL ?

  • SSL (Secure Sockets Layer) is an encryption system used on servers to ensure privacy when transmitting data across internet.
  • Server needs a public-private key pair and a certificate. The server uses its private key to sign messages to clients.
  • To send its public key to clients, the server needs a certificate issued by a certification authority (CA). A certification authority (CA) is a trusted third party that issues certificates.

IBM’s way of SSL implementation :  IBM provides GSKit (Global Security Kit)
* GSKit provides SSL (Secure Socket Layer) functions for IBM Products
* GSKit provides IKeyman

IKeyman

  • IKeyman (IBM Key Management Utility)
  • Java-based application to manage keys and key databases
  • Using IKeyman, you can  Create a new key database , Add root CA to your database,  Request and receive a certificate from a CA
  • Set default keys
  • Change password

How to Create Self Signed SSL Certificate?

Create a SSL directory under $HTTP_HOME/conf to store all SSL keys. Make sure this directory is secured.

[was61@Server1 conf]$ pwd
/opt/IBM/HTTPServer/conf
[was61@Server1 conf]$ mkdir ssl

Start $HTTPSever_home/bin/ikeyman tool

Apache Tomcat and many other Java applications expect to retrieve SSL/TLS certificates from a Java Key Store (JKS). Select JKS else PKCS2 on your preference.  I have gone for PKCS12  here,  http://en.wikipedia.org/wiki/PKCS

Navigate “Location” tab to SSL directory created earlier




It will prompt you for a password , enter value. You should have a screen as below.

Select “Personal Certificate Requests“ from drop-down options

Click on “new” to start a new self-signed certificate request

Fill up fields and click on OK

Ikeyman should list “Self-Signed” certificate as below

Double Click on “self-signed” Tab and you will be able to see certificate details

Now certificate is in place so let’s Amend SSL certificate configuration at httpd.conf

Edit $HTTPServer_HOME/httpd.conf and add following details

  • Listen Server1:443
  • Towards end of http.conf file add virtual host  details

LoadModule ibm_ssl_module modules/mod_ibm_ssl.so
<VirtualHost  Server1:443>
SSLEnable
SSLClientAuth None
SSLServerCert self-signed    — Make sure this is same field as “Key-Label” at create SSL request
KeyFile “/opt/IBM/HTTPServer/conf/ssl/key.p12”
# SSLStashfile “/opt/IBM/HTTPServer/conf/ssl/key.sth”  — This file is required for “CMS key Database format”  but not for JKS/PKCS12
DocumentRoot “/opt/IBM/HTTPServer/htdocs/en_US”
LogLevel warn
LogFormat   “%h %l %u %t \”%r\” %>s %b %{HTTPS}e %{SSL_CIPHER}e %{SSL_CLIENT_DN}e” SSL
CustomLog “|/opt/IBM/HTTPServer/bin/rotatelogs /opt/IBM/HTTPServer/logs/ssl_access%d%m%Y.log 86400” SSL
ErrorLog  “|/opt/IBM/HTTPServer/bin/rotatelogs /opt/IBM/HTTPServer/logs/ssl_error%d%m%Y.log 86400”
</VirtualHost>

  • Finally re-start HTTP server & monitor log  at /opt/IBM/HTTPServer/logs/ ssl_error.log

Try machine SSL URL https://Server1, It should send you a valid response.

Clone a WebShere installation on another server

Posted by Sagar Patil

Method 1:

1) Install exact websphere version including fixpack on a new machine
Note you have to make sure to use same install path for example

2) create dmgr and nodeprofile on a NEW machine

3) Stop the dmgr, nodeagent and all application server on OLD machine

4) Tar/zip up complete dmgr profile directory and node profile from OLD machine and untar/unzip on a NEW machine

Now change hostname entries in the websphere configuration and Use following link for changing hostname
WebSphere Application Server V6.0 best practices for configuration changes
http://www-01.ibm.com/support/docview.wss?uid=swg27007419&aid=1

5) Once new DMGR is up , manually sync node with dmgr using syncnode command
$NODE_HOME/bin$syncnode newdmgrhostname dmgrsoapport -username user -password password

6)  once sync went fine start the nodeagent and make sure sync status shows correctly on dmgr console

7)  Now start all application server from dmgrconsole

 

 

 

 

 

Method 2

1) Install exact websphere version including fixpack on a new machine
Note you have to make sure to use same install path

2) Don’t create any profiles

3) Tar/zip up complete dmgr profile directory and node profile from OLD machine and untar/unzip on a NEW machine

4) Use rename node Command to rename Node

$DMGR_HME/bin$renameNode.sh localhost 8879 newnode

Note : You need to have deployment manager working to use renamenode command.

 


	

Websphere : Jython stop & start server scripts

Posted by Sagar Patil

Stop Script:

Let’s check if there are any java (server) process running ?

[was61@ scripts]$ ps -ef | grep java |  awk ‘{print  $2 ” ”  $8}’
18343 /opt/IBM/WebSphere/AppServer/java/bin/java
18521 /opt/IBM/WebSphere/AppServer/java/bin/java
18639 /opt/IBM/WebSphere/AppServer/java/bin/java
18819 /opt/IBM/WebSphere/AppServer/java/bin/java

Copy this script at your node and use it as “wsadmin.sh -f stopCell.py” (No arguments)

#——————————————————————————-
#  Name: stopCell.py
#  Role: Gracefully terminate all active server processes in the cell
# Usage: wsadmin -f stopCell.py
#    or: ./wsadmin.sh -f stopCell.py
#——————————————————————————-
#  Name: showAsDict.py
#  From: WebSphere Application Server Administration using Jython
#    By: Robert A. (Bob) Gibson [rag], Arthur Kevin McGrath, Noel J. Bergman
#  ISBN: 0-137-00952-6
#——————————————————————————-
def showAsDict( configID ) :
‘Return a dictionary of the AdminConfig.show( configID ) result.’
result = {};
try :
import sys;           # Get access to WSAS objects
#—————————————————————–
# The result of the AdminConfig.show() 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 AdminConfig.show( 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 :
( kind, value ) = sys.exc_info()[ :2 ];
print ‘Exception  type: ‘ + str( kind );
print ‘Exception value: ‘ + str( value );
return result;

#———————————————————————
# For each type of server
#———————————————————————
for Type in [ ‘APPLICATION_SERVER’, ‘NODE_AGENT’, ‘DEPLOYMENT_MANAGER’ ] :
#——————————————————————-
# For each configured server
#——————————————————————-
for server in AdminConfig.list( ‘Server’ ).splitlines() :
#—————————————————————–
# If this server is of the current type
#—————————————————————–
sDict = showAsDict( server );
if sDict[ ‘serverType’ ] == Type :
bean = AdminConfig.getObjectName( server );
#—————————————————————
# Is this server active
#—————————————————————
if bean :
#————————————————————-
# stop it (asynchronously)
#————————————————————-
print ‘Stoppping: ‘ + sDict[ ‘name’ ];
AdminControl.invoke( bean, ‘stop’ );

Usage :

[was61@ scripts]$  /opt/IBM/WebSphere/AppServer/bin/wsadmin.sh -f stopcell.py
WASX7209I: Connected to process “dmgr” on node server1_Manager using SOAP connector;  The type of process is: DeploymentManager
Stoppping: server_member1
Stoppping: server_member2
Stoppping: nodeagent
Stoppping: dmgr

Start Script:

Let’s check if there are any java (server) process running ?

[was61@scripts]$ ps -ef | grep java |  awk ‘{print  $2 ” ”  $8}’
19420 grep

#———————————————————————
# Name: startCell()
# Role: Attempt to start all of the Application Servers in the
#       specified WebSphere Application Server cell.
#———————————————————————
”’
Program: %(cmdName)s.py\n
Role: Attempt to start all of the Application Servers in the
specified WebSphere Application Server cell.\n
Usage: python %(cmdName)s.py <WSAS_HOME>\n
Example: python %(cmdName)s.py C:\\IBM\\WebSphere\\AppServer
”’
import os, sys, re;
__Debug__  = True;
__dashes__ = ‘-‘ * 79;

#———————————————————————
# Name: dirCheck()
# Role: Verify that the specified directory exists, and is a directory
#———————————————————————
def dirCheck( path ) :
return os.path.exists( path ) and os.path.isdir( path );

#———————————————————————
# Name: log()
# Role: If debugging is enabled, log the specified message
#———————————————————————
def log( msg ) :
if __Debug__ :
print msg;

#———————————————————————
# Name: getProfiles()
# Role: Determine the names of the existing profiles
#———————————————————————
def getProfiles( binPath, tempFile ) :
log( ‘getProfiles(): Enter’ );
try :
if os.name == ‘nt’ :
cmd =  ‘manageprofiles’;
else :
cmd =  ‘./manageprofiles.sh’;
exe = os.path.join( binPath, cmd );
log( ‘Calling: %s -listProfiles’ % exe );
rc  = os.system( exe + ‘ -listProfiles >’ + tempFile );
fh  = open( tempFile );
result = fh.read();
log( ‘Result:\n%s\n%s%s’ % ( __dashes__, result, __dashes__ ) );
result = result[ 1:-2 ].split( ‘, ‘ );
fh.close();
except :
Type, value = sys.exc_info()[ :2 ];
log( ‘Exception  Type: ‘ + `Type` );
log( ‘          value: ‘ + `value` );
result = [];
log( ‘getProfiles(): Exit  result = ‘ + `result` );
return result;

#———————————————————————
# Name: getStoppedServers()
# Role: Determine the Server name and type for the specified profiles
# Note: We’re only interested in “stopped” servers, we ignore started
#       ones.
#     – The 3 Types of Servers are:
#       Deployment Manager
#       Node Agent
#       Application Server
#———————————————————————
def getStoppedServers( binPath, tempFile, profileNames ) :
log( ‘getStoppedServers(): Enter’ );
result = {};
pat = re.compile( ‘^ADMU0509I: The (\w+ \w+) “(\w+)”‘ )
for pName in profileNames :
try :
if os.name == ‘nt’ :
cmd =  ‘serverStatus’;
else :
cmd =  ‘./serverStatus.sh’;
exe = os.path.join( binPath, cmd );
log( ‘Calling: %s -all -profileName %s’ % ( exe, pName ) );
rc  = os.system( ‘%s -all -profileName %s >%s’ % ( exe, pName, tempFile ) );
fh  = open( tempFile );
log( ‘Result:\n%s’ % __dashes__ );
for line in fh.read().splitlines() :
mo = pat.match( line );
if mo :
Type, sName = mo.group( 1 ), mo.group( 2 );
log( ‘Stopped: %s -profileName %s’ % ( sName, pName ) );
if result.has_key( Type ) :
result[ Type ].append( ( pName, sName ) );
else :
result[ Type ] = [ ( pName, sName ) ];
log( __dashes__ );
fh.close();
except :
value = str( sys.exc_info()[ 1 ] );
print ‘Error processing profileName %s: %s’ % ( pName, value );
log( ‘getStoppedServers(): Exit  result =’ + `result` );
return result;

#———————————————————————
# Name: startCell()
# Role: Start the application servers in the specified cell.
#———————————————————————
def startCell() :
log( ‘startCell(): Enter’ );

#——————————————————————-
# How many user specified command line options exist?
#——————————————————————-
argc = len( sys.argv );
if argc != 2 :
Usage();
else :
try :
#—————————————————————
# pgm = fully qualified path to script being executed
#—————————————————————
pgm  = sys.argv[ 0 ];
if not pgm.endswith( ‘.py’ ) :
raise ValueError( ‘Unrecognized script type: “%s”‘ % pgm );
tempfile = pgm[ :-2 ] + ‘temp’;
#     print ‘tempfile: “%s”‘ % tempfile;

#—————————————————————
# Verify that washome exists, and is a directory
#—————————————————————
WASerror = ‘”%s” does not appear to be a WAS Home directory.’;
washome = sys.argv[ 1 ];
if not dirCheck( washome ) :
print WASerror % washome;
sys.exit();

wasbin  = os.path.join( washome, ‘bin’ );
if not dirCheck( wasbin ) :
print WASerror % wasbin;
sys.exit();

#—————————————————————
# Get a list of the available profileNames
#—————————————————————
profileNames = getProfiles( wasbin, tempfile );

#—————————————————————
# For each Server Type, list the profilName and serverName of
# each stopped server
#—————————————————————
stopped = getStoppedServers( wasbin, tempfile, profileNames );

#—————————————————————
# width = length of longest server name
#—————————————————————
sNames = [];
for Type in stopped :
for n, s in stopped[ Type ] :
sNames.append( s );
width = max( [ len( x ) for x in sNames ] );

#—————————————————————
# Process each Type, in the right order to start the cell
#—————————————————————
for Type in [ ‘Deployment Manager’, ‘Node Agent’, ‘Application Server’ ] :
if stopped.has_key( Type ) :
for pName, sName in stopped[ Type ] :
startServer( wasbin, pName, sName, tempfile, -width );

#—————————————————————
# Remove the temporary file
#—————————————————————
try :
os.unlink( tempfile );
except :
pass;
except :
Type, value = sys.exc_info()[ :2 ];
Type, value = str( Type ), str( value );
print ‘Exception type: %s\n         value: %s’ % ( Type, value );
log( ‘startCell(): Exit’ );

#———————————————————————
# Name: startServer()
# Role: Execute the WebSphere Application Server “startServer” command
#———————————————————————
def startServer( binPath, profile, server, tempFile, width = None ) :
log( ‘startServer(): Enter’ );
try :
if os.name == ‘nt’ :
cmd =  ‘startServer’;
else :
cmd =  ‘./startServer.sh’;
log( ‘Calling: %s %s -profileName %s’ % ( cmd, server, profile ) );
exe = os.path.join( binPath, cmd );
if width :
print ‘%s %*s -profileName %s’ % ( cmd, width, server, profile ),
else :
print ‘%s %s -profileName %s’ % ( cmd, server, profile ),
cmd = ‘%s %s -profileName %s >%s’ % ( exe, server, profile, tempFile );
rc  = os.system( cmd );
fh  = open( tempFile )
tail = fh.read().splitlines()[ -1 ];
fh.close();
if tail.startswith( ‘ADMU3000I:’ ) :
log( ‘  Started successfully.’ );
result = 0;
if not __Debug__ :
print;
else :
log( ‘  Start failed:’, tail );
print ‘  Error – tail = “%s”‘ % tail;
result = 1;
except :
value = str( sys.exc_info()[ 2 ] );
print ‘  Error – ‘, value;
result = -1;
log( ‘startServer(): Exit’ );
return result;

#———————————————————————
# Name: Usage()
# Role: Descript script function
#———————————————————————
def Usage( cmdName = ‘startCell’ ) :
print __doc__ % locals();
sys.exit( -1 );

#———————————————————————
# main entry point – verify that script was executed, not imported
#———————————————————————
if __name__ == ‘__main__’ :
if os.name in [ ‘nt’, ‘posix’ ] :
startCell();
else :
print ‘Unsupported Operating System type: %s\n’ % os.name;
Usage();
else :
Usage( __name__ );

Usage (Ignore)

[was61@scripts]$ /opt/IBM/WebSphere/AppServer/bin/wsadmin.sh -f startcell.py
WASX7023E: Error creating “SOAP” connection to host “localhost”; exception information: com.ibm.websphere.management.exception.ConnectorNotAvailableException: com.ibm.websphere.management.exception.ConnectorNotAvailableException: ADMC0016E: The system cannot create a SOAP connector to connect to host localhost at port 8879.
WASX7213I: This scripting client is not connected to a server process; please refer to the log file /opt/IBM/WebSphere/AppServer/profiles/Profile01/dmgr/logs/wsadmin.traceout for additional information.
WASX8011W: AdminTask object is not available.
Program: main.py
Role: Attempt to start all of the Application Servers in the
specified WebSphere Application Server cell.
Usage: python main.py <WSAS_HOME>
Example: python main.py C:\IBM\WebSphere\AppServer

(Please note you will need python installed on your box to run this script)

[was61@scripts]$ python startcell.py /opt/IBM/WebSphere/AppServer

startServer dmgr -profileName dmgr

I have tested it and it is only bringing up DMGR,Will need some tweaking

[was61@scripts]$ ps -ef | grep java |  awk ‘{print  $2 ” ”  $8}’
19716 /opt/IBM/WebSphere/AppServer/java/bin/java

Jython Script : Get websphere Server Details

Posted by Sagar Patil

This jython script will produce output  as below :

$/opt/IBM/WebSphere/AppServer/bin/wsadmin.sh -lang jython -profile serverStatus.py -c “serverStatus()”

WASX7209I: Connected to process “dmgr” on node server1_Manager using SOAP connector;  The type of process is: DeploymentManager

Server               |        Cell       |         Node         | Status
——————–+——————-+———————-+——–
dmgr                | Server1_Cell | Server1_Manager | running
server_member1         | Server1_Cell | Server1_Node01  | running
server_member2 | Server1_Cell | Server1_Node01  | running
nodeagent           | Server1_Cell | Server1_Node01  | running

import re;

#———————————————————————
# Name: serverStatus()
# Role: Display the status of the known servers
#———————————————————————
def serverStatus() :
#——————————————————————-
# RegExp to extract the server, cell, and node name for each server
#——————————————————————-
pat = re.compile( r’^(\w+)\(cells/(\w+)/nodes/(\w+)/servers\/\1.*\)$’ );

#——————————————————————-
# Retrieve the list of known servers
# While building the list, compute the max length of each name
#——————————————————————-
info   = [];
maxLen = [ 0 ] * 3;

#——————————————————————-
# For each server of the known servers
#——————————————————————-
servers = AdminConfig.list( ‘Server’ ).splitlines();
for server in servers :
#—————————————————————–
# An Object Name will exist if the specified server is running
#—————————————————————–
oName = AdminConfig.getObjectName( server );
if oName != ” :
status = ‘running’;
else :
status = ‘stopped’;
#—————————————————————–
# Extract the server, cell, and node name
# (match Object)
#—————————————————————–
mObj = pat.match( server );
if mObj :
#—————————————————————
# Save the data, and see if the length of each field name is the
# longest we have yet seen (i.e., maxLen[ i ])
#—————————————————————
( sName, cName, nName ) = mObj.groups();
info.append( ( sName, cName, nName, status ) );
for i in range( 3 ) :
L = len( mObj.group( i + 1 ) );
if L > maxLen[ i ] : maxLen[ i ] = L;

#——————————————————————-
# Display the information
#——————————————————————-
( L0, L1, L2 ) = maxLen;
( sName, cName, nName, status ) = ‘Server,Cell,Node,Status’.split( ‘,’ );
sName = sName.center( L0 );
cName = cName.center( L1 );
nName = nName.center( L2 );
print ‘%(sName)s | %(cName)s | %(nName)s | %(status)s’ % locals();
print ( ‘-‘ * L0 ) + ‘-+-‘ + ( ‘-‘ * L1 ) + ‘-+-‘ + ( ‘-‘ * L2 ) + ‘-+——–‘;
for scn in info :
( sName, cName, nName, status ) = scn;
print ‘%-*s | %-*s | %-*s | %s’ % ( L0, sName, L1, cName, L2, nName, status );

JACL Script : Get server status & OS details before deployment

Posted by Sagar Patil

This script is designed to get complete server status details and OS details just before deployemnt. Its designed to help in debugging and simulating the same environment.
Note:No arguments required for this script to run

I have added JACL script output first, scroll down to see the actual script.

Script for download

[was61@Machine1 ~]$ /opt/IBM/WebSphere/AppServer/bin/wsadmin.sh -user sagar -password 1234 -f getdetails.jacl

WASX7209I: Connected to process “dmgr” on node Machine1_Manager using SOAP connector;  The type of process is : DeploymentManager
****************************************************************
—              GET ALL DEBUG DETAILS                        —
****************************************************************
server details on Jul. 14, 2010 03:24:10 PM
Starting getDetails script …
———————————————————————-
Number of running servers on node Machine1_Manager: 1
Server dmgr processtype: DeploymentManager
Server dmgr state STARTED
Server dmgr JVM details WebSphere:name=JVM,process=dmgr,platform=proxy,node=Machine1_Manager,j2eeType=JVM,J2E                                            EServer=dmgr,version=6.1.0.21,type=JVM,mbeanIdentifier=JVM,cell=Machine1_Cell,spec=1.0
———————————————————————————
Websphere Application Server dmgr Java Env. Details:
———————————————————————————
Java Specification Name: Java Platform API Specification
Java Specification vendor Name: Sun Microsystems Inc.
Java Specification Version: 1.5
java.util.logging.manager : com.ibm.ws.bootstrap.WsLogManager
java.util.logging.configureByServer : true
java.util.prefs.PreferencesFactory : com.ibm.ws.util.prefs.HashPreferencesFactory
java.vendor : IBM Corporation
java.vendor.url : http://www.ibm.com/
java.version : 1.5.0
Java virtual machine info: J2RE 1.5.0 IBM J9 2.3 Linux amd64-64 j9vmxa6423ifx-20080811 (JIT enabled)
J9VM – 20080809_21892_LHdSMr
JIT  – 20080620_1845_r8
GC   – 200806_19
—————————————————————————
dmgr (DeploymentManager) has pid 2231; state: STARTED; on Linux
Number of applications running on dmgr: 3
ManagementEJB
—————————————————————-

filetransfer
—————————————————————-

isclite
—————————————————————-

Number of running servers on node Machine1_Node01: 3
Server server_member1 processtype: ManagedProcess
Server server_member1 state STARTED
Server server_member1 JVM details WebSphere:name=JVM,process=server_member1,platform=proxy,node=Server1                             ,j2eeType=JVM,J2EEServer=server_member1,version=6.1.0.21,type=JVM,mbeanIdentifier=JVM,cell=Server1_Cell,spec=1.0
———————————————————————————
Websphere Application Server server_member1 Java Env. Details:
———————————————————————————
Java Specification Name: Java Platform API Specification
Java Specification vendor Name: Sun Microsystems Inc.
Java Specification Version: 1.5
java.util.logging.manager : com.ibm.ws.bootstrap.WsLogManager
java.util.logging.configureByServer : true
java.util.prefs.PreferencesFactory : java.util.prefs.FileSystemPreferencesFactory
java.vendor : IBM Corporation
java.vendor.url : http://www.ibm.com/
java.version : 1.5.0
Java virtual machine info: J2RE 1.5.0 IBM J9 2.3 Linux amd64-64 j9vmxa6423ifx-20080811 (JIT enabled)
J9VM – 20080809_21892_LHdSMr
JIT  – 20080620_1845_r8
GC   – 200806_19
—————————————————————————
server_member1 (ManagedProcess) has pid 2507; state: STARTED; on Linux
Number of applications running on server_member1: 1
perfServletApp
—————————————————————-

Server server_member2 processtype: ManagedProcess
Server server_member2 state STARTED
Server server_member2 JVM details WebSphere:name=JVM,process=server_member2,platform=proxy,node=server1                                        _Node01,j2eeType=JVM,J2EEServer=server_member2,version=6.1.0.21,type=JVM,mbeanIdentifier=JVM,cell=server1_Cell,spec=1.0
———————————————————————————
Websphere Application Server server_member2 Java Env. Details:
———————————————————————————
Java Specification Name: Java Platform API Specification
Java Specification vendor Name: Sun Microsystems Inc.
Java Specification Version: 1.5
java.util.logging.manager : com.ibm.ws.bootstrap.WsLogManager
java.util.logging.configureByServer : true
java.util.prefs.PreferencesFactory : java.util.prefs.FileSystemPreferencesFactory
java.vendor : IBM Corporation
java.vendor.url : http://www.ibm.com/
java.version : 1.5.0
Java virtual machine info: J2RE 1.5.0 IBM J9 2.3 Linux amd64-64 j9vmxa6423ifx-20080811 (JIT enabled)
J9VM – 20080809_21892_LHdSMr
JIT  – 20080620_1845_r8
GC   – 200806_19
—————————————————————————
server_member2 (ManagedProcess) has pid 2705; state: STARTED; on Linux
Number of applications running on server_member2: 1
perfServletApp
—————————————————————-

Server nodeagent processtype: NodeAgent
Server nodeagent state STARTED
Server nodeagent JVM details WebSphere:name=JVM,process=nodeagent,platform=proxy,node=Machine1_Node01,j2eeTyp                                            e=JVM,J2EEServer=nodeagent,version=6.1.0.21,type=JVM,mbeanIdentifier=JVM,cell=Machine1_Cell,spec=1.0
———————————————————————————
Websphere Application Server nodeagent Java Env. Details:
———————————————————————————
Java Specification Name: Java Platform API Specification
Java Specification vendor Name: Sun Microsystems Inc.
Java Specification Version: 1.5
java.util.logging.manager : com.ibm.ws.bootstrap.WsLogManager
java.util.logging.configureByServer : true
java.util.prefs.PreferencesFactory : java.util.prefs.FileSystemPreferencesFactory
java.vendor : IBM Corporation
java.vendor.url : http://www.ibm.com/
java.version : 1.5.0
Java virtual machine info: J2RE 1.5.0 IBM J9 2.3 Linux amd64-64 j9vmxa6423ifx-20080811 (JIT enabled)
J9VM – 20080809_21892_LHdSMr
JIT  – 20080620_1845_r8
GC   – 200806_19
—————————————————————————
nodeagent (NodeAgent) has pid 2368; state: STARTED; on Linux
Number of applications running on nodeagent: 0
getdetails: — Done.
—————————————————————————————————

Actual JACL Script is as below

###############################################################################
#                                                                             #
#                                 getdetails.jacl                                #
#                  ———————————                          #
# Purpose:                                                                    #
#        This script is designed to get complete server status/             #
#             details and OS details                       #
#         just before deployemnt. Its designed to help in debugging          #
#            and simulating the same environment.                     #
#     Note:No arguments required for this script to run                       #
#                                                                             #
###############################################################################
#
#—————————————————
# Setting the User Script Location
#————————————————–
set ScriptLocation [java::call java.lang.System getProperty “script.dir”]
if { $ScriptLocation==”” } then {
set ScriptLocation [java::call java.lang.System getProperty “user.dir”]
}
set ScriptLocation “$ScriptLocation/”

puts “****************************************************************”
puts “–        GET ALL DEBUG DETAILS                 –”
puts “****************************************************************”
set datetime [clock format [clock seconds] -format {%b. %d, %Y %I:%M:%S %p}]
puts “server details on $datetime”
puts “Starting getDetails script …”
puts “———————————————————————-”
#—————————————————————-
# lines 4 and 5 find all the cell and process them one at a time
#—————————————————————-
set cells [$AdminConfig list Cell]
#puts “Echo : $cells”

foreach cell $cells {
#———————————————————————–
# lines 10 and 11 find all the nodes belonging to the cell and
# process them at a time
#———————————————————————–
#puts ” $cell”
set nodes [$AdminConfig list Node $cell]
#puts “echo $nodes”
foreach node $nodes {

#————————————————————–
# lines 16-20 find all the running servers belonging to the cell
# and node, and process them one at a time
#————————————————————–
set cname [$AdminConfig showAttribute $cell name]
#puts “cname : $cname”
set nname [$AdminConfig showAttribute $node name]
#puts “nname : $nname”
set servs [$AdminControl queryNames type=Server,cell=$cname,node=$nname,*]
#puts “servs = $servs”
puts “Number of running servers on node $nname: [llength $servs]”
foreach server $servs {
#———————————————————
# lines 25-31 get some attributes from the server to display;
# invoke an operation on the server JVM to display a property.
#———————————————————
set sname [$AdminControl getAttribute $server name]
set ptype [$AdminControl getAttribute $server processType]
puts “Server $sname processtype: $ptype ”
set pid [$AdminControl getAttribute $server pid]
set state [$AdminControl getAttribute $server state]
puts “Server $sname state $state”
set jvm [$AdminControl queryNames type=JVM,cell=$cname,node=$nname,process=$sname,*]
puts “Server $sname JVM details $jvm”
puts “———————————————————————————”
puts “Websphere Application Server $sname Java Env. Details: ”
puts “———————————————————————————”
set javaspecname [$AdminControl invoke $jvm getProperty java.specification.name]
puts ” Java Specification Name: $javaspecname ”
set javaspecvendorname [$AdminControl invoke $jvm getProperty java.specification.vendor]
puts “Java Specification vendor Name: $javaspecvendorname ”
set javaver [$AdminControl invoke $jvm getProperty java.specification.version]
puts “Java Specification Version: $javaver”
set javalogmanager [$AdminControl invoke $jvm getProperty java.util.logging.manager]
puts “java.util.logging.manager : $javalogmanager”
set javalogconfig [$AdminControl invoke $jvm getProperty java.util.logging.configureByServer]
puts ” java.util.logging.configureByServer : $javalogconfig”
set javautilpre [$AdminControl invoke $jvm getProperty java.util.prefs.PreferencesFactory]
puts “java.util.prefs.PreferencesFactory : $javautilpre”
set javavendor [$AdminControl invoke $jvm getProperty java.vendor]
puts “java.vendor : $javavendor”
set javavendorurl [$AdminControl invoke $jvm getProperty java.vendor.url]
puts “java.vendor.url : $javavendorurl ”
set javaversion [$AdminControl invoke $jvm getProperty java.version]
puts “java.version : $javaversion ”
set javavminfo [$AdminControl invoke $jvm getProperty java.vm.info]
puts “Java virtual machine info: $javavminfo”
set osname [$AdminControl invoke $jvm getProperty os.name]
#puts “Operating System found for $sname: $osname”
puts “—————————————————————————”
puts ” $sname ($ptype) has pid $pid; state: $state; on $osname”
#———————————————————
# line 37-42 find the applications running on this server and
# display the application name.
#———————————————————
set apps [$AdminControl queryNames type=Application,cell=$cname,node=$nname,process=$sname,*]
#puts “apps= $apps ”
puts ” Number of applications running on $sname: [llength $apps]”
foreach app $apps {
set aname [$AdminControl getAttribute $app name]
puts ” $aname”
puts “—————————————————————-”
puts “”
}
}
}
}
puts “getdetails: — Done.”
puts “—————————————————————————————————“

Websphere ND Install under Windows :Create DMGR, AppServer profile

Posted by Sagar Patil

Let’s start network deployment install, Click on the launchpad.exe

Next

Select none. Installation carries on…..

Uncheck the check box as shown in the following figure. And you will be able to create the deployment manager profile using Profile creation tool.

To open the profile creation tool from the command prompt

D:\Program Files\IBM\WebSphere\AppServer\bin\ProfileManagement/pmt


2. Go to program files and profile management tool as follows:

And create a deployment manager profile first.

Select advanced profile creation.

Select deploy administration console and click on next.

Specify profile name and directory and click on next.

Specify the node name, host name and the cell name and click on next.

The above figure depicts the following:

  • Node name you can change if you want.
  • Host name is the local host as you are using only one machine
  • Cell name you can change if you want
    Node name and cell name can be changed, but host name is the name of the system.

    Username: admin

    Password: admin

    Select start up type as manual.

    Click on create, the profile Dmgr01 is being created.

    Now only we are not launching the first step console.

    Click on finish.

    Now the deployment manager profile is created.

    To check the installation verification test manually.

    D:\Program Files\IBM\WebSphere\AppServer\profiles\Dmgr01\bin>ivt dmgr Dmgr01

    Now the profile Dmgr01 is created.

    See the options of the Dmgr01 profile.


    3. Now we are going to create the Application Server Profile. Click on the profile Management tool.Select Application Server.

    Select advance profile creation and click on next.

    Select the three checkboxes and click on next.

    Specify the profile name and directory and click on next.

    Specify the node name and the host name and click on next.

    We are not using security as of now.

    Specify the ports and click on next.

    Select “Run the application server process as a Windows service” and click on the next button.

    Do not create a web definition. Click on next.

    Click on create.

    We are not launching the first step console now.

    Now in the profiles you can check application server profile is also created.

    For the installation verification test at the command prompt
    D:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\bin>ivt server1 AppSrv01

    ivt server1 AppSrv01 -> server1 is the name of the server , and AppSrv01 is the name of the profile.

    The name of the server is present in this location:
    D:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\config\cells\localhostNode01Cell\nodes\localhostNode01\servers


    NowFirst start the deployment manager and then the admin console of Deployment Manager Profile.

    Go to program files -> Ibm websphere

    Now first start the deployment manager, then start the Administrative console.

    Click on System administration, node, add node.

    Select managed node.

    Remember now you are in the Deployment manager profile Administrative console.

    Now to add the node, you go to the profiles.

    Serverindex.xml file. Is present in the following location

    In the serverindex.xml file check for the SOAP_CONNECTOR ADDRESS ,

    Note: The port no in this case is 8880 and the ORB_LISTENER_ADDRESS, in this case is 9101

    Submit the following details as follows in the add node screen.

    Note: If the jmx connector type in the following figure is not SOAP AND you have selected RMI/IIOP then you have to use the ORB_LISTENER_ADDRESS port no.

    Note: now start the server and click on ok.

    After the server is started, then click on ok.

    Check on run node as windows service.

    Now the node is successfully added. You should log out and just login in again to see the new node

    The new node added is shown.


    To addNode from using the command prompt:Go to the command prompt,Application server/profiles/appsrv02/bin >addNode localhost 8879

    8879 is the SOAP PORT ADDRESS OF THE DEPLOYMENT MANAGER.

    To include applications use –includeapps

    Note: also note that in the bin directory of the Deployment Manager, there is no utility addNode.

Websphere ND Install: Install IBM HTTP Server

Posted by Sagar Patil

Go to application server profile and start the server. Start the deployment manager. Go to the administrative console and login.

Now go to the node agents, if the node agents are not started up. It is necessary to start up the node agents.

Manually go to the location of the node agents and use the startNode command.

This is the location:

Execute at the command prompt as follows:

The node agent has been started up.

The same procedure is also to be followed to start the node agent of the Appserver.

C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\bin\startnode

Here AppSrv01 is the server that we are using.

Now verify that the two nodes are started.


To install the webserver

Go to 6.0 base/HIS/INSTALL.

Click on next.

Select the directory where you want to install IBM HTTP Server 6.0 and click on the next button.

Select “Custom” and click on the next button.

Specify the HTTP port and the HTTP Administration Port and click on next.

Select the two checkboxes and click on next.

Uncheck the checkbox and click on finish.

Now the web server is installed.

Check in the program files.

Start the web server.

Go to services and start the IBM HTTP SERVICE.

Also in the browser check.

http://localhost

The web server console will open.


To install the plug-in software

Go to 6.0 base folder/ plugin/install

Accept the agreement and click on next.

Select IBM HTTP Server V6 and click on next.

Select “Websphere Application Server machine (local)” and click on next.

Specify the plug-ins installation directory and click next.

Select the location where you want the Websphere Application Server V6 to be installed and click on next after wards.

Select the httpconf file.


web-server plugin-cfg.xml file

C:\Program Files\IBM\WebSphere\AppServer\profiles\Custom01\config\cells\localhostCell01\nodes\localhostNode02\servers\webserver1\plugin-cfg.xml


Click on Finish


Now go to the web servers and create a new web server.

Fill the following details very carefully.

Check whether the application server and web server both are started.

After both web and application server are started, go to the enterprise applications and check the applications are started And then type

http://localhost/snoop in the browser and see the snoop servlet.

IBM Support Assistant: using Thread & Monitor dump analyzer

Posted by Sagar Patil

Click on file -> open & select local file

I can see JVM memory getting exhausted here

Scroll down to locate the memory distribution

Drill down to individual thread details is possible by  selecting “Analysis -> Thread Detail”

IBM Support Assistant: using Thread Analyzer

Posted by Sagar Patil

Start IBM Support Assistant &  choose ThreadAnalyzer

Here , we have number of of JavaCore and HeapDump files

Let’s pick up one of javacore file for further analysis

Once you hit Next it will invoke ThreadAnalyzer GUI



Select Analysis option menu to drill down relevant details

Websphere Diagnostics: Create & Analyze Trace Files

Posted by Sagar Patil

Read this as well

Navigate to DMGR -> Troubleshooting -> Logs and Trace ->

To enter a trace string to set the trace specification to the desired state:

  1. Click Troubleshooting > Logging and Tracing in the console navigation tree.
  2. Select a server name.
  3. Click Change Log Level Details.
  4. If All Components has been enabled, you might want to turn it off, and then enable specific components.
  5. Select Apply, then OK.

To know the exact location click on Runtime Tab and see the directory hosting trace.log file

I can see a trace.log at my directory now

Is my websphere configured in Development Mode?

Posted by Sagar Patil

WebSphere Portal has concept of Development mode for some time, basic idea is to improve the startup time of portal by delaying the startup of application. The application should be started when it is accessed for first time instead of starting it at the server startup time.

Following process will show you how to locate if websphere is configured to run under development mode

– Open a command prompt
– cd to the WAS_INSTALL_HOME\bin
– Start “wsadmin” using the following:

wsadmin -conntype none -lang jython
– Use the following wsadmin command to get the configuration ID for your server

server = AdminConfig.list( ‘Server’ ).splitlines()[ 0 ]
– Use the following command to display the server attributes:

print AdminConfig.show( server )
– Look for the following line:

[developmentMode false]
If your value is “true” then, this may be the reason WTE starts faster.

wsadmin>wsadmin>  server = AdminConfig.list( ‘Server’ ).splitlines()[ 0 ]
wsadmin>print AdminConfig.show( server );
[components “[(cells/server1_Cell/nodes/server1_Manager/servers/dmgr|server.xml#NameServer_1) “Deployment Manager(cells/server1_Cell/nodes/server1_Manager/servers/dmgr|server.xml#CellManager_1)” “WorkloadManagement Server(cells/server1_Cell/nodes/server1_Manager/servers/dmgr|server.xml#WorkloadManagementServer_1)” “Network Deployment Server(cells/server1_Cell/nodes/server1_Manager/servers/dmgr|server.xml#ApplicationServer_1)”]”]
[customServices []]
[developmentMode false]
[errorStreamRedirect (cells/server1_Cell/nodes/server1_Manager/servers/dmgr|server.xml#StreamRedirect_1)]
[name dmgr]

Trend Oracle log history : How much archives created per day/week or in an hour

Posted by Sagar Patil

Count of archive files and size of the redo generated by day

SELECT   A.*, ROUND (A.Count# * B.AVG# / 1024 / 1024) Daily_Avg_Mb
  FROM   (  SELECT   TO_CHAR (First_Time, 'YYYY-MM-DD') DAY,
                     COUNT (1) Count#,
                     MIN (RECID) Min#,
                     MAX (RECID) Max#
              FROM   v$log_history
          GROUP BY   TO_CHAR (First_Time, 'YYYY-MM-DD')
          ORDER BY   1 DESC) A, (SELECT   AVG (BYTES) AVG#,
                                          COUNT (1) Count#,
                                          MAX (BYTES) Max_Bytes,
                                          MIN (BYTES) Min_Bytes
                                   FROM   v$log) B;
DAY LOG COUNT DAILY_AVG_MB
02/07/2010 98 4480
01/07/2010 126 5760
30/06/2010 54 2469
29/06/2010 28 1280
28/06/2010 37 1691
27/06/2010 14 640
26/06/2010 14 640
25/06/2010 14 640
24/06/2010 19 869
23/06/2010 14 640

Copy this table into Excel & click on Chart Wizard. Select X,Y co-ordinates and you will get a nice picture like this

Count of archive files and size of the redo generated every hour

  SELECT   TO_CHAR (first_time, 'YYYY-MON-DD') day,
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '00', 1, 0)),
                    '99')
              "00",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '01', 1, 0)),
                    '99')
              "01",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '02', 1, 0)),
                    '99')
              "02",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '03', 1, 0)),
                    '99')
              "03",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '04', 1, 0)),
                    '99')
              "04",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '05', 1, 0)),
                    '99')
              "05",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '06', 1, 0)),
                    '99')
              "06",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '07', 1, 0)),
                    '99')
              "07",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '08', 1, 0)),
                    '99')
              "0",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '09', 1, 0)),
                    '99')
              "09",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '10', 1, 0)),
                    '99')
              "10",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '11', 1, 0)),
                    '99')
              "11",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '12', 1, 0)),
                    '99')
              "12",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '13', 1, 0)),
                    '99')
              "13",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '14', 1, 0)),
                    '99')
              "14",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '15', 1, 0)),
                    '99')
              "15",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '16', 1, 0)),
                    '99')
              "16",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '17', 1, 0)),
                    '99')
              "17",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '18', 1, 0)),
                    '99')
              "18",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '19', 1, 0)),
                    '99')
              "19",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '20', 1, 0)),
                    '99')
              "20",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '21', 1, 0)),
                    '99')
              "21",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '22', 1, 0)),
                    '99')
              "22",
           TO_CHAR (SUM (DECODE (TO_CHAR (first_time, 'HH24'), '23', 1, 0)),
                    '99')
              "23"
    FROM   v$log_history
GROUP BY   TO_CHAR (first_time, 'YYYY-MON-DD')
order by DAY desc;

Websphere: Using PerformanceMonitor Servlet to Monitor Performance Metric

Posted by Sagar Patil

The PerfServlet provides the performance data output as an XML document, The servlet provides a way to use an HTTP request to query the performance metrics for an entire WebSphere Application Server administrative domain.

First we need to deploy this servlet on (clustered) nodes  to be monitored before using it. The deployment is no way different than installing any EAR application file.

You can download and install PerfApp servlet from following links else visit IBM support portal
http://www.oracledbasupport.co.uk/wp-content/uploads/2010/09/perfServletApp.ear
http://www.oracledbasupport.co.uk/wp-content/uploads/2010/09/perfServletApp.war

http://%Server_name%:9080/wasPerfTool/servlet/perfservlet?module=beanModule+jvmRuntimeModule

Above URL will produce XML output file as  :http://www.oracledbasupport.co.uk/wp-content/uploads/2010/07/-1.xml

Locate perfServletApp.ear which is generally at installedApps directory under Profiles, goto deployment manager and install this ear file.

Access the performance matrix using URLs  below

Usage:

http://perfServlet_Host:port/wasPerfTool/servlet/perfservlet[?node=<node>&server=<server>&module=<module>]

The module name for which stats are displayed. Modules include the following:

  • alarmManagerModule
  • beanModule
  • cacheModule
  • connectionPoolModule
  • jvmRuntimeModule
  • j2cModule
  • objectPoolModule
  • orbPerfModule
  • schedulerModule
  • servletSessionsModule
  • systemModule
  • threadPoolModule
  • transactionModule
  • webAppModule
  • webServicesModule
  • wlmModule
  • wsgwModule

Node

The servlet can limit the information it provides to a specific host by using the node parameter.
http://Server1:9080/wasPerfTool/servlet/perfservlet?node=Server1_Node01

Server

The servlet can limit the information it provides to a specific server by using the server parameter.

For example, in order to limit the data collection to the server on all nodes, invoke the following URL:
http://Server1:9080/wasPerfTool/servlet/perfservlet?server=server_member1

To limit the data collection to the server invoke the following URL:
http://Server1:9080/wasPerfTool/servlet/perfservlet?node=Server1_Node01&server=server_member1

Module

The servlet can limit the information it provides to a specific PMI module by using the module parameter.
You can request multiple modules by using the following URL:
http://Server1:9080/wasPerfTool/servlet/perfservlet?module=beanModule+jvmRuntimeModule

For example, to limit the data collection to the beanModule on all servers and nodes, invoke the following URL:
http://Server1:9080/wasPerfTool/servlet/perfservlet?module=beanModule

To limit the data collection to the beanModule on the server ‘testserver’ on the node rjones, invoke the following URL:
http://Server1:9080/wasPerfTool/servlet/perfservlet?node=rjones&server=testserver&module=beanModule

To find the list of the modules, invoke the PerfServlet help with the following URL:
http://Server1:9080/wasPerfTool/servlet/perfservlet?action=help

http://Server1:9080/wasPerfTool/servlet/perfservlet?node=Server01_Node01&server=server_member1&module=jvmRuntimeModule


Top of Page

Top menu