remove_listener_ports.jacl
### ### remove_listener_ports.jacl ### ### ### ### ### proc remove_listener_ports {cname nname sname} { ### ### set up globals ### global AdminConfig global AdminControl global AdminApp set serverid [$AdminConfig getid /Cell:$cname/Node:$nname/Server:$sname/] if {[llength $serverid] == 0} { puts "Serverid null - Unable to set listener ports for $sname - returning " exit } ### ### Identify the message listener service belonging to the server ### set mls [$AdminConfig list MessageListenerService $serverid] if {[llength $mls] == 0} { puts "MessageListenerService id null - Unable to set listener ports for $sname - returning " exit } ### ### Get list of listener ports already configured ### and stop each if running ### set lPorts [$AdminControl queryNames type=ListenerPort,cell=$cname,node=$nname,process=$sname,*] foreach lPort $lPorts { puts "$lPort" set state [$AdminControl getAttribute $lport started] if {$state == "true"} { $AdminControl invoke $lPort stop } } ### ### Remove Message Listener Service entries ### puts $mls # $AdminConfig remove $mls # $AdminConfig save # set Sync1 [$AdminControl completeObjectName type=NodeSync,node=$nname,*] # set xstatus [$AdminControl invoke $Sync1 sync] # puts $xstatus # if {$xstatus == "false"} { # puts "Unable to synchronize..." # } } ### ### Main ### if { !($argc == 3) } { puts "" puts "Usage: " puts " " puts "wsadmin.sh -username system -password password -f remove_listener_ports.jacl cellname nodename servername" puts "" puts "For example: " puts " " puts "wsadmin.sh -username was -password acme@ -f remove_listener_ports.jacl hostnameNetwork hostname ops_1_1" } else { set xcell [lindex $argv 0] set xnode [lindex $argv 1] set xserver [lindex $argv 2] remove_listener_ports $xcell $xnode $xserver }