I am trying to use PRTG to monitor Delivery Optimization performance across the Windows 10 PCs on my LAN utlising the powershell cmdlets -
Get-DeliveryOptimizationPerfSnap & Get-DeliveryOptimizationStatus
Using a custom sensor (advanced) I know that I need to generate XML formatted output but this is where I am stuggling.
I have a PS1 script called by the custom sensor as follows that just doesn't seem to be doing it.
$x = Get-DeliveryOptimizationPerfSnap -verbose | ConvertTo-Xml $x.objects.Object
I get the error "XML: The returned XML does not match the expected schema. (code: PE233) -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)"
Can anyone point me in the right direction as I don't have much experience with PowerShell.
Sure, most users leverage the Write-Host command to control the output from the ps1 file.
Here is an example from another PowerShell sensor.
Write-Host "<prtg>" Write-Host "<result>" Write-Host "<channel>Locked Out Users</channel>" Write-Host "<value>"+ $a +"</value>" Write-Host "</result>" Write-Host "</prtg>"
Feb, 2018 - Permalink