{"id":4661,"date":"2015-04-26T20:24:57","date_gmt":"2015-04-26T12:24:57","guid":{"rendered":"http:\/\/rmohan.com\/?p=4661"},"modified":"2015-04-26T20:24:57","modified_gmt":"2015-04-26T12:24:57","slug":"updating-the-graceful-shutdown-parameters-through-wlst-script","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=4661","title":{"rendered":"Updating the Graceful Shutdown parameters through WLST script."},"content":{"rendered":"<p>The script will help us to update the Graceful Shutdown parameter for the servers in the weblogic domain.<\/p>\n<p><b>UpdateGracefulShutdownParameters.py<\/b><\/p>\n<p>def conn():<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>try: \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<span class=\"Apple-converted-space\">\u00a0<\/span><br \/>\nadminURL=&#8217;t3:\/\/&#8217;+domainProps.get(&#8216;domain1.AdminIP&#8217;)+&#8217;:&#8217;+domainProps.get(&#8216;domain1.AdminPort&#8217;)<br \/>\nadminUserName=&#8217;weblogic&#8217;<br \/>\nadminPassword=domainProps.get(&#8220;domain1.AdminPasswd&#8221;)<br \/>\nconnect(adminUserName, adminPassword, adminURL)<span class=\"Apple-converted-space\">\u00a0<\/span><br \/>\nexcept ConnectionException,e:<span class=\"Apple-converted-space\">\u00a0<\/span><br \/>\nprint &#8216;Unable to find admin server&#8230;&#8217;<span class=\"Apple-converted-space\">\u00a0<\/span><br \/>\nexit()<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>def updateGraceFulShutdownTimings():<br \/>\nedit()<br \/>\nstartEdit()<br \/>\nprint<br \/>\nprint &#8216;##############&#8217;<br \/>\nprint &#8216;# Update Graceful Shutdown to 300 Seconds and ignore session true#&#8217;<br \/>\nprint &#8216;##############&#8217;<br \/>\nprint<br \/>\nfor name in serverNames:<br \/>\ntry:<br \/>\nprint &#8216;Updating Server==&gt;&#8217;+ name.getName()<br \/>\ncd(&#8220;\/Servers\/&#8221; + name.getName())<br \/>\ncmo.setGracefulShutdownTimeout(300)<br \/>\ncmo.setIgnoreSessionsDuringShutdown(true)<br \/>\nexcept WLSTException,e:<br \/>\n# this typically means the server is not active, just ignore<br \/>\nprint &#8216;Exception While Update the attribute&#8217;<br \/>\nprint &#8216;=========================================&#8217;<br \/>\nsave()<br \/>\nactivate() \u00a0<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>def quit():<span class=\"Apple-converted-space\">\u00a0<\/span><br \/>\ndisconnect()<span class=\"Apple-converted-space\">\u00a0<\/span><br \/>\nexit()<span class=\"Apple-converted-space\">\u00a0<\/span><\/p>\n<p>if __name__== &#8220;main&#8221;:<span class=\"Apple-converted-space\">\u00a0<\/span><br \/>\nconn()<span class=\"Apple-converted-space\">\u00a0<\/span><br \/>\nserverNames = cmo.getServers()<span class=\"Apple-converted-space\">\u00a0<\/span><br \/>\nupdateGraceFulShutdownTimings()<br \/>\nquit()<\/p>\n<p>Execute the script:<br \/>\ncd %WLS_HOME%\\common\\bin<br \/>\nwlst.sh\u00a0<b>UpdateGracefulShutdownParameters.py<\/b><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2015\/04\/weblogicssrrerew-17.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4662\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2015\/04\/weblogicssrrerew-17.jpg\" alt=\"weblogicssrrerew-17\" width=\"750\" height=\"519\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2015\/04\/weblogicssrrerew-17.jpg 750w, https:\/\/mohan.sg\/wp-content\/uploads\/2015\/04\/weblogicssrrerew-17-300x208.jpg 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2015\/04\/weblogicssrrerew-17-150x104.jpg 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2015\/04\/weblogicssrrerew-17-400x277.jpg 400w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The script will help us to update the Graceful Shutdown parameter for the servers in the weblogic domain.<\/p>\n<p>UpdateGracefulShutdownParameters.py<\/p>\n<p>def conn(): <\/p>\n<p>try: adminURL=&#8217;t3:\/\/&#8217;+domainProps.get(&#8216;domain1.AdminIP&#8217;)+&#8217;:&#8217;+domainProps.get(&#8216;domain1.AdminPort&#8217;) adminUserName=&#8217;weblogic&#8217; adminPassword=domainProps.get(&#8220;domain1.AdminPasswd&#8221;) connect(adminUserName, adminPassword, adminURL) except ConnectionException,e: print &#8216;Unable to find admin server&#8230;&#8217; exit() <\/p>\n<p>def updateGraceFulShutdownTimings(): edit() startEdit() print print &#8216;##############&#8217; print &#8216;# Update Graceful Shutdown to 300 Seconds and [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4661"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4661"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4661\/revisions"}],"predecessor-version":[{"id":4663,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4661\/revisions\/4663"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}