2 Replies Latest reply on Jun 28, 2017 4:31 PM by kylep1

    Utilizing SWQL and multiple tables


      I am trying to learn how to utilize these links in a table and I am hoping someone here can teach me how to fish.


      I would like to utilize a current task utilizing UDT: I have an IP address and would like to get the switch and port that IP is on.

      Looking at SWQL studio I see: Orion.UDT.IPAddress - I can get the EndpointID from a simple query

      SELECT EndpointID from Orion.UDT.IPAddress i where i.IPAddress = ''


      I could join EndpointID with Orion.UDT.Endpoint.EndpointID ....


      How would I take the resulting joined data and "follow" the link of Ports (Orion.UDT.PortToEndpointCurrent) ?


      I see these icons that look like links and I really want to just use them line values

      IE. Orion.UDT.Endpoint.Ports.Port.DisplayName


      Any guidance is appreciated




        • Re: Utilizing SWQL and multiple tables

          And so it is: I think I am learning how to fish ....

          SELECT E.MACAddress, E.IpAddresses.IPAddress, E.Ports.Port.Node.DNS, E.Ports.Port.Name, E.Ports.ConnectionType

          From Orion.UDT.Endpoint E

          where E.MACAddress = 'XXXXXXXXXXXX' and E.Ports.ConnectionType = '2'


          as well as using a join:

          SELECT C.SerialNumber as serial_number ,C.Node.DisplayName as name, C.n_site_id as u_ans_site_code, C.Node.IPAddress as ip_address, C.Node.MachineType as model_number, N.SysObjectID as u_oid, N.NodeDescription as u_description, N.MachineType as short_description, C.Node.IOSVersion as firmware_version,  N.LastSync as last_discovered, N.NodeID as NodeID

          FROM Orion.NodesCustomProperties C

          Inner Join `Orion`.`Nodes` as N

            On (`C`.`NodeID` = `N`.`NodeID`)

          where C.Node.DisplayName like '%nodename%';

          1 of 1 people found this helpful