cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 8

SWQL statement for current bandwidth utilization of specific interfaces

Jump to solution

Hi!

could you help me with an SWQL statement to get the bandwidth utilization of a few specified interfaces?

I'd like to see Min/Max Recive bps and Average Transmit bps

Many thanks in advance

Rubensk

Tags (2)
1 Solution
Level 9

I would highly recommend getting familiarized with SWQL Studio (https://github.com/solarwinds/OrionSDK) and start try making queries yourself. I am not sure if there was a certain timeframe you wanted but below is an example query based on what you asked for last 24 hours. There are 2 ways I would limit the interfaces in the WHERE clause of the query. Option 1 would allow to to manually add and remove interfaces but could get very unorganized depending on how many interfaces you would like to monitor and if you would be added new interfaces you would need to edit the query each time. Option 2 would be to use a custom property on the interfaces you want to monitor and just search for interfaces with that certain value. Option 2 would be my preferred option.

SELECT
    I.Node.Caption,
    I.IfName,
    Concat(Avg(I.Traffic.OutAveragebps), ' bps') AS [Average Transmit bps],
    Concat(MAX(I.Traffic.OutMaxbps), ' bps') AS [Max Transmit bps],
    Concat(MIN(I.Traffic.OutMinbps), ' bps') AS [Min Transmit bps]
FROM
    Orion.NPM.Interfaces I
WHERE
    I.Traffic.DateTime > ADDDAY(-1, GETUTCDATE())
    --Option 1 Specify each caption and ifname manually
    AND (
        (I.Node.Caption = 'YourNetworkDevice-RTR' AND I.IfName = 'Gi0/1')
        OR (I.Node.Caption = 'YourNetworkDevice-RTR' AND I.IfName = 'Gi0/0')
    )
    --Option 2 Use a Custom Property and assign it to interfaces
    AND I.CustomProperties._MonitorBandwidthSWQL = TRUE
GROUP BY
    I.Node.Caption,
    I.IfName

View solution in original post

2 Replies
Level 9

I would highly recommend getting familiarized with SWQL Studio (https://github.com/solarwinds/OrionSDK) and start try making queries yourself. I am not sure if there was a certain timeframe you wanted but below is an example query based on what you asked for last 24 hours. There are 2 ways I would limit the interfaces in the WHERE clause of the query. Option 1 would allow to to manually add and remove interfaces but could get very unorganized depending on how many interfaces you would like to monitor and if you would be added new interfaces you would need to edit the query each time. Option 2 would be to use a custom property on the interfaces you want to monitor and just search for interfaces with that certain value. Option 2 would be my preferred option.

SELECT
    I.Node.Caption,
    I.IfName,
    Concat(Avg(I.Traffic.OutAveragebps), ' bps') AS [Average Transmit bps],
    Concat(MAX(I.Traffic.OutMaxbps), ' bps') AS [Max Transmit bps],
    Concat(MIN(I.Traffic.OutMinbps), ' bps') AS [Min Transmit bps]
FROM
    Orion.NPM.Interfaces I
WHERE
    I.Traffic.DateTime > ADDDAY(-1, GETUTCDATE())
    --Option 1 Specify each caption and ifname manually
    AND (
        (I.Node.Caption = 'YourNetworkDevice-RTR' AND I.IfName = 'Gi0/1')
        OR (I.Node.Caption = 'YourNetworkDevice-RTR' AND I.IfName = 'Gi0/0')
    )
    --Option 2 Use a Custom Property and assign it to interfaces
    AND I.CustomProperties._MonitorBandwidthSWQL = TRUE
GROUP BY
    I.Node.Caption,
    I.IfName

View solution in original post

Many thanks for your quick help. It solved my requirement.

I did not know about custom properties, but they look very promising!

0 Kudos