Forum Discussion

ScottAllison's avatar
ScottAllison
Iron Contributor
Apr 15, 2019
Solved

Alerting on Heartbeat issue

Surely there is a better solution for this? My use case doesn't work:   1. Create a computer group 2. Alert when an agent in computer group has not "heartbeated" for over 24 hours.    By the log...
  • CliveWatson's avatar
    Apr 15, 2019

    ScottAllison 

     

    Alerts are designed to look back on 24hrs as you state 

     

    For a report of this nature, I'd suggest a Logic App, something like this mock up?  This fires at a pre-set time (recurrence), then runs your query, then sends an email (you could send to teams/Slack/ServiceNow etc.. instead or in parallel)

     

     

    I also like the example availability rate query:

    // Availability rate
    // Calculate the availability rate of each connected computer
    Heartbeat
    // bin_at is used to set the time grain to 1 hour, starting exactly 24 hours ago
    | summarize heartbeatPerHour = count() by bin_at(TimeGenerated, 1h, ago(24h)), Computer
    | extend availablePerHour = iff(heartbeatPerHour > 0, true, false)
    | summarize totalAvailableHours = countif(availablePerHour == true) by Computer 
    | extend availabilityRate = totalAvailableHours*100.0/24
    | project-away totalAvailableHours 
    | render barchart 

    Note: I added the last two lines, as I prefer how it looks as a chart