# How can I have a problem opened for shutdown of Azure VM?

**URL:** <https://community.dynatrace.com/t/how-can-i-have-a-problem-opened-for-shutdown-of-azure-vm/31595>\
**Category:** Alerting\
**Tags:** problem-detection, azure, problems-classic\
**Created:** [May 26, 2021, 2:12am UTC](https://community.dynatrace.com/t/how-can-i-have-a-problem-opened-for-shutdown-of-azure-vm/31595 "2021-05-26T02:12:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_AM](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@The\_AM](https://community.dynatrace.com/u/The_AM)\
**Post date:** [May 26, 2021, 2:12am UTC](https://community.dynatrace.com/t/how-can-i-have-a-problem-opened-for-shutdown-of-azure-vm/31595/1 "2021-05-26T02:12:01Z")

</div>

**I have two hosts. One on VMware, another on Azure VM.**

If I have my environment set to **“alert on graceful host shutdown”,** then stopping the VM on VMware will cause a problem to be opened.

 ![The_AM_1-1621995063247.png](https://global.discourse-cdn.com/dynatrace/original/3X/2/e/2e657a0429b4f7e201d01a79275a1d53bce7d603.png)

If I stop the VM in Azure Portal, no alert is created. Only the message OneAgent stopped for 2 minutes appears in the host view.

 ![The_AM_0-1621994972355.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/9/39a9c892be8fe970c2d0185bdb58cf3af6c8d830.png)

Why is this? I need to see problem generated for Azure VM being shutdown, regardless if graceful or not.

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [June 4, 2021, 6:52pm UTC](https://community.dynatrace.com/t/how-can-i-have-a-problem-opened-for-shutdown-of-azure-vm/31595/2 "2021-06-04T18:52:08Z")

</div>

make sure the detection settings are the same for each hosts. Sometimes these are also set at the HG level or the Global Level. We are always alerted when a host gets shutdown. Also there might be a bit of a delay, even after 5 mins you don’t get an alert? Is an alert raised in the UI?

---

<div class="post-metadata">

**Author:** ![The\_AM](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@The\_AM](https://community.dynatrace.com/u/The_AM)\
**Post date:** [June 6, 2021, 9:29pm UTC](https://community.dynatrace.com/t/how-can-i-have-a-problem-opened-for-shutdown-of-azure-vm/31595/3 "2021-06-06T21:29:06Z")

</div>

Hi [@ChadTurner](https://community.dynatrace.com/user/14877) , settings were correct, and it wasn’t missed due to delay.

There’s an explanation that actually Azure VMs will stop the OneAgent service before the OS shutdown signal could be caught and sent by OneAgent. Therefore, this just looks like an agent shutdown only to Dynatrace and it does nothing with those events.

I’d prefer if Dynatrace treated agent service shutdowns as “monitoring unavailable” events.

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [June 7, 2021, 7:54pm UTC](https://community.dynatrace.com/t/how-can-i-have-a-problem-opened-for-shutdown-of-azure-vm/31595/4 "2021-06-07T19:54:08Z")

</div>

You might need to put in a RFE for that then so Dynatrace can see about building in functionality for your request.

---

<div class="post-metadata">

**Author:** ![The\_AM](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@The\_AM](https://community.dynatrace.com/u/The_AM)\
**Post date:** [December 20, 2021, 12:09am UTC](https://community.dynatrace.com/t/how-can-i-have-a-problem-opened-for-shutdown-of-azure-vm/31595/5 "2021-12-20T00:09:03Z")

</div>

There is an events API that allows you to **‘mark for termination’** an instance. So that could be utilised, but I have not so far attempted to build this solution.

Links:

- [Info events — Dynatrace Docs](https://www.dynatrace.com/support/help/shortlink/event-types-info#marked-for-termination)
- [Events API v2 - POST an event — Dynatrace Docs](https://www.dynatrace.com/support/help/shortlink/api-events-v2-post-event#examples)

---

<div class="post-metadata">

**Author:** ![sergei\_bondar](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@sergei\_bondar](https://community.dynatrace.com/u/sergei_bondar)\
**Post date:** [May 29, 2023, 2:08pm UTC](https://community.dynatrace.com/t/how-can-i-have-a-problem-opened-for-shutdown-of-azure-vm/31595/6 "2023-05-29T14:08:01Z")

</div>

Hello, I have the same problems with Azure VM. Have anybody managed to solve it?
