Sorry, there have been no point earners to display.
|
|
Thursday, December 15, 2011, 12:13 AM
The wsadmin program is a scripting engine for performing administrative tasks on an application server or its configuration. It can execute individual commands as well as in interactive fashion , or it can execute script file. The way wsadmin program is executed is dependent on the Operating system being used. The examples below shows how wsadmin program is executed in Windows and Unix environment.The ./ before the name of the file to be executed on a Unix environment is an indication that the specified file is located in the current directory. • AIX —wsadmin.sh • Linux —wsadmin.sh • z/OS —wsadmin.sh • Windows —wsadmin are options specified by user and are optional. Where is wsadmin located :- In case of standalone application server, wsadmin is located at WAS_HOME /bin directory. In ND application server, wsadmin.sh is located both at WAS_HOME/bin and also at WAS_PROFILE_HOME/bin WAS_HOME is location where base binaries are installed . WAS_PROFILE_HOME is location where profile is created. Launching of wsadmin :- Here I will be explaining and showing launching of wsadmin in ND environment on Unix Operating System.Basically in ND environment, best practice is to launch wsadmin from Deployment profile.We can launch wsadmin from /bin or from Node profile also, but it is almost always launched from Deployment profile only. The way we launch wsadmin also depends upon whether Websphere have security turned on or not. 1. If Global security is not turned on, it is launched just by executing ./wsadmin.sh command as shown below in screenshot. 2. If Global security is turned on, then we will have to pass user name and password to connect to wsadmin program and options we need to pass is described below and shown below in screenshot. ./wsadmin.sh -user -password 3. If Global security is turned on and we don't want to pass user and password every time we execute wsadmin.So, for that , we need to update 3 properties in soap.client.props located at /properties, below are the properties which we need to update. 1. Update "com.ibm.SOAP.securityEnabled" to value as true. 2. Update "com.ibm.SOAP.loginUserid" with websphere admin user. 3. Update "com.ibm.SOAP.loginPassword" with websphere admin password. You don't have to bounce Deployment manager to have this take affect,you can do this on the fly , whether you want to enable this functionality or disable this functionality after enabling. Below screenshot shows the location of soap.client.props Below it shows the properties with updated values Below screenshot shows, after updating this we don't have to pass user name and password with we are executing wsadmin , with global security on in websphere. This concludes the first part of wsadmin,Second part to follow soon. Keep yours eyes open and check the blog with other updates also. Please comment and let me know where do I need to improve when I am explaining as I want to explain everything in as easy way as it can be and if you like this port it then please share it on facebook or twitter.
Thursday, December 8, 2011, 4:29 PM
Best Blog to learn WebSphere Scripting and also get training if needed. websphere-automation.blogspot.com/2011/0...
Tuesday, December 6, 2011, 8:37 AM
Sunday, November 13, 2011, 8:40 PM
import sys,java from java.util import Properties from java.io import FileInputStream from org.python.modules import time lineSep = java.lang.System.getProperty('line.separator')
def QF(node,qmanager,jndiname,queue_name,target,name):
# Declare global variables
global AdminConfig global AdminControl
# Gets the name of cell
cell = AdminControl.getCell()
cellid = AdminConfig.getid('/Cell:'+ cell +'/')
print " ----------------------------------------------------------------------------------------- "
#------QueueConnectionFactory--------#
MS=AdminConfig.getid('/Cell:'+ cell +'/Node:'+ node +'/JMSProvider:WebSphere MQ JMS Provider/')
QD=AdminConfig.getid('/Cell:'+ cell +'/Node:'+ node +'/JMSProvider:WebSphere MQ JMS Provider/MQQueue:'+ name +'/')
if len(QD) == 0 : print "Queue does not exists .... " else : print "Queue exists, so removing old Queue ... " AdminConfig.remove(QD) print "Queue removed .. "
print "Creating Queue Destination .. "
name1 = ["name" , name]
jndi = ["jndiName" , jndiname ]
qm = ["baseQueueManagerName", qmanager ]
queue = ["baseQueueName", queue_name ]
target = ["targetClient", target ]
qd_attr = [name1 , jndi , qm , queue , target ]
newqf = AdminConfig.create('MQQueue' , MS , qd_attr)
print "Queue Destination created .. "
AdminConfig.save()
print " Saving Configuraion "
print " ----------------------------------------------------------------------------------------- "
#--------------------------------------------------------------#
## Full Syncronization ##
print " Syncronizing configuration with Master Repository "
nodelist = AdminTask.listManagedNodes().split(lineSep)
for nodename in nodelist :
print " syncronizing nodes .......... "
####################Identifying the ConfigRepository MBean and assign it to variable######################
repo = AdminControl.completeObjectName('type=ConfigRepository,process=nodeagent,node='+ nodename +',*')
AdminControl.invoke(repo, 'refreshRepositoryEpoch')
sync = AdminControl.completeObjectName('cell='+ cell +',node='+ nodename +',type=NodeSync,*')
print AdminControl.invoke(sync , 'sync')
print " ----------------------------------------------------------------------------------------- "
print " ----------------------------------------------------------------------------------------- "
####################################################################################################################
#main program starts here
node = sys.argv[0] target = sys.argv[1] jndiname = sys.argv[2] queue_name = sys.argv[3] name=sys.argv[4] qmanager = sys.argv[5]
QF(node,qmanager,jndiname,queue_name,target,name)
Sunday, November 13, 2011, 8:40 PM
import sys,java from java.util import Properties from java.io import FileInputStream from org.python.modules import time lineSep = java.lang.System.getProperty('line.separator')
def QF(node,timeOut,maxConn,minConn,reapTime,unusdTimeout,agedTimeout,StimeOut,SmaxConn,SminConn,SreapTime,SunusdTimeout,SagedTimeout,name,jndiname,xa,fail,auth_name,msg,pool,qmanager,rescan,tptype,connpool,purge,Spurge,mapping):
# Declare global variables
global AdminConfig global AdminControl
# Gets the name of cell
cell = AdminControl.getCell()
cellid = AdminConfig.getid('/Cell:'+ cell +'/')
print " ----------------------------------------------------------------------------------------- "
#------QueueConnectionFactory--------#
MS=AdminConfig.getid('/Cell:'+ cell +'/Node:'+ node +'/JMSProvider:WebSphere MQ JMS Provider/')
QF=AdminConfig.getid('/Cell:'+ cell +'/Node:'+ node +'/JMSProvider:WebSphere MQ JMS Provider/MQQueueConnectionFactory:'+ name +'/')
if len(QF) == 0 : print "QueueConnectionFactory does not exists .... " else : print "QueueConnectionFactory exists, so removing old QueueConnectionFactory ... " AdminConfig.remove(QF) print "QueueConnectionFactory removed .. "
print "Creating QueueConnectionFactory .. "
name1 = ["name" , name]
jndi = ["jndiName" , jndiname ]
XA = ["XAEnabled", xa ]
fail = ["failIfQuiesce", fail ]
auth = ["authMechanismPreference", auth_name]
msgreten = ["msgRetention", msg]
pool_int = ["pollingInterval", pool ]
qm = ["queueManager", qmanager ]
rscan = ["rescanInterval", rescan ]
tp = ["transportType", tptype]
map_configalias_attr = ["mappingConfigAlias", mapping]
map_attrs=[map_configalias_attr]
mapping_attr=["mapping", map_attrs]
conn = ["useConnectionPooling", connpool]
timeout = ["connectionTimeout" , timeOut]
maxconn = ["maxConnections" , maxConn]
minconn = ["minConnections" , minConn]
reaptime = ["reapTime" , reapTime]
unusedtimeout = ["unusedTimeout" , unusdTimeout]
agedtimeout = ["agedTimeout" , agedTimeout]
purgepolicy = ["purgePolicy" , purge]
connPoolAttrs = [timeout , maxconn , minconn , reaptime , unusedtimeout , agedtimeout , purgepolicy]
conn_pool = ["connectionPool", connPoolAttrs ]
Stimeout = ["connectionTimeout" , StimeOut]
Smaxconn = ["maxConnections" , SmaxConn]
Sminconn = ["minConnections" , SminConn]
Sreaptime = ["reapTime" , SreapTime]
Sunusedtimeout = ["unusedTimeout" , SunusdTimeout]
Sagedtimeout = ["agedTimeout" , SagedTimeout]
Spurgepolicy = ["purgePolicy" , Spurge]
sessPoolAttrs = [Stimeout , Smaxconn , Sminconn , Sreaptime , Sunusedtimeout , Sagedtimeout , Spurgepolicy]
sess_pool = ["sessionPool", sessPoolAttrs ]
qf_attr = [name1 , jndi , XA , fail , auth , mapping_attr ,msgreten ,pool_int , qm, rscan , tp , conn , conn_pool, sess_pool]
newqf = AdminConfig.create('MQQueueConnectionFactory' , MS , qf_attr)
print "QueueConnectionFactory created .. "
AdminConfig.save()
print " Saving Configuraion "
print " ----------------------------------------------------------------------------------------- "
#--------------------------------------------------------------#
## Full Syncronization ##
print " Syncronizing configuration with Master Repository "
nodelist = AdminTask.listManagedNodes().split(lineSep)
for nodename in nodelist :
print " syncronizing nodes .......... "
####################Identifying the ConfigRepository MBean and assign it to variable######################
repo = AdminControl.completeObjectName('type=ConfigRepository,process=nodeagent,node='+ nodename +',*')
AdminControl.invoke(repo, 'refreshRepositoryEpoch')
sync = AdminControl.completeObjectName('cell='+ cell +',node='+ nodename +',type=NodeSync,*')
print AdminControl.invoke(sync , 'sync')
print " ----------------------------------------------------------------------------------------- "
print " ----------------------------------------------------------------------------------------- "
####################################################################################################################
#main program starts here
arglen=len(sys.argv)
num_exp_args=3
if (arglen != num_exp_args):
print "Three arguments are required.one of them is property file"
print " ----------------------------------------------------------------------------------------- "
sys.exit(-1)
propFile=sys.argv[0]
properties=Properties();
try:
properties.load(FileInputStream(propFile))
print " ----------------------------------------------------------------------------------------- "
print "Succesfully read property file "+propFile
print " ----------------------------------------------------------------------------------------- "
except:
print "Cannot read property file "+propFile sys.exit(-1)
print " ----------------------------------------------------------------------------------------- "
node = sys.argv[1] timeOut = int(properties.getProperty("Connection_timeout")) maxConn = int(properties.getProperty("Maximum_connections")) minConn = int(properties.getProperty("Minimum_connections")) reapTime = int(properties.getProperty("Reap_time")) unusdTimeout = int(properties.getProperty("Unused_timeout")) agedTimeout = int(properties.getProperty("Aged_timeout")) StimeOut = int(properties.getProperty("SConnection_timeout")) SmaxConn = int(properties.getProperty("SMaximum_connections")) SminConn = int(properties.getProperty("SMinimum_connections")) SreapTime = int(properties.getProperty("SReap_time")) SunusdTimeout = int(properties.getProperty("SUnused_timeout")) SagedTimeout = int(properties.getProperty("SAged_timeout")) name = str(properties.getProperty("Name")) jndiname = str(properties.getProperty("Jndi_Name")) xa = str(properties.getProperty("XAEnabled")) fail = str(properties.getProperty("Enable-return-methods-during-shutdown")) auth_name = str(properties.getProperty("authMechanismPreference")) msg = str(properties.getProperty("Msg-Retention")) pool = str(properties.getProperty("Polling-Interval")) qmanager = sys.argv[2] rescan = str(properties.getProperty("Rescan-Interval")) tptype = str(properties.getProperty("TransportType")) connpool = str(properties.getProperty("useConnectionPooling")) purge = str(properties.getProperty("Purge_policy")) Spurge = str(properties.getProperty("SPurge_policy")) mapping = str(properties.getProperty("Mapping-configuration-alias"))
QF(node,timeOut,maxConn,minConn,reapTime,unusdTimeout,agedTimeout,StimeOut,SmaxConn,SminConn,SreapTime,SunusdTimeout,SagedTimeout,name,jndiname,xa,fail,auth_name,msg,pool,qmanager,rescan,tptype,connpool,purge,Spurge,mapping)
Sunday, November 13, 2011, 8:38 PM
import sys,java from java.util import Properties from java.io import FileInputStream from org.python.modules import time lineSep = java.lang.System.getProperty('line.separator')
def QF(cluster,timeOut,maxConn,minConn,reapTime,unusdTimeout,agedTimeout,StimeOut,SmaxConn,SminConn,SreapTime,SunusdTimeout,SagedTimeout,name,jndiname,xa,fail,auth_name,msg,pool,qmanager,rescan,tptype,connpool,purge,Spurge,mapping):
# Declare global variables
global AdminConfig global AdminControl
# Gets the name of cell
cell = AdminControl.getCell()
cellid = AdminConfig.getid('/Cell:'+ cell +'/')
print " ----------------------------------------------------------------------------------------- "
Serverid = AdminConfig.getid('/Cell:'+ cell +'/ServerCluster:'+ cluster +'/')
#------QueueConnectionFactory--------#
MS=AdminConfig.getid('/ServerCluster:'+ cluster +'/JMSProvider:WebSphere MQ JMS Provider/')
QF=AdminConfig.getid('/ServerCluster:'+ cluster +'/JMSProvider:WebSphere MQ JMS Provider/MQQueueConnectionFactory:'+ name +'/')
if len(QF) == 0 : print "QueueConnectionFactory does not exists .... " else : print "QueueConnectionFactory exists, so removing old QueueConnectionFactory ... " AdminConfig.remove(QF) print "QueueConnectionFactory removed .. "
print "Creating QueueConnectionFactory .. "
name1 = ["name" , name]
jndi = ["jndiName" , jndiname ]
XA = ["XAEnabled", xa ]
fail = ["failIfQuiesce", fail ]
auth = ["authMechanismPreference", auth_name]
msgreten = ["msgRetention", msg]
pool_int = ["pollingInterval", pool ]
qm = ["queueManager", qmanager ]
rscan = ["rescanInterval", rescan ]
tp = ["transportType", tptype]
map_configalias_attr = ["mappingConfigAlias", mapping]
map_attrs=[map_configalias_attr]
mapping_attr=["mapping", map_attrs]
conn = ["useConnectionPooling", connpool]
timeout = ["connectionTimeout" , timeOut]
maxconn = ["maxConnections" , maxConn]
minconn = ["minConnections" , minConn]
reaptime = ["reapTime" , reapTime]
unusedtimeout = ["unusedTimeout" , unusdTimeout]
agedtimeout = ["agedTimeout" , agedTimeout]
purgepolicy = ["purgePolicy" , purge]
connPoolAttrs = [timeout , maxconn , minconn , reaptime , unusedtimeout , agedtimeout , purgepolicy]
conn_pool = ["connectionPool", connPoolAttrs ]
Stimeout = ["connectionTimeout" , StimeOut]
Smaxconn = ["maxConnections" , SmaxConn]
Sminconn = ["minConnections" , SminConn]
Sreaptime = ["reapTime" , SreapTime]
Sunusedtimeout = ["unusedTimeout" , SunusdTimeout]
Sagedtimeout = ["agedTimeout" , SagedTimeout]
Spurgepolicy = ["purgePolicy" , Spurge]
sessPoolAttrs = [Stimeout , Smaxconn , Sminconn , Sreaptime , Sunusedtimeout , Sagedtimeout , Spurgepolicy]
sess_pool = ["sessionPool", sessPoolAttrs ]
qf_attr = [name1 , jndi , XA , fail , auth , mapping_attr ,msgreten ,pool_int , qm, rscan , tp , conn , conn_pool, sess_pool]
newqf = AdminConfig.create('MQQueueConnectionFactory' , MS , qf_attr)
print "QueueConnectionFactory created .. "
AdminConfig.save()
print " Saving Configuraion "
print " ----------------------------------------------------------------------------------------- "
#--------------------------------------------------------------#
## Full Syncronization ##
print " Syncronizing configuration with Master Repository "
nodelist = AdminTask.listManagedNodes().split(lineSep)
for nodename in nodelist :
print " syncronizing nodes .......... "
####################Identifying the ConfigRepository MBean and assign it to variable######################
repo = AdminControl.completeObjectName('type=ConfigRepository,process=nodeagent,node='+ nodename +',*')
AdminControl.invoke(repo, 'refreshRepositoryEpoch')
sync = AdminControl.completeObjectName('cell='+ cell +',node='+ nodename +',type=NodeSync,*')
print AdminControl.invoke(sync , 'sync')
print " ----------------------------------------------------------------------------------------- "
print " ----------------------------------------------------------------------------------------- "
####################################################################################################################
#main program starts here
arglen=len(sys.argv)
num_exp_args=3
if (arglen != num_exp_args):
print "Three arguments are required.one of them is property file"
print " ----------------------------------------------------------------------------------------- "
sys.exit(-1)
propFile=sys.argv[0]
properties=Properties();
try:
properties.load(FileInputStream(propFile))
print " ----------------------------------------------------------------------------------------- "
print "Succesfully read property file "+propFile
print " ----------------------------------------------------------------------------------------- "
except:
print "Cannot read property file "+propFile sys.exit(-1)
print " ----------------------------------------------------------------------------------------- "
cluster = sys.argv[1] timeOut = int(properties.getProperty("Connection_timeout")) maxConn = int(properties.getProperty("Maximum_connections")) minConn = int(properties.getProperty("Minimum_connections")) reapTime = int(properties.getProperty("Reap_time")) unusdTimeout = int(properties.getProperty("Unused_timeout")) agedTimeout = int(properties.getProperty("Aged_timeout")) StimeOut = int(properties.getProperty("SConnection_timeout")) SmaxConn = int(properties.getProperty("SMaximum_connections")) SminConn = int(properties.getProperty("SMinimum_connections")) SreapTime = int(properties.getProperty("SReap_time")) SunusdTimeout = int(properties.getProperty("SUnused_timeout")) SagedTimeout = int(properties.getProperty("SAged_timeout")) name = str(properties.getProperty("Name")) jndiname = str(properties.getProperty("Jndi_Name")) xa = str(properties.getProperty("XAEnabled")) fail = str(properties.getProperty("Enable-return-methods-during-shutdown")) auth_name = str(properties.getProperty("authMechanismPreference")) msg = str(properties.getProperty("Msg-Retention")) pool = str(properties.getProperty("Polling-Interval")) qmanager = sys.argv[2] rescan = str(properties.getProperty("Rescan-Interval")) tptype = str(properties.getProperty("TransportType")) connpool = str(properties.getProperty("useConnectionPooling")) purge = str(properties.getProperty("Purge_policy")) Spurge = str(properties.getProperty("SPurge_policy")) mapping = str(properties.getProperty("Mapping-configuration-alias"))
QF(cluster,timeOut,maxConn,minConn,reapTime,unusdTimeout,agedTimeout,StimeOut,SmaxConn,SminConn,SreapTime,SunusdTimeout,SagedTimeout,name,jndiname,xa,fail,auth_name,msg,pool,qmanager,rescan,tptype,connpool,purge,Spurge,mapping)
Sunday, November 13, 2011, 8:37 PM
import sys,java from java.util import Properties from java.io import FileInputStream from org.python.modules import time lineSep = java.lang.System.getProperty('line.separator')
def QF(cluster,qmanager,jndiname,queue_name,target,name):
# Declare global variables
global AdminConfig global AdminControl
# Gets the name of cell
cell = AdminControl.getCell()
cellid = AdminConfig.getid('/Cell:'+ cell +'/')
print " ----------------------------------------------------------------------------------------- "
Serverid = AdminConfig.getid('/Cell:'+ cell +'/ServerCluster:'+ cluster +'/')
#------QueueConnectionFactory--------#
MS=AdminConfig.getid('/ServerCluster:'+ cluster +'/JMSProvider:WebSphere MQ JMS Provider/')
QD=AdminConfig.getid('/ServerCluster:'+ cluster +'/JMSProvider:WebSphere MQ JMS Provider/MQQueue:'+ name +'/')
if len(QD) == 0 : print "Queue does not exists .... " else : print "Queue exists, so removing old Queue ... " AdminConfig.remove(QD) print "Queue removed .. "
print "Creating Queue Destination .. "
name1 = ["name" , name]
jndi = ["jndiName" , jndiname ]
qm = ["baseQueueManagerName", qmanager ]
queue = ["baseQueueName", queue_name ]
target = ["targetClient", target ]
qd_attr = [name1 , jndi , qm , queue , target ]
newqf = AdminConfig.create('MQQueue' , MS , qd_attr)
print "Queue Destination created .. "
AdminConfig.save()
print " Saving Configuraion "
print " ----------------------------------------------------------------------------------------- "
#--------------------------------------------------------------#
## Full Syncronization ##
print " Syncronizing configuration with Master Repository "
nodelist = AdminTask.listManagedNodes().split(lineSep)
for nodename in nodelist :
print " syncronizing nodes .......... "
####################Identifying the ConfigRepository MBean and assign it to variable######################
repo = AdminControl.completeObjectName('type=ConfigRepository,process=nodeagent,node='+ nodename +',*')
AdminControl.invoke(repo, 'refreshRepositoryEpoch')
sync = AdminControl.completeObjectName('cell='+ cell +',node='+ nodename +',type=NodeSync,*')
print AdminControl.invoke(sync , 'sync')
print " ----------------------------------------------------------------------------------------- "
print " ----------------------------------------------------------------------------------------- "
####################################################################################################################
#main program starts here
cluster = sys.argv[0] target = sys.argv[1] jndiname = sys.argv[2] queue_name = sys.argv[3] name=sys.argv[4] qmanager = sys.argv[5]
QF(cluster,qmanager,jndiname,queue_name,target,name)
Saturday, November 12, 2011, 5:01 PM
The hang detection option for WebSphere Application Server is turned on by default. You can configure a hang detection policy to accommodate your applications and environment so that potential hangs can be reported, providing earlier detection of failing servers. When a hung thread is detected, WebSphere Application Server notifies you so that you can troubleshoot the problem Click on below link for more information . websphere-automation.blogspot.com/2009/1...
Saturday, November 12, 2011, 4:59 PM
In computer networking, DMZ is a firewall configuration for securing local area networks (LANs). In a DMZ configuration, most computers on the LAN run behind a firewall connected to a public network like the Internet. One or more computers also run outside the firewall, in the DMZ. Those computers on the outside intercept traffic and broker requests for the rest of the LAN, adding an extra layer of protection for computers behind the firewall. More info on DMZ below websphere-automation.blogspot.com/2009/1...
Saturday, November 12, 2011, 4:58 PM
1. IBM HTTP Server is a full function HTTP server that using WAS plugin can efficiently load balance traffic to one or more application servers in a cluster. It is a critical component of high availability architecture. It also allows one to deploy static content on web servers and reduce load from application servers. 2. From security point of view, you can deploy HTTP servers in the DMZ thus keeping application servers behind firewalls. 3. Default port HTTP is 80. On many operating systems you have to be root (administrator) to be able to bind to this port. In case of application server you will have to run the application server as root. This is not always desirable as you do not want application code running with root permissions
|


-
WebSphere Administrator
CSC
-
Director
Nucleus Technologies
-
-
-
Senior Systems Engineer
Mutual of Omaha
-
December 15, 2011 12:13 AM
charanjeet
Alpharetta
The wsadmin program is a scripting engine for ... more
|
|