# Disk space specific to few servers and directories

**URL:** <https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934>\
**Category:** Alerting\
**Tags:** disks\
**Created:** [August 1, 2024, 1:55am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934 "2024-08-01T01:55:34Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![sundarv1](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sundarv1](https://community.dynatrace.com/u/sundarv1)\
**Post date:** [August 1, 2024, 1:55am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/1 "2024-08-01T01:55:34Z")

</div>

We would like to alert if the disk space is greater than 80% for few set of servers and specific directories only?

For e.g

Server A - there are 10 directories. For few directories we want to alert if disk space is more than 80 to 89%

and few we want to alert if&nbsp;disk space is more than 90% only

How do we configure that?

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [August 1, 2024, 4:41am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/2 "2024-08-01T04:41:13Z")

</div>

Hi&nbsp;[@sundarv1](https://community.dynatrace.com/user/74312)&nbsp;,

Going to Settings / Anomaly detection / Disk in hosts you want to configure the alerts:

 ![erh_inetum_0-1722486987201.png](https://global.discourse-cdn.com/dynatrace/original/3X/a/1/a1a146e2683bed0e5d12eeaa7b5b99160971d0dc.png)

Click on the disk or disk\path

 ![erh_inetum_1-1722487167802.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/c/3c3d22b817f24ff6d449b3d2b2a0774edf4e8f68.png)

and configure the thresholds:

 ![erh_inetum_2-1722487213703.png](https://global.discourse-cdn.com/dynatrace/original/2X/8/8bfe06858488a0ef14e729cb4d97536ce413aec2.png)

Hope it helps.

Regards,

Elena.

---

<div class="post-metadata">

**Author:** ![sundarv1](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sundarv1](https://community.dynatrace.com/u/sundarv1)\
**Post date:** [August 1, 2024, 6:23am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/3 "2024-08-01T06:23:35Z")

</div>

Thanks. How do we do the same via metric event?

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [August 1, 2024, 6:40am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/4 "2024-08-01T06:40:15Z")

</div>

Welcome.

You can configure a metric event defining the metric selector with a metric like

builtin:host.disk.usedPct:filter(and(or(in(“dt.entity.disk”,entitySelector(“type(disk),entityName.in(~“path~”)”))),or(in(“dt.entity.host”,entitySelector(“type(host),entityName.equals(~“host~”)”))))):splitBy(“dt.entity.host”,“dt.entity.disk”)

 ![erh_inetum_0-1722494238507.png](https://global.discourse-cdn.com/dynatrace/original/3X/4/7/47ee63138a9e87e075c10556162f1d283664bd63.png)

and the thresholds.

Regards,

Elena.

---

<div class="post-metadata">

**Author:** ![sundarv1](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sundarv1](https://community.dynatrace.com/u/sundarv1)\
**Post date:** [August 1, 2024, 6:47am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/5 "2024-08-01T06:47:29Z")

</div>

Thanks. How do we reuse the above query to generate alert only if it is between 80 to 89% . Where do i can specify the threshold in above filter condition.

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [August 1, 2024, 7:03am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/6 "2024-08-01T07:03:03Z")

</div>

I’m not sure to be honest if it’s possible to do that because I think you can only configure a threshold using one value. Defining a threshold between two values could be a good product idea to create.

I can think of creating the same metric event twice with different names. In once defining the threshold above and the other one below. But I’m not sure if it’ll work. You can test it.

Regards,

Elena.

---

<div class="post-metadata">

**Author:** ![sundarv1](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sundarv1](https://community.dynatrace.com/u/sundarv1)\
**Post date:** [August 1, 2024, 7:08am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/7 "2024-08-01T07:08:44Z")

</div>

Thanks., Where do i specify the threshold in the above metric filter?.

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [August 1, 2024, 7:35am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/8 "2024-08-01T07:35:23Z")

</div>

In the same place that you configure the metric event.  
Here you have a couple of links with documentation about how to create a metric event:

> **[Metric events](https://docs.dynatrace.com/docs/dynatrace-intelligence/anomaly-detection-classic/metric-events)**
>
> Learn about metric events in Dynatrace

> **[Metric events: Set up anomaly detection based on your business needs](https://www.dynatrace.com/news/blog/metric-events-set-up-anomaly-detection-based-on-your-business-needs/)**
>
> Dynatrace Davis® AI automatically analyzes abnormal situations within your IT infrastructure, identifies their impact and root cause, and covers many observability use cases out of the box. Davis also provides the flexibility to adapt to...

Regards,  
Elena.

---

<div class="post-metadata">

**Author:** ![sundarv1](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sundarv1](https://community.dynatrace.com/u/sundarv1)\
**Post date:** [August 5, 2024, 3:50am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/9 "2024-08-05T03:50:24Z")

</div>

builtin:host.disk.usedPct:filter(and(or(in(“dt.entity.disk”,entitySelector(“type(disk),entityName.in(~“path~”)”))),or(in(“dt.entity.host”,entitySelector(“type(host),entityName.equals(~“host~”)”))))):splitBy(“dt.entity.host”,“dt.entity.disk”)

Thanks. How do add multiple hosts in the above query?,

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [August 5, 2024, 5:57am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/10 "2024-08-05T05:57:37Z")

</div>

Hi&nbsp;[@sundarv1](https://community.dynatrace.com/user/74312)&nbsp;,

You have to add this piece of code

**,in(“dt.entity.host”,entitySelector(“type(host),entityName.equals(~“host~”)”))**

as many times as hosts want to add.

Ex:

builtin:host.disk.usedPct:filter(and(or(in(“dt.entity.disk”,entitySelector(“type(disk),entityName.in(~“path~”)”))),or(in(“dt.entity.host”,entitySelector(“type(host),entityName.equals(~“host~”)”))**,in(“dt.entity.host”,entitySelector(“type(host),entityName.equals(~“host~”)”))**))):splitBy(“dt.entity.host”,“dt.entity.disk”)

Regards,

Elena.

---

<div class="post-metadata">

**Author:** ![sundarv1](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sundarv1](https://community.dynatrace.com/u/sundarv1)\
**Post date:** [August 5, 2024, 1:40pm UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/11 "2024-08-05T13:40:36Z")

</div>

builtin:host.disk.free:filter(and(or(in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~”/obidata~“)”))),  
or(in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~”/opt~“)”)))))  
:splitBy(“dt.entity.host”,“dt.entity.disk”):avg:sort(value(avg,descending)) - This is not working.

I tried.&nbsp; When i do separately data is coming and when i put in single query output is empty

---

<div class="post-metadata">

**Author:** ![sundarv1](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sundarv1](https://community.dynatrace.com/u/sundarv1)\
**Post date:** [August 6, 2024, 3:24am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/12 "2024-08-06T03:24:15Z")

</div>

builtin:host.disk.free:filter(and(or(in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“D:\~”)”)),  
in(“dt.entity.host”,entitySelector(“type(host),entityName.equals(~“AUSZVRCUW338.rcuad.local~”)”))),  
in(“dt.entity.host”,entitySelector(“type(host),entityName.equals(~“AUSZVRCUW337.rcuad.local~”)”))))

I am getting output only one server and though D:\ is present in both

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [August 6, 2024, 5:11am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/13 "2024-08-06T05:11:27Z")

</div>

Hi&nbsp;[@sundarv1](https://community.dynatrace.com/user/74312)&nbsp;,

Have you check the timeframe in which you’re getting the data?

Regards,

Elena.

---

<div class="post-metadata">

**Author:** ![sundarv1](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sundarv1](https://community.dynatrace.com/u/sundarv1)\
**Post date:** [August 6, 2024, 5:26am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/14 "2024-08-06T05:26:03Z")

</div>

yes i checked for last 90 days and only server 337 is coming. 338 is not coming

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [August 6, 2024, 5:34am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/15 "2024-08-06T05:34:45Z")

</div>

Try this:

builtin:host.disk.free:filter  
(and  
(or  
(in(“dt.entity.host”,entitySelector(“type(host),entityName.equals(~“AUSZVRCUW338.rcuad.local~”)”)),  
in(“dt.entity.host”,entitySelector(“type(host),entityName.equals(~“AUSZVRCUW337.rcuad.local~”)”))),  
or(in(“dt.entity.disk”,entitySelector(“type(disk),entityName.equals(~“D:\~”)”)))))

---

<div class="post-metadata">

**Author:** ![sundarv1](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sundarv1](https://community.dynatrace.com/u/sundarv1)\
**Post date:** [August 6, 2024, 9:22am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/16 "2024-08-06T09:22:43Z")

</div>

Thank you. one last thing. with above query and we want to get alert if it disk space is more than 80%. Does the attached screenshot looks good?.

 ![Screenshot 2024-08-06 192119.png](https://global.discourse-cdn.com/dynatrace/original/3X/d/4/d4d6f36abbdebc5cca2f189bd81397828b0dd257.png)

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [August 6, 2024, 9:36am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/17 "2024-08-06T09:36:47Z")

</div>

Welcome&nbsp;[@sundarv1](https://community.dynatrace.com/user/74312)&nbsp;🙂

Yes, but don’t forget the alert condition:

 ![erh_inetum_0-1722936940484.png](https://global.discourse-cdn.com/dynatrace/original/3X/d/1/d1a4e71025294ba21ca636db2a753d0156d05d88.png)

Regards,

Elena.

---

<div class="post-metadata">

**Author:** ![sundarv1](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sundarv1](https://community.dynatrace.com/u/sundarv1)\
**Post date:** [August 6, 2024, 9:45am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/18 "2024-08-06T09:45:20Z")

</div>

Thanks. I did try it and see it is not working. i modifed to 50% as we have some disks avalaible less than 50% and but it is not working. How to make sure this is working before we enable the metric

---

<div class="post-metadata">

**Author:** ![erh\_inetum](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@erh\_inetum](https://community.dynatrace.com/u/erh_inetum)\
**Post date:** [August 6, 2024, 11:03am UTC](https://community.dynatrace.com/t/disk-space-specific-to-few-servers-and-directories/46934/19 "2024-08-06T11:03:19Z")

</div>

Welcome&nbsp;[@sundarv1](https://community.dynatrace.com/user/74312)

In Alert Preview section you can see if the configured threshold will reach the in the last day, 3 days or 7 days depending on the dimension (host and disk) selected.  
You can play with this threshold in this section to preview if the alarm will trigger according the set threshold:

 ![erh_inetum_0-1722941798528.png](https://global.discourse-cdn.com/dynatrace/original/3X/7/3/7347e4998738a920f5ec45a5e5aff3a07ac80239.png)

Hope it helps.
