Hi All,
I created the below launch.ps1 script to launch filer specific scripts (each script only gets info from one controller) so that I can gather data from all my storage controllers at the same time and then write to individual log files for that storage controller.
My issue right now is that the scripts launch but then stalls (no output to my log file) when calling on the Connect-NaController cmdlet. From that point on nothing else is executed.
What can I do to debug this issue? Is thread safety an issue here?
TIA
Eugene
# --------------------------------------------------------------------------
# PS script to launch all my scripts so they run in parallel
"Starting"
Get-Job | Remove-Job
$job1 = Start-Job -Filepath d:\scripts\filer1.ps1
$job2 = Start-Job -Filepath d:\scripts\filer2.ps1
$job3 = Start-Job -Filepath d:\scripts\filer3.ps1
$exit = $false
while ($exit -eq $false)
{
$a = @(Get-Job -State Running).count
"$a jobs are currently running."
if ($a -eq $true){$exit = $true}
sleep -Seconds 60
}
"Finished"
}
# ---------------------------------------------------------------------
# An example of the self contained scripts that are launched
Import-Module DataONTAP
function Connect2Filer
{ #code }
function GetDriveCountInformation
{ #code }
# MAIN
$filer = "ztop.somewhere.com"
$cs = Connect2Filer $filer
$dci = GetDriveCountInformation
$dci | out-file -filepath c:\temp\ztop.log -Append
Ok ... guys I could not get the above code to work (XP and W2K3) and did not have the time to figureout why. I did a work around by replicating my scripts for each of my storage controllers. I then used a batch file to kick them all off so they would run in their own. Not pretty but it works
kickoff.bat
---------------------------------------------------------------------------
start "controller 1" powershell .\myscript.controller1.ps1
start "controller 2" powershell .\myscript.controller2.ps1
start "controller 3" powershell .\myscript.controller3.ps1
start "controller 4" powershell .\myscript.controller4.ps1
---------------------------------------------------------------------------