Forum Discussion
PFaria1978
Jun 01, 2021Copper Contributor
VM Execution Time reached
Hello, I'm working on a query to create an alert when a VM has been up and running for more the 8 hours. I'm trying to achieve that using the Heartbeat. My idea is to have a query that validates t...
Seshadrr
Jun 02, 2021Iron Contributor
Check whether below query will be satisfy your requirement and also suggesting you to set the Azure Alert based on the response to have automated mail alert or Webhook or azure function to cut ticket system.
Heartbeat
| summarize max(TimeGenerated) by Computer
| where max_TimeGenerated > ago(8h)
Heartbeat
| summarize max(TimeGenerated) by Computer
| where max_TimeGenerated > ago(8h)
PFaria1978
Jun 03, 2021Copper Contributor
Seshadrr That query only shows the most recent heartbeat per VM on the last 8 hours. Doesn't mean that it has been reporting heartbeats for 8hours straight.
I'm trying to know if the VM was running 8h straight. It's not expected to be up an running so long. We need to be alerted in the case of the VM is still running after 8h.
Thanks.