Skip to main content

HyperV - Replication State Monitoring

Summary

This monitor generates alerts for HyperV host virtual machines with replication states of Warning or Critical.

Dependencies

Monitor Setup Location

Monitors Path: ENDPOINTS -> Alerts -> Monitors

Monitor Summary

  • Name: HyperV - Replication State Monitoring
  • Description: This monitor generates alerts for HyperV host virtual machines with replication states of Warning or Critical.
  • Type: Script
  • Severity: Others
  • Family: Hyper-V

Image1

Targeted Resources

  • Target Type: Device Groups
  • Group Name: HyperV Replication State Monitoring

Image2

Conditions

  • Run Script on: Schedule
  • Repeat every: 15 Minutes
  • Script Language: PowerShell
  • Use Generative AI Assist for script creation: False
  • PowerShell Script Editor:
$ProgressPreference = 'SilentlyContinue'
$WarningPreference = 'SilentlyContinue'

if (-not (Get-Service -Name 'vmms' -ErrorAction SilentlyContinue)) {
return 'The Hyper-V Virtual Machine Management Service (vmms) is not found. This system is not a Hyper-V host.'
}

$output = @()
try {
$vms = Get-VM -ErrorAction Stop |
Where-Object -FilterScript {
$_.ReplicationState -ne 'Disabled'
}

if ($vms) {
foreach ($vm in $vms) {
$replicationState = Get-VMReplication -VMName $vm.VMName -ErrorAction Stop

if ($replicationState -in ('Critical', 'Warning')) {
$output += ('{0} replication state: {1}' -f $vm.VMName, $replicationState)
}
}

if ($output -match 'replication state') {
return ('Detected issues with replication state:{0}{1}' -f [Environment]::NewLine, ($output -join [Environment]::NewLine))
}

return 'Replication state is Healthy'

}

return 'Replication not enabled for any VM'

} catch {
return ('Script Failed to run properly. Reason: {0}' -f $Error[0].Exception.Message)
}
  • Criteria: Contains
  • Operator: AND
  • Script Output: Detected issues with replication state
  • Escalate ticket on script failure: False
  • Add Automation: NONE

Image3

Ticket Resolution

Automatically resolve: False

Image4

Monitor Output

Output: Generate Ticket

Image5

Completed Monitor

Image6

Changelog

2026-06-17

  • Initial version of the document