refactor(platform): harden LAB evidence and telemetry
This commit is contained in:
@@ -128,6 +128,15 @@ try {
|
||||
throw "Failed to apply the NDC service display name"
|
||||
}
|
||||
Set-Service -Name $serviceName -StartupType Automatic
|
||||
& sc.exe failure $serviceName reset= 86400 `
|
||||
actions= restart/5000/restart/30000/restart/60000 | Out-Null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Failed to configure Telegraf service recovery actions"
|
||||
}
|
||||
& sc.exe failureflag $serviceName 1 | Out-Null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Failed to enable Telegraf recovery for non-crash failures"
|
||||
}
|
||||
Start-Service -Name $serviceName
|
||||
$service = Get-Service -Name $serviceName
|
||||
$service.WaitForStatus([ServiceProcess.ServiceControllerStatus]::Running, [TimeSpan]::FromSeconds(20))
|
||||
@@ -140,6 +149,7 @@ try {
|
||||
DisplayName = $service.DisplayName
|
||||
Status = $service.Status.ToString()
|
||||
StartType = $service.StartType.ToString()
|
||||
RecoveryConfigured = $true
|
||||
Configuration = $configurationPath
|
||||
PipelineCollector = $collectorPath
|
||||
PipelineJournal = $PipelineJournal
|
||||
|
||||
Reference in New Issue
Block a user