Direct SQL Server Queries

Hello all!

I'm trying to get the ingress and egress traffic from specific links to add real time data into Grafana. As far as I know, to get the information I am looking for I have to query the SQL Server database directly. Any examples on a MSSQL query that does this?

Parents
  • Hi,

    I would not use SQL directly as Flow Storage DB is does not include information like node or interface names. Instead I would recommend to use SWQL (https://github.com/solarwinds/OrionSDK/tree/master/Samples). This is similar to SQL and it will automatically merge data from multiple databases together. To get familiar with it I would recommend to use SWQL Studio, which is part of OrionSDK. You will also see there the schema with all information that are available to you.

    Example of simple NetFlow query:

    SELECT TimeStamp, flows.Node.Caption, SUM(IngressBytes) AS IngressBytes, SUM(EgressBytes) AS EgressBytes
    FROM Orion.NetFlow.Flows AS flows
    WHERE TimeStamp > AddMinute(-10, GETUTCDATE())
    GROUP BY TimeStamp, flows.Node.Caption
    ORDER BY TimeStamp DESC

Reply
  • Hi,

    I would not use SQL directly as Flow Storage DB is does not include information like node or interface names. Instead I would recommend to use SWQL (https://github.com/solarwinds/OrionSDK/tree/master/Samples). This is similar to SQL and it will automatically merge data from multiple databases together. To get familiar with it I would recommend to use SWQL Studio, which is part of OrionSDK. You will also see there the schema with all information that are available to you.

    Example of simple NetFlow query:

    SELECT TimeStamp, flows.Node.Caption, SUM(IngressBytes) AS IngressBytes, SUM(EgressBytes) AS EgressBytes
    FROM Orion.NetFlow.Flows AS flows
    WHERE TimeStamp > AddMinute(-10, GETUTCDATE())
    GROUP BY TimeStamp, flows.Node.Caption
    ORDER BY TimeStamp DESC

Children