Open for Voting

Have the Average CPU Load - Memory Statistics Widget Respect the Node thresholds

The Average CPU Load & Memory Statistics do not respect the individual thresholds. Instead, it compares it against the Global Thresholds. The Warning Orange and Critical Red status is shown regardless of the node's set thresholds.

This example shows Memory at 91% which should be green based on the set thresholds.

  • select distinct
    
    n.caption as [Node Name]
    
    ,'/Orion/images/StatusIcons/Small-' + n.StatusIcon AS [_IconFor_Node Name]
    
    , n.detailsurl as [_linkfor_Node Name]
    
    ,case when n.cpuload < 0 then 'Not Polled'
    
    when n.host.nodeid is not null and n.host.cpucorecount is not null then concat(round(n.host.cpuload,0),'% of ',n.host.CpuCoreCount,' CPU')
    
    when cpu.[cpu count] is not null then concat(cpuload,'% of ',cpu.[cpu count],' CPU')
    
    else 'Polling Error'
    
    end as [CPU Load]
    
    ,'/Orion/NetPerfMon/CustomChart.aspx?chartName=HostAvgCPULoad&SampleSize=10M&Period=LAST%2024%20HOURS&NetObject=N:'+tostring(n.nodeid) as [_linkfor_CPU Load]
    
    ,CASE
    
    WHEN n.cpuload >= n.CpuLoadThreshold.Level2Value THEN '/Orion/images/StatusIcons/Small-Critical.gif'
    
    WHEN n.cpuload >= n.CpuLoadThreshold.Level1Value THEN '/Orion/images/StatusIcons/Small-Warning.gif'
    
    WHEN peak.cpu >= n.CpuLoadThreshold.Level2Value THEN '/Orion/images/StatusIcons/Small-Up-Down.gif'
    
    WHEN peak.cpu >= n.CpuLoadThreshold.Level1Value THEN '/Orion/images/StatusIcons/Small-Up-Warning.gif'
    
    WHEN n.cpuload < n.CpuLoadThreshold.Level1Value THEN '/Orion/images/StatusIcons/Small-Up.gif'
    
    END AS [_IconFor_CPU Load]
    
    ,case when n.percentmemoryused < 0 then 'Not Polled'
    
    else concat(n.percentmemoryused,'% of ',(round(n.totalmemory/1073741824,0)),' GB')
    
    end as [Memory Used]
    
    ,'/Orion/NetPerfMon/CustomChart.aspx?chartName=HostAvgPercentMemoryUsed&SampleSize=10M&Period=LAST%2024%20HOURS&NetObject=N:'+tostring(n.nodeid) as [_linkfor_Memory Used]
    
    ,CASE
    
    WHEN n.percentmemoryused >= n.percentmemoryusedThreshold.Level2Value THEN '/Orion/images/StatusIcons/Small-Critical.gif'
    
    WHEN n.percentmemoryused >= n.percentmemoryusedThreshold.Level1Value THEN '/Orion/images/StatusIcons/Small-Warning.gif'
    
    WHEN peak.mem >= n.percentmemoryusedThreshold.Level2Value THEN '/Orion/images/StatusIcons/Small-Up-Down.gif'
    
    WHEN peak.mem >= n.percentmemoryusedThreshold.Level1Value THEN '/Orion/images/StatusIcons/Small-Up-Warning.gif'
    
    WHEN n.percentmemoryused <  n.percentmemoryusedThreshold.Level1Value THEN '/Orion/images/StatusIcons/Small-Up.gif'
    
    END AS [_IconFor_Memory Used]
    
    FROM orion.nodes n
    
    left join (SELECT count(NodeID) as [CPU Count], nodeid
    
    FROM Orion.CPUMultiLoadCurrent
    
    group by nodeid) cpu on cpu.nodeid=n.nodeid
    
    left join (SELECT nodeid, count(volumeid) as [# of Volumes], round(max(volumepercentused),0) as [High] FROM Orion.Volumes
    
    group by nodeid) vol on vol.nodeid=n.nodeid
    
    left join (SELECT nodeid, count(volumeid) as [down]
    
    FROM Orion.Volumes where status=2
    
    group by nodeid) voldown on voldown.nodeid=n.nodeid
    
    left join (SELECT NodeID, max(AvgLoad) as [CPU], max(AvgPercentMemoryUsed) as [Mem]
    
    FROM Orion.CPULoad
    
    where hourdiff(datetime,getutcdate())<12
    
    group by nodeid) Peak on peak.nodeid=n.NodeID
    WHERE NodeID=${NodeID}
    
    order by n.caption

  • Here is a workaround. Add a Custom Query to the Node Details Page and use this query.