# Monitoring stopped on a shutdown host, disappears from dashboard

**URL:** <https://community.dynatrace.com/t/monitoring-stopped-on-a-shutdown-host-disappears-from-dashboard/51009>\
**Category:** DQL\
**Tags:** dql, oneagent\
**Created:** [April 1, 2025, 9:34pm UTC](https://community.dynatrace.com/t/monitoring-stopped-on-a-shutdown-host-disappears-from-dashboard/51009 "2025-04-01T21:34:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![m\_laurie\_az](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@m\_laurie\_az](https://community.dynatrace.com/u/m_laurie_az)\
**Post date:** [April 1, 2025, 9:34pm UTC](https://community.dynatrace.com/t/monitoring-stopped-on-a-shutdown-host-disappears-from-dashboard/51009/1 "2025-04-01T21:34:42Z")

</div>

There was a host entity that shutdown due to power issues and the agent stopped reporting data back from the host. Instead of it’s availability state changing, it drops off the dashboard completely as if the query isn’t looking for it anymore due to it not reporting any state data. Is the query wrong or something misconfigured?

Query:  
timeseries availability = sum(dt.host.availability), by: { dt.entity.host, availability.state }, filter: { in(dt.entity.host, classicEntitySelector(“type(host),tag(\“KeyA:ValueA\”)”)) OR in(dt.entity.host, classicEntitySelector(“type(host),tag(\“KeyA:ValueB\”)”)) }  
| fieldsAdd availability = arraySum(availability)  
| sort availability asc  
| fieldsAdd Host = arrayLast(splitString(entityName(dt.entity.host), "- "))  
| limit 300

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [May 20, 2025, 3:28pm UTC](https://community.dynatrace.com/t/monitoring-stopped-on-a-shutdown-host-disappears-from-dashboard/51009/2 "2025-05-20T15:28:23Z")

</div>

Query is correct, but this is nature of timeseries that when no data was reported we cannot expect any result. If you want to have a stable list of hosts regardless of data availability I suggest to start with _ **fetch.dt.entites** _ and _ **join** _ result with timeseries.

Full query would look like this:

```markup
fetch dt.entity.host
| filter in(id, classicEntitySelector("type(host),tag(\"KeyA:ValueA\")")) 
  OR in(id, classicEntitySelector("type(host),tag(\"KeyA:ValueB\")")) 
| fieldsAdd Host = arrayLast(splitString(entity.name, "- "))

| join [
  timeseries availability = sum(dt.host.availability), by: { dt.entity.host, availability.state }
  | fieldsAdd availability = arraySum(availability)
], on:{left[id]==right[dt.entity.host]}, fields:{availability.state, availability}, executionOrder:leftFirst, kind:leftOuter

| sort availability desc
| limit 300

```

_ **kind:leftOuter** _ option is important here. If missing host will not be present at all.

---

<div class="post-metadata">

**Author:** ![Fin\_Ubels](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/fin_ubels/32/18008_2.png) [@Fin\_Ubels](https://community.dynatrace.com/u/Fin_Ubels)\
**Post date:** [May 21, 2025, 5:09am UTC](https://community.dynatrace.com/t/monitoring-stopped-on-a-shutdown-host-disappears-from-dashboard/51009/3 "2025-05-21T05:09:12Z")

</div>

With the above, would you not still run into the same issue?

If you run fetch dt.entity.host over a period where the host hasn’t been seen it won’t return a result.

For example, if I query during the time my host was last see, on the 9th of May, it shows up:

 ![Fin_Ubels_0-1747804060827.png](https://global.discourse-cdn.com/dynatrace/original/2X/2/2dcdea4b51fad3dc185dd0d95e82f332865fee82.png)

If I query for hosts on the 10th of May, it doesn’t show up because there weren’t any:

 ![Fin_Ubels_1-1747804098489.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/e/1ee5b3e8c5e12452217a61a74a2284da56ddd2f8.png)

---

<div class="post-metadata">

**Author:** ![krzysztof\_hoja](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/krzysztof_hoja/32/34625_2.png) [@krzysztof\_hoja](https://community.dynatrace.com/u/krzysztof_hoja)\
**Post date:** [May 21, 2025, 8:51am UTC](https://community.dynatrace.com/t/monitoring-stopped-on-a-shutdown-host-disappears-from-dashboard/51009/4 "2025-05-21T08:51:29Z")

</div>

1. For short recent timeframes my query can be used as is, because it take hours to retire host.

2. For longer timeframes, you can introduce own control on time for both queries:

```markup
fetch dt.entity.host, from:-1M
| filter in(id, classicEntitySelector("type(host),tag(\"KeyA:ValueA\")")) 
  OR in(id, classicEntitySelector("type(host),tag(\"KeyA:ValueB\")")) 
| fieldsAdd Host = arrayLast(splitString(entity.name, "- "))

| join [
  timeseries availability = sum(dt.host.availability), by: { dt.entity.host, availability.state }, from:-24h
  | fieldsAdd availability = arraySum(availability)
], on:{left[id]==right[dt.entity.host]}, fields:{availability.state, availability}, executionOrder:leftFirst, kind:leftOuter

| sort availability desc
| limit 300

```

query is looking at all entities for past month and data only last 24h
