Best way to alert on Heart Beat Alert in Azure

Goce Dimitroski 41 Reputation points
2020-11-10T03:24:15.957+00:00

Hello,
We wish to start using Log Analytics to alert us when a VM is not reachable for over 5min.
We have several subscription . I have been looking into this and there are so many ways to achieve this.
Setting up an Alert rule
Setting up Logic Apps
Setting up Workbook.

In the example I have seen there is a simple query

Heartbeat
| summarize max(TimeGenerated) by Computer
| where max_TimeGenerated > ago(5m)

But when I run the query over and set it for the past 30min I get over 400 Vm's. Which is wrong.

We are trying to do is, so to alert us when a vm has not heartbeat or maybe no network connectivity for over 5min.
This is so easy to do in SCOM . Why is it so complicated in Azure ?

We are able to set up alert rule when a vm has high CPU 90% for longer than 5min. This works great.

Any ideas

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,829 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Clive Watson - MSFT 106 Reputation points
    2020-11-10T16:40:22.96+00:00

    // Not reporting VMs
    // VMs that have not reported a heartbeat in the last 5 minutes.
    // To create an alert for this query, click '+ New alert rule'
    Heartbeat
    | where TimeGenerated > ago(24h)
    | summarize LastCall = max(TimeGenerated) by Computer
    | where LastCall < ago(5m)


  2. Khurram Rahim 1,841 Reputation points
    2020-11-10T17:14:14.997+00:00

    http://contoso.se/blog/?p=4532

    Please find answer hope you will find step by step guide hope answer the question

    If issue resolve don't forget to accept answer and upvote.

    0 comments No comments

  3. Goce Dimitroski 41 Reputation points
    2020-11-10T21:45:39.3+00:00

    With all of these it is not in real time ? Azure needs to read the logs ?


  4. Onur Pekdağ 6 Reputation points
    2021-08-25T09:18:17.537+00:00

    another an option to be create resource health alert for virtual machines without cost and log analytics workspace

    0 comments No comments