Creating a system diagnostic report
The PLA subsystem that you have been working with in this chapter has an additional system-defined report known as the System Diagnostic Report. This report monitors a system for a period then provides a detailed report on the server.
Getting ready
You use the SRV1
server that you have used in other recipes in this chapter.
How to do it...
- Start the built-in data collector on the local system, which generates the report:
$PerfReportName="System\System Diagnostics" $DataSet = New-Object -ComObject Pla.DataCollectorSet $DataSet.Query($PerfReportName,$null) $DataSet.Start($true)
- Output a message, then wait for the data collector to finish:
"Sleeping for [$($Dataset.Duration)] seconds" Start-Sleep -Seconds $Dataset.Duration
- Get the report and save it as HTML:
$Dataset.Query($PerfReportName,$null) $PerfReport = $Dataset.LatestOutputLocation + "\Report.html"
- View the report:
& $PerfReport
How it works...
In step 1, you create a DataCollectorSet...