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

WSCP script to automate WebSphere Enterprise App Startup. Called from Windows shell script. Also displays time taken to start Enterprise App.

Tcl, 56 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
@echo off

echo ****************************************
echo * start WSAPP Enterprise App on %COMPUTERNAME%
echo ****************************************

setlocal

set ENTAPP=/EnterpriseApp:WSAPP/

call wscp -p c:\scripts\websphere\wscp_properties.txt ^
          -f c:\scripts\tcl\start_ent_app.tcl ^
          -- %ENTAPP%

endlocal

--------------------------------------------------------

# 
#
# start Enterprise Applications
# 

set startTime [clock seconds]

if {$argc < 0} {
        error "no arguments"
}

set entApp [lindex $argv 0]

puts "starting Enterprise App $entApp"

if {[catch {EnterpriseApp start $entApp} result_var] ==0}  {
       puts $result_var
       puts "$entApp started successfully"
   } else {  
	   puts $result_var
	   error "$entApp failed to start"
   }
   
set status [EnterpriseApp show $entApp -attribute {Name CurrentState}]

puts "status = $status" 

set endTime [clock seconds] 

set startTimestamp [clock format $startTime -format %H:%M.%S]
set endTimestamp [clock format $endTime -format %H:%M.%S]
set startUpTime [expr {$endTime - $startTime}]
set startUpTimeFormat [clock format $startUpTime -format %M.%S]

puts " "
puts "Start Timestamp = $startTimestamp"
puts "End Timestamp   = $endTimestamp"
puts "Startup time    = $startUpTimeFormat"

Automate Enterprise App Startup.

Created by Patrick Finnegan on Tue, 1 Oct 2002 (MIT)
Tcl recipes (162)
Patrick Finnegan's recipes (10)

Required Modules

  • (none specified)

Other Information and Tasks