Creating a system diagnostics report
The PLA subsystem that you have been working with in this chapter has an additional kind of report that the PLA and PowerShell can generate, a System Diagnostic report. This report is simple to create and makes use of some of the approaches used in this chapter.
Getting ready
You run this recipe on server SRV1.
How to do it...
- Start the data collector on the local system:
$PerfReportName="System\System Diagnostics" $DataSet = New-Object -ComObject Pla.DataCollectorSet$DataSet.Query($PerfReportName,$null)$DataSet.Start($true)
- Wait for the data collector to finish:
Start-Sleep -Seconds $Dataset.Duration- Get the report and view it:
$Dataset.Query($PerfReportName,$null)$PerfReport = $Dataset.LatestOutputLocation + "\Report.html"& $PerfReport
How it works...
In step 1, you create a PLA.DataCollectorSet object and use it to query then start the Systems Diagnostics report. This report comes built into Windows, but you update it (or create customized reports if you...