Good morning,
Apologies but this will very likely be a very newbie question, as I am not a DBA...
I have a SWQL query that works well for single interfaces (access switches) for calculating the total amount of data (in and out):
----------------------
--CALCULATE TOTAL AMOUNT OF DATA IN GB - TODAY
SELECT
ROUND((SUM(TotalBytes)/1024/1024/1024),1) AS [Total GB]
FROM Orion.NPM.InterfaceTraffic i
WHERE i.Interface.Name = 'GigabitEthernet1/0/12'
AND NodeID = '305'
AND (DAY(TOLOCAL(DATETIME)) = (DAY(TOLOCAL(GETUTCDATE()))))
----------------------
I use this on a specific modern dashboard to represent how much Wireless traffic has passed through a certain Wireless Access Point (today) - ie. the switchport that the WAP is patched into.
Anyway, I want to SUM 3 of these ROUND queries together to represent the TOTAL amount of wireless traffic passing through a particular access switch, the queries are:
-----------------------
--CALCULATE TOTAL AMOUNT OF DATA IN GB - TODAY
SELECT
ROUND((SUM(TotalBytes)/1024/1024/1024),1) AS [Total GB]
FROM Orion.NPM.InterfaceTraffic i
WHERE i.Interface.Name = 'GigabitEthernet1/0/12'
AND NodeID = '305'
AND (DAY(TOLOCAL(DATETIME)) = (DAY(TOLOCAL(GETUTCDATE()))))
--CALCULATE TOTAL AMOUNT OF DATA IN GB - TODAY
SELECT
ROUND((SUM(TotalBytes)/1024/1024/1024),1) AS [Total GB]
FROM Orion.NPM.InterfaceTraffic i
WHERE i.Interface.Name = 'GigabitEthernet1/0/1'
AND NodeID = '305'
AND (DAY(TOLOCAL(DATETIME)) = (DAY(TOLOCAL(GETUTCDATE()))))
--CALCULATE TOTAL AMOUNT OF DATA IN GB - TODAY
SELECT
ROUND((SUM(TotalBytes)/1024/1024/1024),1) AS [Total GB]
FROM Orion.NPM.InterfaceTraffic i
WHERE i.Interface.Name = 'GigabitEthernet1/0/8'
AND NodeID = '305'
AND (DAY(TOLOCAL(DATETIME)) = (DAY(TOLOCAL(GETUTCDATE()))))
-----------------------
But I am not sure how to do this? Maybe it would be better to SUM all 3 together and then do a single ROUND afterwards? Perhaps there is a 'better' or 'more efficient' way to get what I am after?
Any help would be much appreciated. I've already found this community forum priceless so that you to everyone - it's great to see :-D
Cheers