12 Replies Latest reply on Feb 15, 2016 7:38 PM by mwb

    Custom  SWQL Query Questions

    jkirschn

      Hi All

       

      So I believe  I have a syntax issue and was looking for some help?

       

      So I'm needing to create a query to give display  in a  view  of  a  list of all down nodes  but  not un-managed ones ...with a couple of custom fields and  the status bubble and clickable link .... here's what I have so far.... any help would be appreciated.

       

      Here's the SQL  I'm using:

       

      SELECT StatusLED, Caption,  NodeID, GroupStatus, NodeName,

      Nodes.CustomProperties.Alert_Team, Nodes.CustomProperties.Environment

      FROM Orion.Nodes WHERE Status = 2 and

      Unmanaged  <> 1

       

      Here's what I get:

      Capture2.JPG

        • Re: Custom  SWQL Query Questions
          tdanner

          Try this:

           

          SELECT NodeName AS [Node Name],

                 '/Orion/images/StatusIcons/Small-' + StatusIcon AS [_IconFor_Node Name],

                 DetailsUrl AS [_LinkFor_Node Name],

                 Nodes.CustomProperties.Alert_Team,

                 Nodes.CustomProperties.Environment

          FROM Orion.Nodes

          WHERE Status=2

          ORDER BY NodeID

           

          Some notes:

           

          1. NodeName and Caption are the same thing, so you don't need to include both.

          2. The magic is in the _IconFor_ and _LinkFor_ column aliases. The Custom Query resource looks for columns with names like that to know how to generate images and link tags.

          3. When a node is Unmanaged, its Status will be 9. So if your WHERE clause has "Status=2" then you don't also need to check the Unmanaged property.