How to set up alerts for Test Failover and Agent status in Azure Site Recovery Service

Karan Bhatt 0 Reputation points
2024-07-01T12:51:55.9366667+00:00

Hello,

I am currently exploring Azure Recovery Services and I would like to know if there is a way to set up an alert for "Last Successful Test Failover" when it is in warning state. Additionally, I want to know if alerts can be set up when the Agent status is "unhealthy" or "Warning". Can anyone guide me on how to achieve this?

Thank you in advance.

Azure Site Recovery
Azure Site Recovery
An Azure native disaster recovery service. Previously known as Microsoft Azure Hyper-V Recovery Manager.
671 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SadiqhAhmed-MSFT 40,291 Reputation points Microsoft Employee
    2024-07-01T15:32:48.7033333+00:00

    Hello @Karan Bhatt Thank you for posting your question on Microsoft Q&A platform. Happy to help!

    From your post, I understand that you want to set up alerts for Test Failover and Agent status in Azure Site Recovery Service.

    Yes, you can set up alerts for "Last Successful Test Failover" and for the agent status in Azure Recovery Services. Here's how you can achieve this:

    1. Set up a Log Analytics workspace: To set up alerts for Azure Recovery Services, you need to create a Log Analytics workspace. This workspace will collect and analyze the data from your Azure Recovery Services vault.
    2. Configure data collection: Once you have set up the Log Analytics workspace, you need to configure data collection for your Azure Recovery Services vault. This will allow the workspace to collect data about your vault, including the "Last Successful Test Failover" and agent status.
    3. Create an alert rule: After you have configured data collection, you can create an alert rule in the Log Analytics workspace. You can create an alert rule for "Last Successful Test Failover" by using the following query:

    AzureDiagnostics | where Category == "SiteRecoveryVaultEvents"

    | where OperationName == "TestFailoverCleanupSucceeded"

    | where Result == "Succeeded"

    | summarize arg_max(TimeGenerated, *) by ResourceId

    This query will return the last successful test failover for each Azure Recovery Services vault. You can then set up an alert rule to trigger when the "Last Successful Test Failover" is in a warning state.

    To create an alert rule for the agent status, you can use the following query:

    AzureDiagnostics | where Category == "SiteRecoveryVaultEvents"

    | where OperationName == "AgentStatusChanged"

    | where Result == "Warning" or Result == "Unhealthy"

    | summarize arg_max(TimeGenerated, *) by ResourceId

    This query will return the last agent status change for each Azure Recovery Services vault. You can then set up an alert rule to trigger when the agent status is in a warning or unhealthy state.

    Reference doc: https://video2.skills-academy.com/en-us/azure/site-recovery/site-recovery-monitor-and-troubleshoot

    Hope this helps. If you have any further questions, do let us know.


    If the response helped, do "Accept Answer" and up-vote it

    0 comments No comments