I have a need to look at NETFLOW IP group apps stats and I want another monitoring app to query the last 15 minutes or something so it can trend the info.
What tables do I need to hit to get that info. I wrote the code for 4+ hours ago *summarized), but want something more close to realtime and it needs to run quicker than hitting ALL of those tables...
In report writer, I can do the last hour, but
Anyone have any thoughts?
SQL:::::::this gives me 5 hours to 4 hours ago.
SELECT TOP 4
IPAddressGroups_Dest_IPAddressGroups.IPAddressGroupName AS IP_Address_Group,
SUM(NetflowSummary.TotalBytes) AS SUM_of_Bytes_Transferred
FROM
NetflowSummary LEFT OUTER JOIN IPAddressGroups IPAddressGroups_Dest_IPAddressGroups ON (NetflowSummary.DestIPSort BETWEEN IPAddressGroups_Dest_IPAddressGroups.IPRangeStart AND IPAddressGroups_Dest_IPAddressGroups.IPRangeEnd)
WHERE
( DateTime between
dateadd (hh, datepart(hour, dateadd(hh, -5,getdate() )) , convert(datetime, floor(convert(float,getdate())), 120 ))
AND
dateadd (hh, datepart(hour, dateadd(hh, -4,getdate() )) , convert(datetime, floor(convert(float,getdate())), 120 ))
)
AND
(
(IPAddressGroups_Dest_IPAddressGroups.IPAddressGroupID IS NOT NULL) AND
(IPAddressGroups_Dest_IPAddressGroups.Enabled = 1)
)
AND
(
(EXISTS(SELECT 1 FROM NetFlowSources WITH(nolock) WHERE NetFlowSources.InterfaceID=InterfaceIDRx AND NetFlowSources.Enabled=1))
)
GROUP BY IPAddressGroups_Dest_IPAddressGroups.IPAddressGroupName
ORDER BY 2 DESC