Closed tim-99 closed 3 years ago
Do you want to see graph definition for Interface Utilization?
For chart I use following query:
SELECT downsample(d.DateTime) as dt, d.Caption, AVG(d.PercentUtil) as PercentUtil FROM ( SELECT i.Caption ,i.Traffic.DateTime ,CASE WHEN ISNULL(i.InBandwidth,0) = 0 THEN 0 ELSE (ISNULL(i.Traffic.InAveragebps,0) / i.InBandwidth 100) END AS InPercentUtil ,CASE WHEN ISNULL(i.OutBandwidth,0) = 0 THEN 0 ELSE (ISNULL(i.Traffic.OutAveragebps,0) / i.OutBandwidth 100) END AS OutPercentUtil ,CASE WHEN i.[InBandwidth] + i.[OutBandwidth] = 0 THEN 0 WHEN i.[InBandwidth] = 0 THEN ((i.Traffic.[OutAveragebps] / [i].[OutBandwidth]) 100) WHEN i.[OutBandwidth] = 0 THEN ((i.Traffic.[InAveragebps] / [i].[InBandwidth]) 100) ELSE ((i.Traffic.[OutAveragebps] / i.[OutBandwidth] + i.Traffic.[InAveragebps] / i.[InBandwidth]) * 50) END AS PercentUtil FROM Orion.NPM.Interfaces as i WHERE InterfaceID IN ($Interfaces) ) as d WHERE d.DateTime BETWEEN $from AND $to GROUP BY downsample(d.DateTime), d.Caption
Many thanks! That really helps get started. Could you also share the two variables 'Nodes' and 'Interfaces'?
Hi, could you share your Graph Query from https://thwack.solarwinds.com/t5/NPM-Discussions/Grafana-NPM-datasource/m-p/164923 - would be rly nice.