以下の例は、WebSphere Application Server V4.0 および V6.x で稼働中の サーバー・グループをリスト表示する方法を示したものです。
以下の例を使用してください。
set groups [ServerGroups list] foreach sgroup $groups { set thestate [ServerGroup show $sgroup -attribute {Name CurrentState} puts $thestate }
set clusters [$AdminControl queryNames type=Cluster,*] foreach scluster $clusters { set thestate [$AdminControl getAttributes $scluster {clusterName state}] puts $scluster $thestate }
# get line separator import java.lang.System as sys lineSeparator = sys.getProperty('line.separator') clusters = AdminControl.queryNames('type=Cluster,*').split(lineSeparator) for scluster in clusters: thestate = AdminControl.getAttributes(scluster, ['clusterName', 'state']) print scluster + " " + thestate + "¥n"