6 Replies Latest reply on Jul 14, 2015 4:38 AM by jamieg

    Help with SWQL query

    jamieg

      Hi All,

       

       

      I'm using SW 2015.1.0 SAM6.2.0, I've created a custom pane to our home page, I want to display the temps for the following hardware components, System Board Exhaust Temp & System Board Inlet Temp, I've got as far as below which shows all temps reported by the Hardware Health and I just need to filter out all the others bar the inlet and exhaust temps. Would also be good say to have the TOP xx "20" I've tried adding TOP n etc but no luck yet, just get error in script.

       

       

      Anyone help?

       

       

       

      SELECT FullyQualifiedName, Status, Value, HardwareUnitDescription FROM Orion.HardwareHealth.HardwareItem

      WHERE HardwareCategoryID = 4

        • Re: Help with SWQL query
          Deltona

          Hi there,

           

          You could build this using a Custom Table resource and avoid having to fiddle with SQL statements.

           

          Custom_Table_Hardware_Health_01.png

           

          Custom_Table_Hardware_Health_02.png

           

          If you need to add filters then you can do so in Data source picker.

          • Re: Help with SWQL query
            devin.dao

            I think this is what you are looking for:

             

            SELECT
            N.Caption,
            A.DisplayName,
            A.Status AS HWStatus,
            A.Value

            FROM APM_HardwareItem A
            INNER JOIN Nodes N ON (N.NodeID = A.NodeID)


            WHERE


            A.DisplayName LIKE 'System Board %Exhaust Temp%' OR A.DisplayName LIKE 'System Board %Inlet Temp%'

            ORDER BY 1 ASC

            1 of 1 people found this helpful
              • Re: Help with SWQL query
                jamieg

                Sorry been away for a week - I will give this a shot.

                 

                Cheers for your help - I will confirm back soon.

                • Re: Help with SWQL query
                  jamieg

                  Thanks for your suggestion but when I paste this into a SWQL custom resource I get the following error under that section

                   

                   

                  "Error: A query to the SolarWinds Information Service failed."

                   

                   

                  Any ideas?

                    • Re: Help with SWQL query
                      tdanner

                      devin.dao posted a database (SQL) query. But we can easily turn that into an equivalent SWQL query:

                       

                      SELECT
                      N.Caption,
                      A.DisplayName,
                      A.Status AS HWStatus,
                      A.Value
                      FROM Orion.HardwareHealth.HardwareItem A
                      INNER JOIN Orion.Nodes N ON (N.NodeID = A.NodeID)
                      WHERE A.DisplayName LIKE 'System Board %Exhaust Temp%' OR A.DisplayName LIKE 'System Board %Inlet Temp%'
                      ORDER BY N.Caption ASC
                      
                      
                      1 of 1 people found this helpful
                  • Re: Help with SWQL query
                    jamieg

                    Ended up with the below as the posted query didn't like the field names - cheers for your help without it I wouldn't be where I am.  Thanks again.

                     

                    SELECT 

                    A.FullyQualifiedName, 

                    A.Status, 

                    A.Value, 

                    HardwareUnitDescription

                    FROM Orion.HardwareHealth.HardwareItem A

                    INNER JOIN Orion.Nodes N ON (N.NodeID = A.NodeID) 

                    WHERE A.DisplayName LIKE 'System Board %Exhaust Temp%' OR A.DisplayName LIKE 'System Board %Inlet Temp%' 

                    ORDER BY A.Value DESC