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.

Help with SQL and Report Writer

Hello guys.

I have ZERO SQL experience so anyone's help will be greatly appreciated. I need to create a SQL report with MAC Address, Port Description and the Hostname associated with that port. And can this SQL query narrow it down to a L2/L3 device? Kinda like Switchport Mapper. I just want to limit it to just one site.

  • hey.

    Something like this? your need to create a custom query resource. and paste the below. sure you can group device or vendor etc..

    pastedImage_0.png

    SELECT

    I.MAC AS [MAC ADD],

    N.Caption AS [NODE],

    Alias as Description,

    IfName AS [PORT]

    FROM Orion.NPM.Interfaces i

    INNER JOIN ORION.Nodes N ON I.NodeID = N.NodeID

    WHERE

        N.Caption LIKE '%${SEARCH_STRING}%'OR

        I.PhysicalAddress  LIKE'%${SEARCH_STRING}%'OR

        I.Alias  LIKE'%${SEARCH_STRING}%'

    )

  • Great query I LIKE EGGS!

    Just to elaborate, the custom SWQL query is without the search.  The 'search SWQL query' is with the search string

    pastedImage_1.png

    SOmetimes this will result in blank MACs.

    pastedImage_2.png

    WHich you can filter out using:  where i.mac is not null and i.mac not like ''

    pastedImage_6.png

    Thanks