22 Jul 2023 03:08 AM
Greetings All,
I've got a question for those proficient in using Data Explorer and creating dashboards.
I aim to create a chart that only displays hosts consuming more than a specified percentage of CPU or Memory at any given moment. For instance, if Host A's CPU consumption exceeds 70% within a 24-hour period, I would want that host to be displayed on my chart. However, all other hosts that don't meet this threshold should not appear.
I've attempted to accomplish this with a specific query, but unfortunately, it resulted in all the hosts being listed. Can anyone assist me in this matter? Your help would be much appreciated.
builtin:host.cpu.usage:splitBy("dt.entity.host"):avg:auto:sort(value(avg,descending)):filter(series(auto,ge(70)))
Above is the query that I used.
Solved! Go to Solution.
22 Jul 2023 10:05 AM
Hi @theharithsa
Its look like your query is working just fine ( see below with 45and 60)
Can you please share your results ?
Yos
24 Jul 2023 07:33 PM
I observed that we need to be careful in selecting the aggregation for the selector function, especially inside the series. If we use avg, it will take the average of all the chosen timeframes; hence, if we're looking for the data that is displayed in the graph, which gives the average CPU for the selected timeframe where in the given resolution period if the value is more than mentioned percentage. So the final query would be like this,
builtin:host.cpu.usage:splitBy("dt.entity.host"):avg:sort(value(avg,descending)):filter(series(max,ge(75)))
This will give us a chart of the average CPU usage % of the hosts in the given timeframe where on the resolution if any data point reaches more than 75%, it will list that host under this condition.