Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gather CAU orch, wmi and wua logs if not running in "FullLanguage" mode #180

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 56 additions & 8 deletions PrivateCloud.DiagnosticInfo/PrivateCloud.DiagnosticInfo.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2014,16 +2014,22 @@ function Get-SddcDiagnosticInfo
catch { Show-Warning("Unable to get Cluster Quorum. `nError="+$_.Exception.Message) }
}

$JobStatic += start-job -Name CauDebugTrace {
$JobStatic += start-job -Name CauDebugTrace -initializationScript $commonFunc {
try {

# SCDT returns a fileinfo object for the saved ZIP on the pipeline; discard (allow errors/warnings to flow as normal)
$parameters = (Get-Command Save-CauDebugTrace).Parameters.Keys
if ($parameters -contains "FeatureUpdateLogs") {
$null = Save-CauDebugTrace -Cluster $using:AccessNode -FeatureUpdateLogs All -FilePath $using:Path
if ($executionContext.SessionState.LanguageMode -eq "FullLanguage")
{
# SCDT returns a fileinfo object for the saved ZIP on the pipeline; discard (allow errors/warnings to flow as normal)
$parameters = (Get-Command Save-CauDebugTrace).Parameters.Keys
if ($parameters -contains "FeatureUpdateLogs") {
$null = Save-CauDebugTrace -Cluster $using:AccessNode -FeatureUpdateLogs All -FilePath $using:Path
}
else {
$null = Save-CauDebugTrace -Cluster $using:AccessNode -FilePath $using:Path
}
}
else {
$null = Save-CauDebugTrace -Cluster $using:AccessNode -FilePath $using:Path
else
{
Show-Update "Skipping CauDebugTrace because cannot run Save-CAUDebugTrace in constrained language mode."
}
}
catch { Show-Warning("Unable to get CAU debug trace. `nError="+$_.Exception.Message) }
Expand Down Expand Up @@ -2132,6 +2138,48 @@ function Get-SddcDiagnosticInfo
}
}

$JobGather += Invoke-CommonCommand -ClusterNodes $($ClusterNodes).Name -JobName 'CAU log files' -SessionConfigurationName $SessionConfigurationName -InitBlock $CommonFunc {
try {
if ($executionContext.SessionState.LanguageMode -ne "FullLanguage") {
# discover CAU orchestrator log files
$dirs = @()
Get-ChildItem "REGISTRY::HKEY_USERS\" | ForEach-Object {
$regName = "REGISTRY::" + $_.Name + "\SOFTWARE\Microsoft\Windows\CurrentVersion\ClusterAwareUpdating\"
$regKey = Get-ItemProperty -Path $regName -ErrorAction SilentlyContinue
if ($regKey) {
$dirs += $regKey.DebugTraceDir
}
}
$dirs | Select-Object -Unique | ForEach-Object {
NewCopyTask -Delete:$false (Get-AdminSharePathFromLocal $env:COMPUTERNAME $_)
}
}
}
catch { Show-Warning("Exception in CAU log files script block. `nError="+$_.Exception.Message) }
}

$JobGather += Invoke-CommonCommand -ClusterNodes $($ClusterNodes).Name -JobName 'CAU wmi files' -SessionConfigurationName $SessionConfigurationName -InitBlock $CommonFunc {
try {
if ($executionContext.SessionState.LanguageMode -ne "FullLanguage") {
# discover CAU wmi log files and add them to their own zip
$sourceDir = Join-Path $env:SystemRoot "System32\LogFiles\ClusterUpdate"
NewCopyTask -Delete:$false (Get-AdminSharePathFromLocal $env:COMPUTERNAME $sourceDir)
}
}
catch { Show-Warning("Exception in CAU wmi files script block. `nError="+$_.Exception.Message) }
}

$JobGather += Invoke-CommonCommand -ClusterNodes $($ClusterNodes).Name -JobName 'CAU wua files' -SessionConfigurationName $SessionConfigurationName -InitBlock $CommonFunc {
try {
if ($executionContext.SessionState.LanguageMode -ne "FullLanguage") {
# collect windows update agent logs
$sourceDir = Join-Path $env:WINDIR "Logs\WindowsUpdate"
NewCopyTask -Delete:$false (Get-AdminSharePathFromLocal $env:COMPUTERNAME $sourceDir)
}
}
catch { Show-Warning("Exception in CAU log files script block. `nError="+$_.Exception.Message) }
}

if ($IncludeProcessDump) {

$JobGather += Invoke-CommonCommand -ClusterNodes $($ClusterNodes).Name -JobName ProcessDumps -SessionConfigurationName $SessionConfigurationName -InitBlock $CommonFunc -ArgumentList $ProcessLists {
Expand Down