This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

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

  • How do I use this as a data source in Grafana? If I can't use SWQL, which I've looked, how do I do the queries directly in SQL Server since it can be used as a data source

Reply Children