# Create an alert based on the disk consumption in the last 2 hours.

**URL:** <https://community.dynatrace.com/t/create-an-alert-based-on-the-disk-consumption-in-the-last-2-hours/48895>\
**Category:** Open Q&A\
**Tags:** dql, disks, infrastructure-operations\
**Created:** [November 14, 2024, 1:06pm UTC](https://community.dynatrace.com/t/create-an-alert-based-on-the-disk-consumption-in-the-last-2-hours/48895 "2024-11-14T13:06:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![andresjavier](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@andresjavier](https://community.dynatrace.com/u/andresjavier)\
**Post date:** [November 14, 2024, 1:06pm UTC](https://community.dynatrace.com/t/create-an-alert-based-on-the-disk-consumption-in-the-last-2-hours/48895/1 "2024-11-14T13:06:37Z")

</div>

Hi Community!.

I’ve a case where the disk D:\ of a bunch of Citrix Servers are being filled up quickly and sometimes when we’re received the alert of disk usage it’s too late and the services stop responding.

Then, we would like to setup an alert based on the % of disk usage in the last 2 hours. For example, if the disk usage increase in 40% in the last 2 hours trigger an alert.

They already have a similar alert configured in splunk, but I would like to do the same in Dynatrace.

See below the splunk alert currently in place:

index=perfmon host=jwppxdsh\* sourcetype=“Perfmon:FreeDiskSpace” instance=“C:” OR instance=“D:” counter=“% Free Space” instance!=\_\* instance!=Hard\* earliest=-2h

| stats min(Value) AS min,first(Value) AS first by host,instance

| eval Percent-Size-Change=first-min

| search Percent-Size-Change\>=40

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [November 14, 2024, 2:21pm UTC](https://community.dynatrace.com/t/create-an-alert-based-on-the-disk-consumption-in-the-last-2-hours/48895/2 "2024-11-14T14:21:41Z")

</div>

Hi,

You can use new [Disk Edge alerting](https://docs.dynatrace.com/docs/shortlink/host-monitoring#disk-edge).

Instead 2 hours, set how many 10 seconds window should be under your threeshold.

Best regards

---

<div class="post-metadata">

**Author:** ![DynaWiz](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@DynaWiz](https://community.dynatrace.com/u/DynaWiz)\
**Post date:** [November 14, 2024, 2:32pm UTC](https://community.dynatrace.com/t/create-an-alert-based-on-the-disk-consumption-in-the-last-2-hours/48895/3 "2024-11-14T14:32:32Z")

</div>

Hello&nbsp;[@andresjavier](https://community.dynatrace.com/user/51328),

you can achieve this result by creating custom metric selector:

builtin:host.disk.free:splitBy():sort(value(auto,descending)):timeshift(-2h)-builtin:host.disk.free:splitBy():sort(value(auto,descending))  
and create custom alarm based on it:

 ![michal_lewi_0-1731594489366.png](https://global.discourse-cdn.com/dynatrace/original/3X/c/4/c4681940c73d9c11e7e6423b8837b8b6398abf24.png)

you can also check new feature&nbsp;called “Disk Edge” which allows you to better evaluate disk performance.  
[Settings API - Anomaly detection for infrastructure- Disk Edge schema table - Dynatrace Docs](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/settings/schemas/builtin-infrastructure-disk-edge-anomaly-detectors)  
Best Regards  
Michał

---

<div class="post-metadata">

**Author:** ![andresjavier](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@andresjavier](https://community.dynatrace.com/u/andresjavier)\
**Post date:** [November 14, 2024, 3:57pm UTC](https://community.dynatrace.com/t/create-an-alert-based-on-the-disk-consumption-in-the-last-2-hours/48895/4 "2024-11-14T15:57:36Z")

</div>

Thanks&nbsp;[@DynaWiz](https://community.dynatrace.com/user/4080)&nbsp;… I’ve modified you query a little bit to include just the 😧 Drive and it seems to be working… I’ll configure the alerts and see how it goes!..

---

<div class="post-metadata">

**Author:** ![andresjavier](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@andresjavier](https://community.dynatrace.com/u/andresjavier)\
**Post date:** [November 14, 2024, 3:59pm UTC](https://community.dynatrace.com/t/create-an-alert-based-on-the-disk-consumption-in-the-last-2-hours/48895/5 "2024-11-14T15:59:27Z")

</div>

Thanks [@AntonPineiro](https://community.dynatrace.com/user/58682)&nbsp;… I’ll try also with this approach.!
