JACL script to Stop Start server and list all server function

IBM WebSphere Application Server
#---------------------------------------------------------------
#-- stop start server
#---------------------------------------------------------------

proc chk_stopstartserver {} {
	
	
	puts "Starting server $serverName"
	set start [$AdminControl startServer $serverName $nodeName]
	puts " $start"
	puts "Stopping server $serverName."
	set stop [$AdminControl stopServer $serverName]
	puts "$stop"
	
	}

#----------------------------------------------------------------
#-- list all servers -- noparams
#----------------------------------------------------------------
proc listall_servers {} {
	
	set servers [$AdminConfig list Server]
	puts "There are [llength $servers] application servers:"
	foreach aServer $servers {
	puts $aServer
	}}

#----------------------------------------------------------------
#-- Start all servers -- nodeName param req.
#----------------------------------------------------------------
proc startall_servers {} {
	global ScriptLocation;  source "$ScriptLocation/Definitions.jacl"

	set servers [$AdminConfig getid /Node:$nodeName/Server:/]
	foreach aServer $servers {
	#identify server name
	set serverName [$AdminConfig showAttribute $aServer name]
	$AdminControl startServer $serverName $nodeName
	}}

In case of any ┬ęCopyright or missing credits issue please check CopyRights page for faster resolutions.

Leave a Reply