<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4437168944596942363</id><updated>2012-01-09T11:43:39.451-08:00</updated><title type='text'>wsadminlib.py</title><subtitle type='html'>hints and tips for using the wsadminlib.py package from IBM developerWorks</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://wsadminlib.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-9076881211528608734</id><published>2012-01-07T08:53:00.000-08:00</published><updated>2012-01-09T11:43:39.465-08:00</updated><title type='text'>Fix for bug in method createUsingTemplate()</title><content type='html'>&lt;br /&gt;Here is a fix for a recently-discovered problem which has been hiding in wsadminlib for a long time. &lt;br /&gt;&lt;br /&gt;Method createUsingTemplate() calls helper method _create() and passes-in a template. &amp;nbsp;When the template parameter is non-null, _create() calls AdminConfig.create() with the additional template parameter. &amp;nbsp;This doesn't work. &amp;nbsp;It should be calling AdminConfig.createUsingTemplate().&lt;br /&gt;&lt;br /&gt;To fix it, edit your copy of wsadminlib, go to helper method _create() and find the section 'if template' (around line 8676, depending on your version). &amp;nbsp;Change AdminConfig.create() to AdminConfig.createUsingTemplate(). &amp;nbsp;It should look like this:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if template:&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sop(m, 'AdminConfig.create(%s, %s, %s, %s)' % (repr(type), repr(parent), repr(attrs), repr(template)))&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; object=AdminConfig.&lt;b&gt;createUsingTemplate&lt;/b&gt;(type, parent, attrs, template)&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Many thanks to Yun-Shian Jiang in Canada who reported the problem, debugged it, and suggested the correct fix.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-9076881211528608734?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/9076881211528608734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/9076881211528608734'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2012/01/fix-for-bug-in-method.html' title='Fix for bug in method createUsingTemplate()'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-7668094228296941493</id><published>2011-06-27T10:43:00.000-07:00</published><updated>2011-06-27T10:43:57.588-07:00</updated><title type='text'>Saving large EAR files</title><content type='html'>Things have been quiet here at 'wsadminlib central' lately, since many contributors have been focused on getting WAS V8 out the door. &amp;nbsp;Now that WAS V8 has shipped, here is a brief update...&lt;br /&gt;&lt;br /&gt;Frequent wsadminlib contributor Chris in Australia reported a problem saving a large EAR file, on the order of 300 Mb. &amp;nbsp;He had trouble starting the application immediately after doing a save and sync. &amp;nbsp;He also observed that the file system was still growing for a short time after the sync. &lt;br /&gt;&lt;br /&gt;Now I always thought that an application was fully deployed and ready to start when wsadminlib's method saveAndSync() returned, but not true...&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After some experimenting and research, we learned that WAS continues to expand the EAR file into specific directories &lt;u&gt;after&lt;/u&gt; the sync is complete. &amp;nbsp;And we also learned a way to query when it is done.&lt;br /&gt;&lt;br /&gt;AdminApp.isAppReady() will report whether an EAR is fully expanded and ready to start.&lt;br /&gt;&lt;br /&gt;The following helper method encapsulates the call to AdminApp. &amp;nbsp;This method returns a boolean value (0 or 1) which is easy for your code to test, whereas the underlying method returns a string 'true'. &amp;nbsp;This method may be added to your copy of wsadminlib.py or used in your own scripts.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;def isApplicationReady(appname):&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; """Returns True when app deployment is complete and ready to start.&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Returns False when the app is not ready or is not recognized.&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;This method indicates when background processing is complete&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;following an install, save, and sync. &amp;nbsp;&amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;This method is useful when installing really large EARs."""&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; m = "isApplicationReady:"&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; rc = False&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; try:&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if 'true' == AdminApp.isAppReady(appname):&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sop(m,"App %s is READY. Returning True." % (appname))&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rc = True&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else:&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sop(m,"App %s is NOT ready. Returning False." % (appname))&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; except:&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sop(m,"App %s is UNKNOWN. Returning False." % (appname))&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; return rc&lt;/i&gt;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;If you find this useful, we will include it in the next version of wsadminlib.py. &amp;nbsp;We can also include a method which waits until the app is ready (up to a timeout value). &amp;nbsp;Please let us know.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-7668094228296941493?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/7668094228296941493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/7668094228296941493'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2011/06/saving-large-ear-files.html' title='Saving large EAR files'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-3616663109946826614</id><published>2011-06-26T20:07:00.000-07:00</published><updated>2011-06-27T10:40:59.626-07:00</updated><title type='text'>WAS V8 and wsadminlib.py</title><content type='html'>The IBM WebSphere Application Server version 8.0 was released a few weeks ago, and wsadminlib helped deliver it. &amp;nbsp;Wsadminlib was used internally within IBM as part of many automated testcases. &amp;nbsp;This included the original prototypes, all the betas, and the final verifications. &lt;br /&gt;&lt;br /&gt;So as you move forward migrating from prior versions of WAS to V8, you may continue using wsadminlib knowing it performed yeoman's service throughout the latest release's development and delivery.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-3616663109946826614?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/3616663109946826614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/3616663109946826614'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2011/06/was-v8-and-wsadminlibpy.html' title='WAS V8 and wsadminlib.py'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-126532166942191783</id><published>2011-04-18T09:32:00.000-07:00</published><updated>2011-04-18T09:32:39.627-07:00</updated><title type='text'>How to enable memory-to-memory session replication for an existing server?</title><content type='html'>I received this interesting question last week from a wsadminlib user in Chicago. &amp;nbsp; Wsadminlib.py contains two methods which make the task easy: &amp;nbsp;&lt;b&gt;createReplicationDomain()&lt;/b&gt; and &lt;b&gt;setServerSessionReplication()&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;First, I connected my wsadmin client to the deployment manager and execfile'd wsadminlib.py:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;root@ding6:/home/ding/tmp# /opt/WAS70/profiles/v7default/bin/wsadmin.sh -lang jython -host zwasxxxx.raleigh.ibm.com -port 8879 -user xxxxxx -password xxxxxx&lt;/i&gt;&lt;br /&gt;&lt;i&gt;WASX7209I: Connected to process "dmgr" on node WAS00Manager using SOAP connector; &amp;nbsp;The type of process is: DeploymentManager&lt;/i&gt;&lt;br /&gt;&lt;i&gt;WASX7031I: For help, enter: "print Help.help()"&lt;/i&gt;&lt;br /&gt;&lt;i&gt;wsadmin&amp;gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;wsadmin&amp;gt;execfile('wsadminlib.py')&lt;/i&gt;&lt;br /&gt;&lt;i&gt;$Id: wsadminlib.py 104 2010-02-15 19:06:18Z ding $&lt;/i&gt;&lt;br /&gt;&lt;i&gt;wsadmin&amp;gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Next I issued the createReplicationDomain() command and saved it:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;wsadmin&amp;gt;domainName = "andyDomain"&lt;/i&gt;&lt;br /&gt;&lt;i&gt;wsadmin&amp;gt;numReplicas = -1&lt;/i&gt;&lt;br /&gt;&lt;i&gt;wsadmin&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;wsadmin&amp;gt;createReplicationDomain( domainName, numReplicas )&lt;/i&gt;&lt;br /&gt;&lt;i&gt;wsadmin&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;wsadmin&amp;gt;save()&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Browsing to the admin console confirms the domain was created: Environment-&amp;gt; Replication Domains&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Bzz17bCHreY/TaxhvnoEjVI/AAAAAAAAJPE/ugFG54t6fNk/s1600/wsadminlib.drs01.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="177" src="http://2.bp.blogspot.com/-Bzz17bCHreY/TaxhvnoEjVI/AAAAAAAAJPE/ugFG54t6fNk/s400/wsadminlib.drs01.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Clicking one step further shows the number of replicas is set to 'Entire Domain', which corresponds to -1 in the wsadminlib.py command.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-aHEhQdJuZno/Taxm3lewwjI/AAAAAAAAJPI/SJl-mAUY9-o/s1600/wsadminlib.drs01b.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="145" src="http://3.bp.blogspot.com/-aHEhQdJuZno/Taxm3lewwjI/AAAAAAAAJPI/SJl-mAUY9-o/s320/wsadminlib.drs01b.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Then I issued the setServerSessionReplication() command to enable replication on the application server using the just-created domain, and saved it too.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;wsadmin&amp;gt;nodeName = "ndnode1"&lt;/i&gt;&lt;br /&gt;&lt;i&gt;wsadmin&amp;gt;serverName = "server1"&lt;/i&gt;&lt;br /&gt;&lt;i&gt;wsadmin&amp;gt;domainName = "andyDomain"&lt;/i&gt;&lt;br /&gt;&lt;i&gt;wsadmin&amp;gt;dataReplicationMode = "BOTH"&lt;/i&gt;&lt;br /&gt;&lt;i&gt;wsadmin&amp;gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;wsadmin&amp;gt;setServerSessionReplication( nodeName, serverName, domainName, dataReplicationMode )&lt;/i&gt;&lt;br /&gt;&lt;i&gt;wsadmin&amp;gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;wsadmin&amp;gt;save()&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Finally, browsing to the admin console once again confirms that the server has memory-to-memory replication enabled: Servers-&amp;gt; server1-&amp;gt; Session Management-&amp;gt; Distributed Environment Settings&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-UCb1PFIIWaw/TaxhuPW-aZI/AAAAAAAAJPA/fuiYNRac49Y/s1600/wsadminlib.drs02.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="227" src="http://4.bp.blogspot.com/-UCb1PFIIWaw/TaxhuPW-aZI/AAAAAAAAJPA/fuiYNRac49Y/s400/wsadminlib.drs02.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;And clicking one step further shows the selected domain name (ie, andyDomain) and replication mode (ie, both client and server):&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-Cov_K9JFFII/TaxhZgreowI/AAAAAAAAJO4/h-9D_9g0nwg/s1600/wsadminlib.drs03.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="210" src="http://4.bp.blogspot.com/-Cov_K9JFFII/TaxhZgreowI/AAAAAAAAJO4/h-9D_9g0nwg/s400/wsadminlib.drs03.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Wsadminlib.py also contains methods which create clusters with replication enabled. &amp;nbsp;I have used those methods in years past. &amp;nbsp;This question was interesting to me because I can't remember ever enabling replication for existing servers.&lt;br /&gt;&lt;br /&gt;For more information about configuring replication, please browse wsadminlib.py itself. &amp;nbsp;Search for the word 'replication' to discover several special-purpose and general-purpose methods. &amp;nbsp;Read the prologues of each method. &amp;nbsp;They usually give a good description of the acceptable parameters.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-126532166942191783?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/126532166942191783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/126532166942191783'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2011/04/how-to-enable-memory-to-memory-session.html' title='How to enable memory-to-memory session replication for an existing server?'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-Bzz17bCHreY/TaxhvnoEjVI/AAAAAAAAJPE/ugFG54t6fNk/s72-c/wsadminlib.drs01.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-5264818308416467772</id><published>2011-02-01T05:43:00.000-08:00</published><updated>2011-09-21T05:50:10.582-07:00</updated><title type='text'>Presentation on wsadminlib.py</title><content type='html'>I gave a presentation introducing wsadminlib.py to the WebSphere User Group meeting in Research Triangle Park, NC last week. &amp;nbsp;You can fetch a PDF copy &lt;strike&gt;from the WebSphere User Group site. &amp;nbsp;[&lt;a href="http://www.websphereusergroup.org/triangle/go/document/view/26489"&gt;here&lt;/a&gt;]&lt;/strike&gt;&amp;nbsp;from &lt;b&gt;&lt;a href="https://sites.google.com/site/sagitt001/wsadminlib/wsadminlib.wasug.2011-0125-0726.pdf?attredirects=0&amp;amp;d=1"&gt;[here]&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You can also view the presentation online at slideshare.net, thanks to my teammate and fellow wsadminlib contributor Rohit K. &amp;nbsp;[&lt;a href="http://www.slideshare.net/kelapure/wsadminlibwasug2011-01250726"&gt;&lt;b&gt;here&lt;/b&gt;&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;Please let us know if you would like a presentation at your local WebSphere User Group meeting, and we will try to find a local contributor.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-5264818308416467772?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/5264818308416467772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/5264818308416467772'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2011/02/presentation-on-wsadminlibpy.html' title='Presentation on wsadminlib.py'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-1617451328454748815</id><published>2011-01-23T10:41:00.000-08:00</published><updated>2011-01-23T10:41:58.114-08:00</updated><title type='text'>Beware of mail methods</title><content type='html'>I have received two problem reports from wsadminlib users about the mail methods in wsadminlib.py.  I will post an update after the original authors and users have a chance to investigate.&lt;br /&gt;&lt;br /&gt;Sorry for the nuisance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-1617451328454748815?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/1617451328454748815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/1617451328454748815'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2011/01/beware-of-mail-methods.html' title='Beware of mail methods'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-6423545159640666364</id><published>2011-01-21T07:03:00.000-08:00</published><updated>2011-01-21T07:03:07.406-08:00</updated><title type='text'>Fixes for compareIntLists(), etc.</title><content type='html'>Here are fixes for two problems reported by a user...&lt;br /&gt;&lt;br /&gt;The first problem, in method &lt;b&gt;compareIntLists()&lt;/b&gt;, is significant.  This method is used to determine whether one version of WAS is greater than another.  The original method has two tests at the bottom, for greater-than and less-than, and both tests returned the same value of 'negative one'.   Not good.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;Unfortunately, this bug has been present for several years.  If you are using it to steer config options or to select testcases, beware they might change with this fix.&lt;br /&gt;&lt;br /&gt;I rewrote the method to be simpler and more understandable than the original, and I tested it well. A complete replacement appears below the jump...&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;i&gt;def compareIntLists(a, b):&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;"""Compares two python lists containing ints.&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; Handles arrays of different lengths by padding with zeroes.&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; Returns -1 if array a is less than array b. For example,&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[6,0,0,13] &amp;lt; [6,1]&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; Returns 0 if they're the same. &amp;nbsp;For example,&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [7,0] = [7,0,0,0]&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; Returns +1 if array a is greater than array b. &amp;nbsp;For example,&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [8,0,0,12] &amp;gt; [8,0,0,11]&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; """&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;m = "compareIntLists:"&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sop(m,"Entry. a=%s b=%s" % ( a, b, ))&lt;/i&gt;&lt;p&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;# Make both arrays the same length. Pad the smaller array with trailing zeroes.&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;while (len(a) &amp;lt; len(b)):&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a.append(0)&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;while (len(b) &amp;lt; len(a)):&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;b.append(0)&lt;/i&gt;&lt;p&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;# Compare each element in the arrays.&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;rc = cmp(a,b)&lt;/i&gt;&lt;p&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sop(m,"Exit. Returning %i" % ( rc ))&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return rc&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The second problem is a small logging bug in method &lt;b&gt;createProtocolProvider()&lt;/b&gt;.  The initial logging message has single-quotes and double-quotes mismatched.  Here is the original buggy line:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sop (m, "Create Mail Protocol Provider '+protocol+', if it does not exist")&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;and here is the fix:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;sop (m, "Create Mail Protocol Provider&lt;b&gt; "&lt;/b&gt;+protocol+&lt;b&gt;"&lt;/b&gt;, if it does not exist")&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The python language allows use of single and double quotes for strings, but they must be in matched pairs.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Many thanks to wsadminlib user Bryan for reporting these problems.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-6423545159640666364?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/6423545159640666364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/6423545159640666364'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2011/01/fixes-for-compareintlists-etc.html' title='Fixes for compareIntLists(), etc.'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-3133921485762332423</id><published>2011-01-14T05:36:00.001-08:00</published><updated>2011-01-14T05:36:43.855-08:00</updated><title type='text'>Updated wsadminlib.py now available</title><content type='html'>An updated version of wsadminlib.py has been published on IBM developerWorks.&lt;br /&gt;&lt;br /&gt;It provides:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;35 new methods&lt;/b&gt; covering a variety of functional areas: applications, security, caching, JVM properties, SIBus, etc. &amp;nbsp;It also provides several methods to configure the new High Performance Extensible Logging (HPEL) feature available in the WebSphere Application Server V8 (currently in beta).&lt;/li&gt;&lt;li&gt;&lt;b&gt;7 updates to existing methods.&lt;/b&gt; &amp;nbsp;These are few small fixes and a few new parameters for existing methods.&lt;/li&gt;&lt;li&gt;1 useless method was deleted; it was in the original version by mistake.&lt;/li&gt;&lt;li&gt;The ability to access methods in wsadminlib.py using the python&lt;b&gt; import&lt;/b&gt;&amp;nbsp;statement.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;The full list of method changes is attached below the jump.&lt;br /&gt;&lt;br /&gt;The new wsadminlib.py has the same terms and conditions as the original. &amp;nbsp;To summarize, it is a free. 'as-is', sample script package, not supported by IBM. &amp;nbsp;The official statement is in the prologue of wsadminlib.py.&lt;br /&gt;&lt;br /&gt;This update replaces the original version of wsadminlib.py published in April 2010. &amp;nbsp;Be sure to save your original copy in case you have modified it or don't like something in the new update.&lt;br /&gt;&lt;br /&gt;You may fetch the updated version of wsadminlib from the same location:&lt;br /&gt;- go to &lt;a href="http://www.ibm.com/developerworks/websphere/library/samples/SampleScripts.html"&gt;[&lt;b&gt;IBM developerWorks WebSphere Sample Scripts&lt;/b&gt;]&lt;/a&gt;&lt;br /&gt;- search for 'wsadminlib'.&lt;br /&gt;&lt;br /&gt;On behalf of the more than 30 contributors, we hope you continue to find wsadminlib.py to be an incredibly useful resource.&lt;br /&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;PS: The new update contains SVN revision number 115:&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print "$Id: wsadminlib.py 115 2011-01-03 15:51:00Z dingsor $"&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;List of changes to wsadminlib.py, January 2011 (in no particular order):&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;new:&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;setDiskOffloadLocation&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;getDeploymentAutostart&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;getAdminAppViewValue&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;getApplicationContextRoot&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;setApplicationContextRoot&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;getApplicationVirtualHost&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;getNodeNameList&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;getServerJvmByRegion&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;createJvmPropertyByRegion&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;deleteVirtualHost&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;configureJPAService&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;setWebContainerDefaultVirtualHostName&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;enableJava2Security&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;disableJava2Security&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;updateWASPolicy&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;removeSIBusMember&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;modifySIBusMemberPolicy&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;getJAAS&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;isHPELEnabled&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;configureHPEL&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;configureHPELBinaryLog&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;configureHPELTextLog&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;configureHPELTrace&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;getServerNamedEndPoint&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;setCookieConfig&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;changeHostName&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;listListenerPortsOnServer&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;startAllListenerPortsInCluster&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;stopAllListenerPortsInCluster&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;setInitialStateOfAllListenerPortsInCluster&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;smartQuote&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;listAllBusinessProcessTemplates&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;listAllBusinessProcessTemplatesForApplication&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;stopAllBusinessProcessTemplatesForApplicationOnCluster&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;stopAllBusinessProcessTemplatesForApplication&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;updated:&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;stopServer - new parm to specify 'terminate'&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;setDeploymentAutostart - fix&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;enableLTPALDAPSecurity - new parm enableJava2Security&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;enableKerberosSecurity - fix&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;addSIBusMember_ext - fix&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;createJAAS - return object&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;createDerbyDataSource - new parm datasourceName, return object&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;deleted:&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;getFritzComponent&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-3133921485762332423?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/3133921485762332423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/3133921485762332423'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2011/01/updated-wsadminlibpy-now-available.html' title='Updated wsadminlib.py now available'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-3324394625918442852</id><published>2011-01-14T04:41:00.000-08:00</published><updated>2011-01-14T04:41:00.648-08:00</updated><title type='text'>A review of wsadminlib.py</title><content type='html'>I recently happened upon a review of wsadminlib.py written by a fellow IBM employee.&lt;br /&gt;&lt;br /&gt;He writes...&lt;br /&gt;&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 15px; -webkit-border-vertical-spacing: 15px; color: #222222; font-family: Arial, Helvetica; font-size: 12px; line-height: 18px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"I recently downloaded the wsadminlib.py script and began constructing WebSphere CloudBurst script packages to utilize it. To say I am impressed would be an understatement. This file makes so many tasks so incredibly simple..."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 15px; -webkit-border-vertical-spacing: 15px; color: #222222; font-family: Arial, Helvetica; font-size: 12px; line-height: 18px;"&gt;&lt;/span&gt;Click here to read the full review: &amp;nbsp;&amp;nbsp;&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: black; font-family: 'Times New Roman'; font-size: small; line-height: normal;"&gt;&lt;a href="https://www.ibm.com/developerworks/mydeveloperworks/blogs/cloudview/entry/tools_from_the_experts85?lang=en"&gt;[&lt;b&gt;Tools from the experts&lt;/b&gt;]&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: black; font-family: 'Times New Roman'; font-size: small; line-height: normal;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 15px; -webkit-border-vertical-spacing: 15px; color: #222222; font-family: Arial, Helvetica; font-size: 12px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: black; font-family: 'Times New Roman'; font-size: small; line-height: normal;"&gt;&lt;/span&gt;&lt;/span&gt;Thanks Dustin!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-3324394625918442852?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/3324394625918442852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/3324394625918442852'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2011/01/review-of-wsadminlibpy.html' title='A review of wsadminlib.py'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-3479700346858627176</id><published>2011-01-10T20:05:00.000-08:00</published><updated>2011-01-10T20:05:24.305-08:00</updated><title type='text'>IBM Impact 2011</title><content type='html'>&lt;div class="separator" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"&gt;&lt;img border="0" height="170" src="http://2.bp.blogspot.com/_f4233sXILlw/TSvVjJXheVI/AAAAAAAAI60/dGaynu9P52c/s200/impact2011logo.jpg" width="200" /&gt;&lt;/div&gt;&lt;br /&gt;- Are you attending the &lt;a href="http://www.ibm.com/impact"&gt;IBM Impact 2011&lt;/a&gt; conference?&lt;br /&gt;- Do you use wsadminlib?&lt;br /&gt;- Would you like to give a brief presentation with me?&lt;br /&gt;&lt;br /&gt;I have proposed a session on wsadminlib to the Impact committee. &amp;nbsp;I proposed introducing wsadminlib and explaining how to use it. &amp;nbsp;If the session is accepted, I would like to recruit a wsadminlib user to speak along with me, to give a brief perspective and testimonial.&lt;br /&gt;&lt;br /&gt;There are some perks for speakers too.&lt;br /&gt;&lt;br /&gt;Please let me know: &amp;nbsp;dingsor [at] us dot ibm dot com&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-3479700346858627176?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/3479700346858627176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/3479700346858627176'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2011/01/ibm-impact-2011.html' title='IBM Impact 2011'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_f4233sXILlw/TSvVjJXheVI/AAAAAAAAI60/dGaynu9P52c/s72-c/impact2011logo.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-2445637507926934501</id><published>2010-12-09T13:28:00.000-08:00</published><updated>2010-12-09T13:28:13.343-08:00</updated><title type='text'>How to start a Node Agent using scripting?</title><content type='html'>This is a tricky question. &amp;nbsp;The quick answer is that it can't be done using the typical wsadmin commands. &amp;nbsp;But it &lt;b&gt;&lt;i&gt;can&lt;/i&gt;&lt;/b&gt; be done by 'shelling out' from your python script to issue an operating system command.&lt;br /&gt;&lt;br /&gt;My colleague and fellow wsadmin contributor Jose Luis provided this Q&amp;amp;A dialog...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1) Is it possible to start the Node agent using wsadmin scripting?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;No.&lt;br /&gt;&lt;br /&gt;You can not do any operations on a Node agent if it is down. A Node agent must be running in order to work with it.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2) Why don't wsadminlin.py methods such as 'startServer' and 'isServerRunning' work for Node agents?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The job of the node agent is to start and stop servers, and to monitor them. &amp;nbsp;Under the covers, the wsadmin startServer command asks a running node agent to start servers. &amp;nbsp;But the node agent can not start itself. &amp;nbsp;Therefore the 'startServer' command can not start a node agent.&lt;br /&gt;&lt;br /&gt;However, method 'isServerRunning' does work on Node agents. It returns True if the node agent is running and False if it is down.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;3) How do I start a Node agent that is not running?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Execute operating system commmand 'startNode.sh' or 'startNode.bat'. This command is under &lt;was_home&gt;/profiles/&lt;managed profile=""&gt;/bin.&lt;/managed&gt;&lt;/was_home&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;For example:&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;i&gt;/opt/WAS61/profiles/node1/bin/startNode.sh&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;4) Hold it there!!! Question 3 describes how to start a Node agent manually and not programmatically. How can I achieve that?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You could use python libraries such as OS or Subprocess to do it. These libraries allow you to execute "external" commands within a script.&lt;br /&gt;&lt;br /&gt;For example, the following command will list the contents of the current working directory:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;i&gt;os.system('ls')&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;5) How can I use these libraries to start a Node agent?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Execute:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;i&gt;os.system(PATH_TO_STARTNODE_SCRIPT)&lt;/i&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;where PATH_TO_STARTNODE_SCRIPT is the location of your startNode.sh script.&lt;br /&gt;&lt;br /&gt;In my case, is something like:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;i&gt;os.system('/opt/WAS61/profiles/node1/bin/startNode.sh')&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Below is a script that exercises these concepts. It checks the status of a Node agent. If it is running, the script issues a command to stop it; else it issues a command to start it.&lt;br /&gt;&lt;br /&gt;Script:&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;i&gt;# Import python os library to execute external commands&lt;/i&gt;&lt;br /&gt;&lt;i&gt;import os&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;# Import wsadminlib.py (update this to your own wsadminlib.py path)&lt;/i&gt;&lt;br /&gt;&lt;i&gt;execfile('/tmp/wsadminlib.py')&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;# Node name&lt;/i&gt;&lt;br /&gt;&lt;i&gt;nodename = 'node1'&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;# Server name&lt;/i&gt;&lt;br /&gt;&lt;i&gt;servername = 'nodeagent'&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;# Counter used to keep track of while loop execution&lt;/i&gt;&lt;br /&gt;&lt;i&gt;counter = 0&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;while(counter &amp;lt; 2):&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;# Check if Node agent is running&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;print "\nIs Node agent running?"&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;isItRunning = isServerRunning(nodename,servername)&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;# If Node agent is running let's stop it&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;# else let's start it&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (isItRunning):&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print "YES\n"&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print "Request issued to stop Node agent\n"&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;stopServer( nodename, servername, immediate=False )&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;counter = counter + 1&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;else:&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print "NO\n"&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print "Request issued to start Node agent\n"&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;os.system('/opt/WAS61/profiles/node1/bin/startNode.sh')&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;counter = counter + 1&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Script Output:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Is Node agent running?&lt;/i&gt;&lt;br /&gt;&lt;i&gt;YES&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Request issued to stop Node agent&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;WASX7337I: Invoked stop for server "nodeagent" Waiting for stop completion.&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Is Node agent running?&lt;/i&gt;&lt;br /&gt;&lt;i&gt;NO&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Request issued to start Node agent&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;ADMU0116I: Tool information is being logged in file&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /opt/WAS61/profiles/node1/logs/nodeagent/startServer.log&lt;/i&gt;&lt;br /&gt;&lt;i&gt;ADMU0128I: Starting tool with the node1 profile&lt;/i&gt;&lt;br /&gt;&lt;i&gt;ADMU3100I: Reading configuration for server: nodeagent&lt;/i&gt;&lt;br /&gt;&lt;i&gt;ADMU3200I: Server launched. Waiting for initialization status.&lt;/i&gt;&lt;br /&gt;&lt;i&gt;ADMU3000I: Server nodeagent open for e-business; process id is 24175&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-2445637507926934501?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/2445637507926934501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/2445637507926934501'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2010/12/how-to-start-node-agent-using-scripting.html' title='How to start a Node Agent using scripting?'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-3392082200146622069</id><published>2010-12-01T07:49:00.000-08:00</published><updated>2010-12-01T07:49:49.411-08:00</updated><title type='text'>Request for Feedback</title><content type='html'>Are you using wsadminlib.py? &amp;nbsp; Does it work well for you?&lt;br /&gt;&lt;br /&gt;Would you like an update with some fixes and new methods?&lt;br /&gt;&lt;br /&gt;Please send me a note. &amp;nbsp;I promise to keep your email private, no spam, no sharing.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_f4233sXILlw/TPZtcqssJbI/AAAAAAAAIhM/9CeQb6m_Xt8/s1600/myemail.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_f4233sXILlw/TPZtcqssJbI/AAAAAAAAIhM/9CeQb6m_Xt8/s1600/myemail.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-3392082200146622069?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/3392082200146622069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/3392082200146622069'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2010/12/request-for-feedback.html' title='Request for Feedback'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_f4233sXILlw/TPZtcqssJbI/AAAAAAAAIhM/9CeQb6m_Xt8/s72-c/myemail.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-2014368228619127740</id><published>2010-11-11T09:51:00.000-08:00</published><updated>2010-11-11T09:51:31.185-08:00</updated><title type='text'>Python 'not callable' errors</title><content type='html'>Be careful not to heist the names of methods in wsadminlib.py...&lt;br /&gt;&lt;br /&gt;The python language allows you to dynamically redefine a method to a variable, and vice-versa.  This can be a nice feature if you do it intentionally.  But it can be a nuisance to debug if unintentional.  Here is a quick example:&lt;br /&gt;&lt;br /&gt;First, define a method which returns the sum of two numbers:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;ding@dingp:~$ python&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Python 2.5.2 (r252:60911, Jan 20 2010, 21:48:48) &lt;/i&gt;&lt;br /&gt;&lt;i&gt;[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Type "help", "copyright", "credits" or "license" for more information.&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;gt;&amp;gt;&amp;gt; def myMethod(i,j):&lt;/i&gt;&lt;br /&gt;&lt;i&gt;...     return i+j&lt;/i&gt;&lt;br /&gt;&lt;i&gt;... &lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Pass in two numbers, set the return value to another variable, and it works as expected.&lt;br /&gt;&lt;br /&gt;&lt;i&gt; &amp;gt;&amp;gt;&amp;gt; k = myMethod(1,2)&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; print k&lt;br /&gt;3&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/i&gt;&lt;br /&gt;&lt;br /&gt;But watch what happens next...&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now set the return value to the &lt;i&gt;&lt;b&gt;same name&lt;/b&gt;&lt;/i&gt; as the method.  The return variable has the expected value, but the variable has unknowingly converted the name from a callable method to an integer.&lt;br /&gt;&lt;br /&gt;&lt;i&gt; &amp;gt;&amp;gt;&amp;gt; myMethod = myMethod(3,4)&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; print myMethod&lt;br /&gt;7&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/i&gt;&lt;br /&gt;&lt;br /&gt;When we repeat the previously-successful call, it fails.  The error message says the variable type, an int, is 'not callable' as a method.&lt;br /&gt;&lt;br /&gt;&lt;i&gt; &amp;gt;&amp;gt;&amp;gt; k = myMethod(1,2)&lt;br /&gt;Traceback (most recent call last):&lt;br /&gt;File "&lt;stdin&gt;", line 1, in &lt;module&gt;&lt;br /&gt;TypeError: 'int' object is not callable&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/module&gt;&lt;/stdin&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A wsadminlib user recently reported a problem where this behavior was the culprit.  The calling script inadvertently defined a variable with the same name as a method in wsadminlib.py.  For example, the script had something like this:&lt;br /&gt;&lt;br /&gt;&lt;i&gt; isND = isND()&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Everything worked fine until much later, when subsequent code tried to query isND() once again.  Poof, the 'not callable' error appeared.&lt;br /&gt;&lt;br /&gt;Lesson:  if ever you see a 'not callable' error, search and examine every location where the method name is used.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-2014368228619127740?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/2014368228619127740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/2014368228619127740'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2010/11/python-not-callable-errors.html' title='Python &apos;not callable&apos; errors'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-4693154980463529488</id><published>2010-08-16T07:14:00.000-07:00</published><updated>2010-08-16T07:14:07.001-07:00</updated><title type='text'>How to set custom properties in Global Security?</title><content type='html'>Use wsadminlib's method setCustomPropertyOnObject().&lt;br /&gt;&lt;br /&gt;Here is the method signature. The parameters are straightforward:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;setCustomPropertyOnObject(object_id, propname, propvalue)&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The pydoc is pretty good too.  If a property with this name does not exist, the method creates it.  If one already exists, the method sets the new value.&lt;br /&gt;&lt;br /&gt;Here is an example:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;sid = getObjectsOfType('Security')[0]&lt;br /&gt;setCustomPropertyOnObject(sid,'andy.propkey','andy.propvalue')&lt;br /&gt;save()&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_f4233sXILlw/TGlG1_XLT-I/AAAAAAAAHt4/TzuXT188plE/s1600/glob.sec.cust.prop.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="150" src="http://3.bp.blogspot.com/_f4233sXILlw/TGlG1_XLT-I/AAAAAAAAHt4/TzuXT188plE/s200/glob.sec.cust.prop.jpg" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;We can then browse to the admin console and see the new custom property in the list.&lt;br /&gt;&lt;br /&gt;Extra info: &amp;nbsp;We can also query the value of a custom property with this method. &lt;br /&gt;&lt;br /&gt;&lt;i&gt;getObjectCustomProperty(object_id, propname)&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-4693154980463529488?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/4693154980463529488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/4693154980463529488'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2010/08/how-to-set-custom-properties-in-global.html' title='How to set custom properties in Global Security?'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_f4233sXILlw/TGlG1_XLT-I/AAAAAAAAHt4/TzuXT188plE/s72-c/glob.sec.cust.prop.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-1257210972334213158</id><published>2010-07-09T13:30:00.000-07:00</published><updated>2010-07-09T13:42:20.078-07:00</updated><title type='text'>How to handle object-like strings?</title><content type='html'>Several wsadmin commands return 'object-like' strings as responses.  That is, they return strings which &lt;u&gt;look&lt;/u&gt; like objects, but are &lt;u&gt;just strings&lt;/u&gt;.  Very annoying.&lt;br /&gt;&lt;br /&gt;We wrote several helper methods in wsadminlib.py to convert these object-like strings into real python lists and dictionaries.  The helpers may seem silly at first, but having real objects makes searching and extracting values from responses much easier.  Here are two examples...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Consider this string:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;  '[ [key0  value0] [key1 value1] [key2 value2] ]'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is the format of the response string which you get from several wsadmin commands.  To a human, it is visually recognizable as a set of keys and values.  But to python, it is nothing.  It is a string which is tedious to parse and search, and the code is confusing to duplicate inline in various functional methods.  What to do?&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The second time I encountered this format, I wrote a helper method in wsadminlib.py to abstract it.&lt;br /&gt;&lt;br /&gt;Method propsToDictionary() accepts this type of string as input, and returns a python dictionary as output, where each key and value are elements of the dictionary.&lt;br /&gt;&lt;br /&gt;To demonstrate, we first start wsadmin and load wsadminlib.py:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;root@ding6:/tmp# /opt/WAS70/bin/wsadmin.sh -lang jython -host ding4 -port 8879&lt;br /&gt;WASX7209I: Connected to process "dmgr" on node dmgr using SOAP connector; The type of process is: DeploymentManager&lt;br /&gt;WASX7031I: For help, enter: "print Help.help()"&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;execfile('/tmp/wsadminlib.py')&lt;br /&gt;$Id: wsadminlib.py 104 2010-02-15 19:06:18Z ding $&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;enableDebugMessages()&lt;br /&gt;[2010-0709-1540-2100] enableDebugMessages Verbose trace messages are now enabled; future debug messages will now be printed.&lt;br /&gt;wsadmin&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now let's define an input string in the format of responses from several wsadmin commands, and convert to a python dictionary:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;wsadmin&gt;propString = '[ [key0 value0] [key1 value1] [key2 value2] ]'&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;propDict = propsToDictionary(propString)&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;print propDict&lt;br /&gt;{'key2': 'value2', 'key1': 'value1', 'key0': 'value0'}&lt;br /&gt;wsadmin&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It is really easy to call this method from your code and then extract desired values.  Here we get the value for key1:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;wsadmin&gt;myValue1 = propDict['key1']&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;print myValue1&lt;br /&gt;value1&lt;br /&gt;wsadmin&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example 2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Another example is helper method stringListToList().  It takes a string which looks like a list as input:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;    '[element0  element1  element2]'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and returns a python list object containing each element as a string:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;    ['element0', 'element1', 'element2']&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It is much easier and natural to deal with a list of information in python list object, rather than in a string.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Availablilty&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;These and other helper methods are used internally within wsadminlib.py.  You are able to make use of them from your own external methods as well.&lt;br /&gt;&lt;br /&gt;Please look for these and similar helper methods in wsadminlib.py the next time you encounter an ugly 'object-like' string from wsadmin.  The input/output syntax of each helper method is well-documented at the top of each method.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Friday Quiz&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As a community-contribution project, wsadminlib.py is not perfect.  As I was typing this blog entry, I discovered a second method in wsadminlib which seems to implements the same functionality as propsToDictionary().  Maybe I will deprecate one someday.  Meanwhile, see if you can find it while you are savoring all the valuables in wsadminlib.py!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-1257210972334213158?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/1257210972334213158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/1257210972334213158'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2010/07/how-to-handle-object-like-strings.html' title='How to handle object-like strings?'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-2484187882309971723</id><published>2010-05-12T08:44:00.000-07:00</published><updated>2010-05-12T08:58:57.094-07:00</updated><title type='text'>How to install an application?</title><content type='html'>Use wsadminlib's method installApplication().&lt;br /&gt;&lt;br /&gt;Here is the method signature.  The parameter names are straightforward, and the pydoc is pretty good.  The list of servers is meant to specify individual non-clustered servers.  If a server is part of a cluster, just specify the cluster name.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;def installApplication( filename, servers, clusternames, options )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Clusters&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;First let's install an app on a cluster of servers.  Define the name of the ear file, and the name of the cluster.  Then install the app, specifying an empty list for individual servers, and no options.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;filename = '/tmp/pxyapps.ear'&lt;br /&gt;clusternames = [ 'cluster1' ]&lt;br /&gt;installApplication( filename, [], clusternames, None )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_f4233sXILlw/S-rN5kbhroI/AAAAAAAAGVM/-m9GCTSNYpA/s1600/app.on.cluster.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 200px; height: 121px;" src="http://4.bp.blogspot.com/_f4233sXILlw/S-rN5kbhroI/AAAAAAAAGVM/-m9GCTSNYpA/s200/app.on.cluster.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5470411086310256258" /&gt;&lt;/a&gt;After saving the config, we can browse to the admin console, look at the app's mappings, and see it worked:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Individual servers&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Next let's install an app on an individual non-clustered server.  Define the server in a list of dictionaries containing the node name and server name.  This time we specify an empty list for the clusternames.&lt;br /&gt;&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;filename = '/tmp/pxyapps.ear'&lt;br /&gt;servers = [ { 'nodename': 'node1', 'servername': 'sippbx1' } ]&lt;br /&gt;installApplication( filename, servers, [], None )&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_f4233sXILlw/S-rOW80L1oI/AAAAAAAAGVU/xaXfMBwzHzw/s1600/app.on.server.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 200px; height: 129px;" src="http://3.bp.blogspot.com/_f4233sXILlw/S-rOW80L1oI/AAAAAAAAGVU/xaXfMBwzHzw/s200/app.on.server.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5470411591072339586" /&gt;&lt;/a&gt;After saving the config, we again browse to the admin console, and see the app's mappings"&lt;br /&gt;&lt;br /&gt;But wait, there's more.  If you browse through wsadminlib.py, in the section titled 'application-related methods', you'll find a bevy of methods to list applications, delete them, start and stop, etc.  Poke around and see what you can find.&lt;br /&gt;&lt;br /&gt;Just for the archives, here is the full transcript of installing on the cluster...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;root@ding1:/tmp# /opt/WAS70/bin/wsadmin.sh -lang jython -host ding6 -port 8879&lt;br /&gt;WASX7209I: Connected to process "dmgr" on node dmgr using SOAP connector;  The type of process is: DeploymentManager&lt;br /&gt;WASX7031I: For help, enter: "print Help.help()"&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;execfile('/tmp/wsadminlib.py')&lt;br /&gt;$Id: wsadminlib.py 104 2010-02-15 19:06:18Z ding $&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;enableDebugMessages()&lt;br /&gt;[2010-0512-1007-1600] enableDebugMessages Verbose trace messages are now enabled; future debug messages will now be printed.&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;filename = '/tmp/pxyapps.ear'&lt;br /&gt;wsadmin&gt;clusternames = [ 'cluster1' ]&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;installApplication( filename, [], clusternames, None )&lt;br /&gt;[2010-0512-1020-4200] installApplication: filename=/tmp/pxyapps.ear, servers=[], clusternames=['cluster1'], options=None&lt;br /&gt;[2010-0512-1020-4200] installApplication: Calling AdminApp.install of /tmp/pxyapps.ear with arglist = ['-target', 'WebSphere:cell=ndcell,cluster=cluster1']&lt;br /&gt;ADMA0073W: Custom permissions are found in the [(com.ibm.websphere.security.WebSphereRuntimePermission AdminPermission)] policy file. Custom permissions can compromise the integrity of Java 2 Security.&lt;br /&gt;WASX7327I: Contents of was.policy file:&lt;br /&gt; /*&lt;br /&gt; * WARNING: IF YOU EDIT THIS FILE WITH THE policytool, THESE&lt;br /&gt; * COMMENTS MIGHT BE LOST&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;grant codeBase "file:${application}" {&lt;br /&gt;&lt;br /&gt;  /* Pxyapps needs this - it tries to get the cell name */&lt;br /&gt;  permission com.ibm.websphere.security.WebSphereRuntimePermission "AdminPermission";&lt;br /&gt;&lt;br /&gt;  permission java.io.FilePermission "${was.install.root}${/}properties${/}version${/}CEA.product", "read";&lt;br /&gt;  permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";&lt;br /&gt;&lt;br /&gt;  permission java.security.AllPermission;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;ADMA5016I: Installation of pxyapps started.&lt;br /&gt;ADMA5058I: Application and module versions are validated with versions of deployment targets.&lt;br /&gt;ADMA5005I: The application pxyapps is configured in the WebSphere Application Server repository.&lt;br /&gt;ADMA5053I: The library references for the installed optional package are created.&lt;br /&gt;ADMA5005I: The application pxyapps is configured in the WebSphere Application Server repository.&lt;br /&gt;ADMA5001I: The application binaries are saved in /opt/WAS70/profiles/dmgr/wstemp/Script1288cd6bd3d/workspace/cells/ndcell/applications/pxyapps.ear/pxyapps.ear&lt;br /&gt;ADMA5005I: The application pxyapps is configured in the WebSphere Application Server repository.&lt;br /&gt;SECJ0400I: Successfully updated the application pxyapps with the appContextIDForSecurity information.&lt;br /&gt;ADMA5005I: The application pxyapps is configured in the WebSphere Application Server repository.&lt;br /&gt;ADMA5113I: Activation plan created successfully.&lt;br /&gt;ADMA5011I: The cleanup of the temp directory for application pxyapps is complete.&lt;br /&gt;ADMA5013I: Application pxyapps installed successfully.&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;save()&lt;br /&gt;[2010-0512-1020-4700] save: AdminConfig.queryChanges()&lt;br /&gt;[2010-0512-1020-4700] save:   WASX7146I: The following configuration files contain unsaved changes:&lt;br /&gt;[2010-0512-1020-4700] save:    cells/ndcell/nodes/node1/serverindex.xml&lt;br /&gt;[2010-0512-1020-4700] save:   cells/ndcell/applications/pxyapps.ear/deltas/pxyapps/delta-1273674004465&lt;br /&gt;[2010-0512-1020-4700] save:   cells/ndcell/applications/pxyapps.ear/pxyapps.ear&lt;br /&gt;[2010-0512-1020-4700] save:   cells/ndcell/applications/pxyapps.ear/deployments/pxyapps/META-INF/ibm-application-bnd.xmi&lt;br /&gt;[2010-0512-1020-4700] save:   cells/ndcell/applications/pxyapps.ear/deployments/pxyapps/META-INF/MANIFEST.MF&lt;br /&gt;[2010-0512-1020-4700] save:   cells/ndcell/applications/pxyapps.ear/deployments/pxyapps/pxyapps.war/WEB-INF/ibm-web-bnd.xmi&lt;br /&gt;[2010-0512-1020-4700] save:   cells/ndcell/applications/pxyapps.ear/deployments/pxyapps/META-INF/application.xml&lt;br /&gt;[2010-0512-1020-4700] save:   cells/ndcell/applications/pxyapps.ear/deployments/pxyapps/pxyapps.war/WEB-INF/web.xml&lt;br /&gt;[2010-0512-1020-4700] save:   cells/ndcell/applications/pxyapps.ear/deployments/pxyapps/pxyapps.war/META-INF/MANIFEST.MF&lt;br /&gt;[2010-0512-1020-4700] save:   cells/ndcell/applications/pxyapps.ear/deployments/pxyapps/pxyapps.war/WEB-INF/ibm-web-ext.xmi&lt;br /&gt;[2010-0512-1020-4700] save:   cells/ndcell/applications/pxyapps.ear/deployments/pxyapps/META-INF/was.policy&lt;br /&gt;[2010-0512-1020-4700] save:   cells/ndcell/applications/pxyapps.ear/deployments/pxyapps/META-INF/ibm-application-runtime.props&lt;br /&gt;[2010-0512-1020-4700] save:   cells/ndcell/applications/pxyapps.ear/deployments/pxyapps/deployment.xml&lt;br /&gt;[2010-0512-1020-4700] save:   cells/ndcell/blas/pxyapps/bver/BASE/bla.xml&lt;br /&gt;[2010-0512-1020-4700] save:   cells/ndcell/cus/pxyapps/cver/BASE/cu-ref.xml&lt;br /&gt;[2010-0512-1020-4700] save:   cells/ndcell/cus/pxyapps/cver/BASE/controlOpDefs.xml&lt;br /&gt;[2010-0512-1020-4700] save:   cells/ndcell/cus/pxyapps/cver/BASE/cu.xml&lt;br /&gt;[2010-0512-1020-4700] save: AdminConfig.getSaveMode()&lt;br /&gt;[2010-0512-1020-4700] save:   rollbackOnConflict&lt;br /&gt;[2010-0512-1020-4700] save: AdminConfig.save()&lt;br /&gt;[2010-0512-1020-4800] save:   Save complete!&lt;br /&gt;[2010-0512-1020-4800] wsadminlib.syncall Start&lt;br /&gt;[2010-0512-1020-4900] wsadminlib.syncall Sync config to node node1&lt;br /&gt;[2010-0512-1020-4900] wsadminlib.syncall Done&lt;br /&gt;0&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-2484187882309971723?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/2484187882309971723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/2484187882309971723'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2010/05/how-to-install-application.html' title='How to install an application?'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_f4233sXILlw/S-rN5kbhroI/AAAAAAAAGVM/-m9GCTSNYpA/s72-c/app.on.cluster.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-6525054732807382389</id><published>2010-04-21T05:49:00.000-07:00</published><updated>2010-04-21T07:55:04.415-07:00</updated><title type='text'>How to create a cluster and servers?</title><content type='html'>Use wsadminlib methods createCluster() and createServerInCluster().&lt;br /&gt;&lt;br /&gt;First create a cluster, specifying the cell name and cluster name:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;createCluster( 'cell1', 'cluster1')&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then create servers, specifying the cluster name, node name, and server name:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;createServerInCluster( 'cluster1', 'node1', 'server1')&lt;br /&gt;createServerInCluster( 'cluster1', 'node1', 'server2')&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_f4233sXILlw/S875KEFBDgI/AAAAAAAAF30/zJ7fFWvOi0Y/s1600/clusterservers.2010-0421-0834.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 200px; height: 110px;" src="http://2.bp.blogspot.com/_f4233sXILlw/S875KEFBDgI/AAAAAAAAF30/zJ7fFWvOi0Y/s200/clusterservers.2010-0421-0834.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5462577349335780866" /&gt;&lt;/a&gt;That was easy.  We created one cluster with two servers.  This screenshot shows the two servers with the cluster name in the Admin Console.&lt;br /&gt;&lt;br /&gt;It's also easy to create a replication domain and enable session replication with these same commands.  If you look at the two method signatures in wsadminlib.py, you'll see optional parameters for replication.  They are disabled by default, and you can override them as follows:&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;createCluster( 'cell1', 'cluster1', createReplicationDomain=True )&lt;br /&gt;createServerInCluster( 'cluster1', 'node1', 'server1', sessionReplication=True )&lt;br /&gt;createServerInCluster( 'cluster1', 'node1', 'server2', sessionReplication=True )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note: True and False are set to 1 and 0 in wsadminlib.py as a convenience.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_f4233sXILlw/S875fJP8sFI/AAAAAAAAF38/dTqJ5Lrzyvw/s1600/repdom.2010-0421-0845.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 200px; height: 99px;" src="http://1.bp.blogspot.com/_f4233sXILlw/S875fJP8sFI/AAAAAAAAF38/dTqJ5Lrzyvw/s200/repdom.2010-0421-0845.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5462577711501062226" /&gt;&lt;/a&gt;This creates a replication domain with the same name as the cluster.&lt;br /&gt;&lt;br /&gt;Finally, I created a python file to do all of the above.  I named it clusterdemo.py.  I invoked it like this:  &lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;/opt/WAS70/bin/wsadmin.sh -lang jython -host ding6 -port 8879 -f clusterdemo.py&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And here are the contents.  Feel free to copy, paste, and tweak.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;#-----------------------------------------------------------------------&lt;br /&gt;# This python script demonstrates how &lt;br /&gt;# to create a cluster with two servers&lt;br /&gt;# using wsadminlib.py&lt;br /&gt;#&lt;br /&gt;# AD 2010-0421-0800&lt;br /&gt;#-----------------------------------------------------------------------&lt;br /&gt;execfile('wsadminlib.py')&lt;br /&gt;enableDebugMessages()&lt;br /&gt;m = "clusterdemo.py:" &lt;br /&gt;sop(m,"Entry.")&lt;br /&gt;&lt;br /&gt;# Define variable names&lt;br /&gt;clustername = "cluster1"&lt;br /&gt;server1name = "server1"&lt;br /&gt;server2name = "server2"&lt;br /&gt;&lt;br /&gt;# Debug&lt;br /&gt;sop(m,"clustername=" + clustername)&lt;br /&gt;sop(m,"server1name=" + server1name)&lt;br /&gt;sop(m,"server2name=" + server2name)&lt;br /&gt;&lt;br /&gt;# Specify replication&lt;br /&gt;createReplicationDomain = True&lt;br /&gt;sessionReplication = True&lt;br /&gt;&lt;br /&gt;# Query the cell name.&lt;br /&gt;cellname = getCellName()&lt;br /&gt;sop(m,"cellname=" + cellname)&lt;br /&gt;&lt;br /&gt;# Query the first node name.&lt;br /&gt;nodelist = listAppServerNodes()&lt;br /&gt;nodename = nodelist[0]&lt;br /&gt;sop(m,"nodename=" + nodename)&lt;br /&gt;&lt;br /&gt;# Create the cluster.&lt;br /&gt;createCluster( cellname, clustername, createReplicationDomain )&lt;br /&gt;&lt;br /&gt;# Create each server within the cluster.&lt;br /&gt;createServerInCluster( clustername, nodename, server1name, sessionReplication )&lt;br /&gt;createServerInCluster( clustername, nodename, server2name, sessionReplication ) &lt;br /&gt;&lt;br /&gt;# Save and synchronize&lt;br /&gt;save()&lt;br /&gt;&lt;br /&gt;sop(m,"Exit.")&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-6525054732807382389?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/6525054732807382389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/6525054732807382389'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2010/04/how-to-create-cluster-and-servers.html' title='How to create a cluster and servers?'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_f4233sXILlw/S875KEFBDgI/AAAAAAAAF30/zJ7fFWvOi0Y/s72-c/clusterservers.2010-0421-0834.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-4811061910637190927</id><published>2010-04-09T07:56:00.001-07:00</published><updated>2010-04-09T08:11:45.822-07:00</updated><title type='text'>Who wrote wsadminlib.py?</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_f4233sXILlw/S79DkOj0DiI/AAAAAAAAFwo/0uGyqoU9F1Y/s1600/wsadminlib.contributors1.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 200px; height: 78px;" src="http://2.bp.blogspot.com/_f4233sXILlw/S79DkOj0DiI/AAAAAAAAFwo/0uGyqoU9F1Y/s200/wsadminlib.contributors1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5458155563058990626" /&gt;&lt;/a&gt;wsadminlib.py was originally created by two IBM product developers in 2006.  They shared it with teammates and it grew into an internal community project with several dozen volunteer contributors thus far.&lt;br /&gt;&lt;br /&gt;Click on the thumbnail image to see the list of people who have contributed to the first version published on developerWorks (and who gave permission to publish their names).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-4811061910637190927?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/4811061910637190927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/4811061910637190927'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2010/04/who-wrote-wsadminlibpy.html' title='Who wrote wsadminlib.py?'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_f4233sXILlw/S79DkOj0DiI/AAAAAAAAFwo/0uGyqoU9F1Y/s72-c/wsadminlib.contributors1.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-4947402418064122093</id><published>2010-04-02T06:25:00.000-07:00</published><updated>2010-04-21T07:56:47.487-07:00</updated><title type='text'>How to set a custom property on a channel?</title><content type='html'>Use wsadminlib's method setChannelCustomProperty().&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_f4233sXILlw/S7XyQFKYN7I/AAAAAAAAFvY/9soxqJWyq5M/s1600/wcc.custprop0.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 200px; height: 88px;" src="http://4.bp.blogspot.com/_f4233sXILlw/S7XyQFKYN7I/AAAAAAAAFvY/9soxqJWyq5M/s200/wcc.custprop0.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5455532881706760114" /&gt;&lt;/a&gt;Before we start, here is an example of channel custom properties in the admin console: Click Application Servers-&gt; server1-&gt; Web container settings-&gt; Web container transport chains-&gt; WCInboundDefault-&gt; Web container inbound channel (WCC2)-&gt; Custom properties.  I have no idea what a channel is, but I can show you how to set a custom property on one...&lt;br /&gt;&lt;br /&gt;Method setChannelCustomProperty() allows us to specify the channel either by an end point name or the channel name.  Take a look at the method in wsadminlib, where there is actually good pydoc to explain the parameters.&lt;br /&gt;&lt;br /&gt;The first five parameters are required, in the specified sequence.  The last two, endPointName and channelName, are optional and have defaults.  You must specify exactly one of them.&lt;br /&gt;&lt;br /&gt;So let's add a hypothetical custom property, enablePlayaDust=true, by specifying the channel name.  Create a python script file named setChannelCustProp.py:&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;execfile('wsadminlib.py')&lt;br /&gt;enableDebugMessages()&lt;br /&gt;&lt;br /&gt;# Define the parameters.&lt;br /&gt;nodename = 'node1'&lt;br /&gt;servername = 'server1'&lt;br /&gt;propname = 'enablePlayaDust'&lt;br /&gt;propvalue = 'true'&lt;br /&gt;channeltype = 'WebContainerInboundChannel'&lt;br /&gt;channelname = 'WCC_2'&lt;br /&gt;&lt;br /&gt;# Set the property&lt;br /&gt;setChannelCustomProperty(nodename, servername, propname, propvalue, channeltype, channelName = channelname)&lt;br /&gt;&lt;br /&gt;# Save and sync to all nodes.&lt;br /&gt;save()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then run it...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;root@ding6:/# /opt/WAS70/bin/wsadmin.sh -lang jython -host ding6 -port 8879 -f setChannelCustProp.py &lt;br /&gt;WASX7209I: Connected to process "dmgr" on node dmgr using SOAP connector;  The type of process is: DeploymentManager&lt;br /&gt;$Id: wsadminlib.py 50 2009-01-14 14:42:11Z ding $&lt;br /&gt;[2010-0402-1000-0100] enableDebugMessages Verbose trace messages are now enabled; future debug messages will now be printed.&lt;br /&gt;[2010-0402-1000-0100] setChannelCustomProperty: Entry. Setting channel custom property enablePlayaDust=true on node1/server1 channelType=WebContainerInboundChannel endPointName=None channelName=WCC_2&lt;br /&gt;[2010-0402-1000-0200] save: AdminConfig.queryChanges()&lt;br /&gt;[2010-0402-1000-0200] save:   WASX7146I: The following configuration files contain unsaved changes:&lt;br /&gt;[2010-0402-1000-0200] save:    cells/ndcell/nodes/node1/servers/server1/server.xml&lt;br /&gt;[2010-0402-1000-0200] save: AdminConfig.hasChanges()&lt;br /&gt;[2010-0402-1000-0200] save: AdminConfig.getSaveMode()&lt;br /&gt;[2010-0402-1000-0200] save:   rollbackOnConflict&lt;br /&gt;[2010-0402-1000-0200] save: AdminConfig.save()&lt;br /&gt;[2010-0402-1000-0200] save:   Save complete!&lt;br /&gt;[2010-0402-1000-0200] wsadminlib.syncall Start&lt;br /&gt;[2010-0402-1000-0300] wsadminlib.syncall Sync config to node node1&lt;br /&gt;[2010-0402-1000-0300] wsadminlib.syncall Done&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There were no errors and no exceptions, so that means the channel was found and the prop was set successfully. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_f4233sXILlw/S7X6LI2UwCI/AAAAAAAAFvg/O6rG3XecENE/s1600/wcc.custprop1.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 200px; height: 97px;" src="http://4.bp.blogspot.com/_f4233sXILlw/S7X6LI2UwCI/AAAAAAAAFvg/O6rG3XecENE/s200/wcc.custprop1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5455541592890064930" /&gt;&lt;/a&gt;To confirm the results, refresh the view on the admin console, and we can see the property named 'enablePlayaDust' with the value 'true'.  Et voila.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;p&gt;&lt;br&gt;PS: Here's a snippet to set a custom prop using the endPointName:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;channeltype = 'UDPInboundChannel'&lt;br /&gt;endpointname = 'SIP_DEFAULTHOST'&lt;br /&gt;setChannelCustomProperty(nodename, servername, propname, propvalue, channeltype, endPointName = endpointname)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-4947402418064122093?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/4947402418064122093'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/4947402418064122093'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2010/04/how-to-set-custom-property-on-channel.html' title='How to set a custom property on a channel?'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_f4233sXILlw/S7XyQFKYN7I/AAAAAAAAFvY/9soxqJWyq5M/s72-c/wcc.custprop0.jpg' height='72' width='72'/></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-6414823354293710935</id><published>2010-03-31T09:12:00.000-07:00</published><updated>2010-04-21T07:55:53.987-07:00</updated><title type='text'>How to set a server's listening port number?</title><content type='html'>Use wsadminlib's method setServerPort().  Here's an example of setting the web container's default port:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;nodename = 'node1'&lt;br /&gt;servername = 'server1'&lt;br /&gt;endPointName = 'WC_defaulthost'&lt;br /&gt;port = 9083&lt;br /&gt;setServerPort(nodename, servername, endPointName, port)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Note that the name arguments are python strings, but the port is a number.  Here is a screenshot:&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;root@ding6 /opt/WAS70/bin/wsadmin.sh -lang jython -host ding6 -port 8879&lt;br /&gt;WASX7209I: Connected to process "dmgr" on node dmgr using SOAP connector;  The type of process is: DeploymentManager&lt;br /&gt;WASX7031I: For help, enter: "print Help.help()"&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;execfile('wsadminlib.py')&lt;br /&gt;$Id: wsadminlib.py 50 2009-01-14 14:42:11Z ding $&lt;br /&gt;wsadmin&gt;             &lt;br /&gt;wsadmin&gt;enableDebugMessages()&lt;br /&gt;[2010-0301-1232-1200] enableDebugMessages Verbose trace messages are now enabled; future debug messages will now be printed.&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;nodename = 'node1'&lt;br /&gt;wsadmin&gt;servername = 'server1'&lt;br /&gt;wsadmin&gt;endPointName = 'WC_defaulthost'&lt;br /&gt;wsadmin&gt;port = 9083&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;setServerPort(nodename, servername, endPointName, port)&lt;br /&gt;wsadmin&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Option:&lt;/span&gt;  If you look at the method signature, you'll see that a hostname parameter (or IP) can be specified for this port definition.  It defaults to the asterisk wildcard.  For example,&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;wsadmin&gt;hostname = 'ding6.raleigh.ibm.com'&lt;br /&gt;wsadmin&gt;setServerPort(nodename, servername, endPointName, port, hostname)&lt;br /&gt;wsadmin&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Also note this method is not very chatty, since it prints no messages on success.  You'll find differences in verbosity throughout wsadminlib, depending upon who wrote the method.  Fear not, most setters have getters, and you can query the value after setting it:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;wsadmin&gt;getServerPort(nodename, servername, endPointName)&lt;br /&gt;'9083'&lt;br /&gt;wsadmin&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-6414823354293710935?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/6414823354293710935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/6414823354293710935'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2010/03/how-to-set-servers-listening-port.html' title='How to set a server&apos;s listening port number?'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-6342652974332803437</id><published>2010-03-30T08:58:00.000-07:00</published><updated>2010-04-02T05:43:49.152-07:00</updated><title type='text'>How to save my changes?</title><content type='html'>Use wsadminlib's method save().  This method saves your changes and pushes them out to all the nodes immediately (if you are running in a cell environment).  It also displays all the changes, for debug purposes.&lt;br /&gt;&lt;br /&gt;Here is a screenshot from the end of an exercise where I created a new server:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;wsadmin&gt;save()&lt;br /&gt;[2010-0301-1150-2400] save: AdminConfig.queryChanges()&lt;br /&gt;[2010-0301-1150-2400] save:   WASX7146I: The following configuration files contain unsaved changes:&lt;br /&gt;[2010-0301-1150-2400] save:    cells/ndcell/nodes/node1/servers/server1/server.xml&lt;br /&gt;[2010-0301-1150-2400] save: AdminConfig.hasChanges()&lt;br /&gt;[2010-0301-1150-2400] save: AdminConfig.getSaveMode()&lt;br /&gt;[2010-0301-1150-2400] save:   rollbackOnConflict&lt;br /&gt;[2010-0301-1150-2400] save: AdminConfig.save()&lt;br /&gt;[2010-0301-1150-2400] save:   Save complete!&lt;br /&gt;[2010-0301-1150-2500] wsadminlib.syncall Start&lt;br /&gt;[2010-0301-1150-2500] wsadminlib.syncall Sync config to node node1&lt;br /&gt;[2010-0301-1150-2600] wsadminlib.syncall Done&lt;br /&gt;0&lt;br /&gt;wsadmin&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-6342652974332803437?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/6342652974332803437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/6342652974332803437'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2010/03/how-to-save-my-changes.html' title='How to save my changes?'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-8918958197041212991</id><published>2010-03-29T08:41:00.000-07:00</published><updated>2010-04-01T12:17:38.698-07:00</updated><title type='text'>How to set the trace spec on a server?</title><content type='html'>Use wsadminlib's method setServerTrace().  Here is a simple example:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;nodename = 'node1'&lt;br /&gt;servername = 'server1'&lt;br /&gt;tracespec = '*=info:com.ibm.ws.sip.*=all'&lt;br /&gt;setServerTrace(nodename, servername, tracespec)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;And a screen capture:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;root@ding6: /opt/WAS70/bin/wsadmin.sh -lang jython -host ding6 -port 8879&lt;br /&gt;WASX7209I: Connected to process "dmgr" on node dmgr using SOAP connector;  The type of process is: DeploymentManager&lt;br /&gt;WASX7031I: For help, enter: "print Help.help()"&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;execfile('wsadminlib.py')&lt;br /&gt;$Id: wsadminlib.py 50 2009-01-14 14:42:11Z ding $&lt;br /&gt;wsadmin&gt;             &lt;br /&gt;wsadmin&gt;enableDebugMessages()&lt;br /&gt;[2010-0301-1149-3100] enableDebugMessages Verbose trace messages are now enabled; future debug messages will now be printed.&lt;br /&gt;wsadmin&gt;&lt;br /&gt;wsadmin&gt;nodename = 'node1'&lt;br /&gt;wsadmin&gt;servername = 'server1'&lt;br /&gt;wsadmin&gt;tracespec = '*=info:com.ibm.ws.sip.*=all'&lt;br /&gt;wsadmin&gt;setServerTrace(nodename, servername, tracespec)&lt;br /&gt;[2010-0301-1150-0800] setServerTrace: Setting tracing on server node1/server1 to *=info:com.ibm.ws.sip.*=all&lt;br /&gt;wsadmin&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Be sure to take a look at the method in wsadminlib.py.  It has defaults which you can override for the number and size of backup log files.  And on z/OS, it automatically stores the log files in the same location as they appear on non-Z platforms.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-8918958197041212991?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/8918958197041212991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/8918958197041212991'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2010/03/how-to-set-trace-spec-on-server.html' title='How to set the trace spec on a server?'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-1679413062891244386</id><published>2010-03-28T11:02:00.000-07:00</published><updated>2010-04-01T12:22:16.276-07:00</updated><title type='text'>What is this method sop()?</title><content type='html'>wsadminlib.py has a rudimentary trace/logging facility in method sop().  The name is a snarky acronym taken from Java's System.out.println() command.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Input: &lt;/span&gt;Method sop() takes two strings as parameters, the name of the calling method, and the message.  &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Output: &lt;/span&gt;Method sop() prints these to the console, along with a terse, internationally-understandable timestamp: [YYYY-MMDD-hhmm-ss00]&lt;br /&gt;&lt;br /&gt;You can turn these messages on and off dynamically by calling these toggle methods:&lt;br /&gt;- enableDebugMessages()&lt;br /&gt;- disableDebugMessages()&lt;br /&gt;sop() messages are disabled by default.  I like verbose messages, so all of my scripts call enableDebugMessages() right at the start.  &lt;br /&gt;&lt;br /&gt;Note that wsadminlib contains many calls to sop() which are commented-out.  These are usually very verbose messages which were written by the original method developer, but not needed since.  However, we left them in intentionally.  If you are having trouble making a specific method work, or you want to see the gory details for use in your own method, try uncommenting some of these messages for extra hints.&lt;br /&gt;&lt;br /&gt;Oh, and one more thing.  You can call method sop() from your own script files as well.  That way, your messages will have the same fancy timestamp as wsadminlib's, and your messages will look consistent with wsadminlib's too (which I find makes everything easier to read).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-1679413062891244386?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/1679413062891244386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/1679413062891244386'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2010/03/what-is-this-method-sop.html' title='What is this method sop()?'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-3046791667002579891</id><published>2010-03-27T09:17:00.000-07:00</published><updated>2010-04-01T13:03:56.697-07:00</updated><title type='text'>How to use wsadminlib.py</title><content type='html'>There are several ways to make use of wsadminlib.  Here are the basic ideas...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. Reference&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;If you are looking for the secrets of how to issue some command, browse wsadminlib and search for it.  We try to keep related methods together, so you should find similar functions nearby.  If you don't find what you need, search the entire file, case-insensitive.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2. Sample code&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;If you find something you like, feel free to copy/paste from wsadminlib to your own scripts.  wsadminlib is provided as a free sample.  And if you find something you don't like, feel free to copy and change it.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;3. Call from wsadmin shell&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You can call methods in wsadminlib directly from the wsadmin shell.  I find this really handy when I am setting up a one-time test.  For example, go to a command-prompt, and open a wsadmin connection to your deployment manager.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;root@ding6:~# /opt/WAS70/bin/wsadmin.sh  -lang jython  -host ding6  -port 8879&lt;br /&gt;WASX7209I: Connected to process "dmgr" on node dmgr using SOAP connector;  The type of process is: DeploymentManager&lt;br /&gt;WASX7031I: For help, enter: "print Help.help()"&lt;br /&gt;wsadmin&lt;/span&gt;&gt;&lt;br /&gt;&lt;br /&gt;Include wsadminlib.py:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;wsadmin&gt;execfile('/tmp/wsadminlib.py')&lt;br /&gt;$Id: wsadminlib.py 104 2010-02-15 19:06:18Z ding $&lt;br /&gt;wsadmin&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Call a method.  For example, list all the servers which exist.  This is handy for debug when running things manually:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;wsadmin&gt;serverStatus()&lt;br /&gt;Server status&lt;br /&gt;=============&lt;br /&gt;NODE dmgr on ding6 (linux) - Deployment manager&lt;br /&gt;NODE node1 on ding6 (linux)&lt;br /&gt; APPLICATION_SERVER fritzserver     stopped&lt;br /&gt; NODE_AGENT         nodeagent       running&lt;br /&gt; APPLICATION_SERVER server1         stopped&lt;br /&gt; APPLICATION_SERVER sippbx1         stopped&lt;br /&gt;APPLICATIONS:&lt;br /&gt; commsvc.pbx&lt;br /&gt; commsvc.testear&lt;br /&gt; fritzlet_ear&lt;br /&gt;wsadmin&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;4. Call from your own scripts&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I write my own small script files when I need to set up a complex configuration repeatedly, and don't want to keep typing the same commands over and over.  These scripts are small, because they call methods in wsadminlib.py to do all the work.  Here is a a simple example of a script which starts a server.  Create a python file like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;root@ding6:/tmp# cat wsadminlib.demo.py &lt;br /&gt;execfile('/tmp/wsadminlib.py')&lt;br /&gt;enableDebugMessages()&lt;br /&gt;&lt;br /&gt;# Start server1&lt;br /&gt;servername = 'server1'&lt;br /&gt;nodename = 'node1'&lt;br /&gt;startServer(nodename,servername)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Invoke it and watch the progress:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;root@ding6:/tmp# /opt/WAS70/bin/wsadmin.sh  -lang jython  -host ding6  -port 8879  -f /tmp/wsadminlib.demo.py &lt;br /&gt;WASX7209I: Connected to process "dmgr" on node dmgr using SOAP connector;  The type of process is: DeploymentManager&lt;br /&gt;$Id: wsadminlib.py 104 2010-02-15 19:06:18Z ding $&lt;br /&gt;[2010-0329-1341-2800] enableDebugMessages Verbose trace messages are now enabled; future debug messages will now be printed.&lt;br /&gt;[2010-0329-1341-2800] startServer: starting server node1,server1&lt;br /&gt;[2010-0329-1341-2800] startServer: startServer(server1,node1)&lt;br /&gt;[2010-0329-1341-4300] startServer: server node1,server1 not running yet, waiting another 15 secs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Looking at the wsadminlib source code, we see the startServer() method exits silently upon success, and raises a python exception if anything goes wrong.  Therefore, the server started successfully.  We also see that the method checks every so often to see if the server has started.  This provides reassurance that the script is still alive and just waiting for results, especially when you have a mix of fast and slow server machines.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-3046791667002579891?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/3046791667002579891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/3046791667002579891'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2010/03/how-to-use-wsadminlibpy.html' title='How to use wsadminlib.py'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4437168944596942363.post-6846001737259263139</id><published>2010-03-26T08:06:00.000-07:00</published><updated>2011-01-14T04:39:15.481-08:00</updated><title type='text'>Welcome to wsadminlib.py</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Overview&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;wsadminlib.py is a large python file containing hundreds of methods to help simplify configuring the IBM WebSphere Application Server (WAS) product using scripting.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Where do I get it?&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Click here&amp;nbsp;&lt;a href="http://www.ibm.com/developerworks/websphere/library/samples/SampleScripts.html"&gt;[&lt;b&gt;developerWorks&lt;/b&gt;]&lt;/a&gt;&amp;nbsp;and&amp;nbsp;search for 'wsadminlib'. &amp;nbsp;Its official name is "The IBM WebSphere Application Server Sample Script (wsadminlib.py package)".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Design goals&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;wsadminlib.py was designed to simplify configuration of the IBM WebSphere Application Server (WAS) product by providing much-improved understandability and ease-of-use.  The underlying scripting syntax for configuring the WAS product can be complex and challenging to understand.  The wsadminlib package was created to provide simple method names and simple parameter names, and hide the underlying nonsense.&lt;br /&gt;&lt;br /&gt;A wide variety of methods have been developed.  These methods perform tasks such as creating servers, starting servers, creating clusters, installing applications, proxies, core groups, core group bridge, dynacache, shared libraries, classloaders, replication domains, security, BLA, JDBC, etc, etc, etc.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;History&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt; wsadminlib.py was originally created in 2006 by two IBM product developers who were having trouble understanding the native wsadmin syntax. They were both encountering the same problems and both spending time researching the same solutions. They joined forces to split the work and share the benefits, and the original wsadminlib.py was born.&lt;br /&gt;&lt;br /&gt;By word of mouth, other teammates discovered the joys of wsadminlib, using it as both a code reference and in production. Eventually, many of these teammates began contributing new methods which they had researched and debugged, thus sharing solutions with others.&lt;br /&gt;&lt;br /&gt;Community interest grew steadily over time.  By 2010, several dozen people had contributed methods related to component areas they understood, and wsadminlib was being used in production by a good number of components in the current strategic agile automated test infrastructure.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Other script packages&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt; wsadminlib is one of many sample script packages available from IBM and others.  Here are some comparisons to guide your selection.  Pick your favorite.  Vive la difference.&lt;br /&gt;&lt;br /&gt;- The developers of wsadminlib like having everything in one monolithic file.   There is only one file to include, and only one place to search.   Other script developers prefer smaller files, organized in subdirectories,   in a more object-oriented fashion.&lt;br /&gt;&lt;br /&gt;- The developers of wsadminlib strive to write methods with self-documenting names,   and intuitively named parameters.  They write pydoc only when necessary.   Other script developers like to write verbose documentation.&lt;br /&gt;&lt;br /&gt;- Other packages may support multiple languages.  Wsadminlib is English-only.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Limitations&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt; - Error-handling is not consistent. Some methods raise python exceptions, others use a return code.&lt;br /&gt;&lt;br /&gt;- All wsadminlib methods work well on WAS V7 and V8 (beta).  Some methods work on V6.1, but not all have been tested. WAS 6.0.2 is unknown.&lt;br /&gt;&lt;br /&gt;- wsadminlib is not a formally-supported product.  It is provided as a sample, on an as-is basis.  The official disclaimer is in the prologue at the top of wsadminlib.py.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Summary&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt; wsadminlib has been very helpful to many of us inside IBM to speed development of configuration scripts and to run testcases. We hope you find something useful too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4437168944596942363-6846001737259263139?l=wsadminlib.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/6846001737259263139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4437168944596942363/posts/default/6846001737259263139'/><link rel='alternate' type='text/html' href='http://wsadminlib.blogspot.com/2010/03/blog-creation.html' title='Welcome to wsadminlib.py'/><author><name>sag</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_f4233sXILlw/SwNbcuxG-cI/AAAAAAAADxA/9Dh0dKk1JoE/S220/927959897.jpg'/></author></entry></feed>
