I am needing a SWQL query for a KPI widget on a modern dashboard
Looking to get a count of Nodes that a UP that the CPU is running at or higher than 90% for over an hour
Then I would like it to filter that count by a Custom Properties
Assumption: You only care if the average CPU over the last 60 minutes is over 90% (regardless of what the threshold for said node is set).
SELECT TOP 1 COUNT([Nodes].Caption) AS NumNodesOver90CPU-- , AVG([Nodes].CPULoadHistory.AvgLoad * 1.0) AS AverageOverLastHour-- , [Nodes].CPULoadHistory.ObservationTimestampFROM Orion.Nodes AS [Nodes]-- Filter for the last hour onlyWHERE [Nodes].CPULoadHistory.ObservationTimestamp >= ADDHOUR(-1, GETUTCDATE())-- This is where you would filter for your custom property-- AND [Nodes].CustomProperties.CustomerName = 'ACME Bird Seed'GROUP BY [Nodes].CaptionHAVING AVG([Nodes].CPULoadHistory.AvgLoad * 1.0 ) > 90.0