With this VBS Script you can Monitor Hyper-V Replica Health with the custom Advanced XML Sensor in Paessler PRTG.
https://prtg.paessler.com/api.htm?tabid=7
Replace server.domain.local with IP or DNS Name of your Hyper-V Server.
The PRTG Service Account needs to have Admin rights on Hyper-V Host (SYSTEM uses AD Computer Account to access remote Servers).
Save the VBS in “C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML” Folder.
Create a Custom EXE/Script Advanced Sensor and select the Script.
You have to install the Windows Management Framework 3.0 .
locstrServer = "server.domain.local" locstrText = "" locstrStatus = "" set objWshShell = CreateObject("WScript.Shell") wscript.echo "<?xml version=""1.0"" encoding=""Windows-1252"" ?>" wscript.echo "<prtg>" locstrCommand = "cmd /c powershell.exe Invoke-Command -ComputerName " & locstrServer & " -ScriptBlock { Get-VMReplication ^| where Health -eq 'Normal' ^| measure-object }" Set locobjExec = objWshShell.Exec(locstrCommand) Do While Not locobjExec.StdOut.AtEndOfStream locstrReadline = trim(locobjExec.StdOut.ReadLine()) locstrReadline = replace(locstrReadline, " ", "") if left(lcase(locstrReadline), len("count:")) = "count:" then wscript.echo "<result>" wscript.echo "<channel>Health Normal Count</channel>" locintcount = cint(replace(lcase(locstrReadline), "count:", "")) wscript.echo "<value>" & locintcount & "</value>" wscript.echo "<unit>Count</unit>" wscript.echo "</result>" end if Loop locstrCommand = "cmd /c powershell.exe Invoke-Command -ComputerName " & locstrServer & " -ScriptBlock { Get-VMReplication ^| where Health -eq 'Warning' ^| measure-object }" Set locobjExec = objWshShell.Exec(locstrCommand) Do While Not locobjExec.StdOut.AtEndOfStream locstrReadline = trim(locobjExec.StdOut.ReadLine()) locstrReadline = replace(locstrReadline, " ", "") if left(lcase(locstrReadline), len("count:")) = "count:" then wscript.echo "<result>" wscript.echo "<LimitMaxWarning>0</LimitMaxWarning>" wscript.echo "<LimitMode>1</LimitMode>" wscript.echo "<channel>Health Warning Count</channel>" locintcount = cint(replace(lcase(locstrReadline), "count:", "")) wscript.echo "<LimitWarningMsg>Hyper-V Replica(s) Health Warning!</LimitWarningMsg>" wscript.echo "<value>" & locintcount & "</value>" wscript.echo "<unit>Count</unit>" wscript.echo "</result>" end if Loop locstrCommand = "cmd /c powershell.exe Invoke-Command -ComputerName " & locstrServer & " -ScriptBlock { Get-VMReplication ^| where Health -eq 'Critical' ^| measure-object }" Set locobjExec = objWshShell.Exec(locstrCommand) Do While Not locobjExec.StdOut.AtEndOfStream locstrReadline = trim(locobjExec.StdOut.ReadLine()) locstrReadline = replace(locstrReadline, " ", "") if left(lcase(locstrReadline), len("count:")) = "count:" then wscript.echo "<result>" wscript.echo "<LimitMaxError>0</LimitMaxError>" wscript.echo "<LimitMode>1</LimitMode>" wscript.echo "<channel>Health Critical Count</channel>" locintcount = cint(replace(lcase(locstrReadline), "count:", "")) wscript.echo "<LimitErrorMsg>Hyper-V Replica(s) Health Critical!</LimitErrorMsg>" wscript.echo "<value>" & locintcount & "</value>" wscript.echo "<unit>Count</unit>" wscript.echo "</result>" end if Loop if locstrStatus <> "" then wscript.echo locstrStatus if locstrText <> "" then wscript.echo locstrText wscript.echo "</prtg>"