May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Updating the Graceful Shutdown parameters through WLST script.

The script will help us to update the Graceful Shutdown parameter for the servers in the weblogic domain.

UpdateGracefulShutdownParameters.py

def conn(): 

try:               
adminURL=’t3://’+domainProps.get(‘domain1.AdminIP’)+’:’+domainProps.get(‘domain1.AdminPort’)
adminUserName=’weblogic’
adminPassword=domainProps.get(“domain1.AdminPasswd”)
connect(adminUserName, adminPassword, adminURL) 
except ConnectionException,e: 
print ‘Unable to find admin server…’ 
exit() 

def updateGraceFulShutdownTimings():
edit()
startEdit()
print
print ‘##############’
print ‘# Update Graceful Shutdown to 300 Seconds and ignore session true#’
print ‘##############’
print
for name in serverNames:
try:
print ‘Updating Server==>’+ name.getName()
cd(“/Servers/” + name.getName())
cmo.setGracefulShutdownTimeout(300)
cmo.setIgnoreSessionsDuringShutdown(true)
except WLSTException,e:
# this typically means the server is not active, just ignore
print ‘Exception While Update the attribute’
print ‘=========================================’
save()
activate()   

def quit(): 
disconnect() 
exit() 

if __name__== “main”: 
conn() 
serverNames = cmo.getServers() 
updateGraceFulShutdownTimings()
quit()

Execute the script:
cd %WLS_HOME%\common\bin
wlst.sh UpdateGracefulShutdownParameters.py

 

weblogicssrrerew-17

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>