Welcome, guest | Sign In | My Account | Store | Cart

Display running servers on WAS node.

Called from WSAdmin bat file.

@echo off

echo ################################################### echo # Display WAS application servers on %COMPUTERNAME% echo ###################################################

command.com /c

call wsadmin -username cccccc^ -password cccccc^ -f d:\scripts\websphere\JACL\displayServers.tcl

Tcl, 38 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
####################################################################
# List Servers 
###################################################################

set cells [$AdminConfig list Cell ] 

foreach cell $cells {

   set nodes [$AdminConfig list Node $cell ]

   foreach node $nodes {
      set cname [$AdminConfig showAttribute $cell name ]
      set nname [$AdminConfig showAttribute $node name ]
      set servs [$AdminControl queryNames type=Server,cell=$cname,node=$nname,*]

      puts "\nNumber of running servers on node $nname:[llength $servs ]\n"

      foreach server $servs {
         set sname [$AdminControl getAttribute $server name ]
         set ptype [$AdminControl getAttribute $server processType ]
         set pid   [$AdminControl getAttribute $server pid ]
         set state [$AdminControl getAttribute $server state ]
         set jvm   [$AdminControl queryNames type=JVM,cell=$cname,node=$nname,process=$sname,*]
         set osname [$AdminControl invoke $jvm getProperty os.name ]

         puts "\n   $sname ($ptype)has pid $pid; state:$state;on $osname\n"

         set apps  [$AdminControl queryNames type=Application,cell=$cname,node=$nname,process=$sname,*]

         puts "\n     Number of applications running on $sname:[llength $apps ]\n"

         foreach app $apps { set aname [$AdminControl getAttribute $app name ]
			     puts "     $aname"
         }
         puts "\n     -------\n"
      }
   }
}
Created by Patrick Finnegan on Sun, 19 Sep 2004 (MIT)
Tcl recipes (162)
Patrick Finnegan's recipes (56)

Required Modules

  • (none specified)

Other Information and Tasks