2 Replies Latest reply on Jan 3, 2018 9:37 AM by zackm

    Getting Error: A query to the SolarWinds Information Service failed when doing SWQL(Custom query)

    nfs1004

      Hi Everyone,

       

      I was wondering if anyone had a same or similar issue when building a customer query?  The below query works if I remove where AlertHistory.AlertObjects.RelatedNodeID='${NodeID}'.  So the problem seems to be associated with this particular line.  I checked to make sure there is no view limitations that could be causing this error.   Yet, I keep getting A query to the SolarWinds Information Service failed when doing SWQL.

       

       

       

      select AlertHistory.AlertObjects.AlertConfigurations.Name as [Alert Name],

      Message,

      AlertHistory.AlertObjects.EntityCaption as [Triggering Object],

      ToLocal(Timestamp) as [Time],

      AlertHistory.AlertObjects.RelatedNodeCaption as [Related Node],

      'https://solarwinds.ci.northwestern.edu/Orion/NetPerfMon/ActiveAlertDetails.aspx?NetObject=AAT:'+ToString(AlertObjectID) as [_linkfor_Message],

      'https://solarwinds.ci.northwestern.edu/Orion/NetPerfMon/ActiveAlertDetails.aspx?NetObject=AAT:'+ToString(AlertObjectID) as [_linkfor_Alert Name]

      from Orion.AlertHistory

      where AlertHistory.AlertObjects.RelatedNodeID='${NodeID}'

      order by TimeStamp desc

        • Re: Getting Error: A query to the SolarWinds Information Service failed when doing SWQL(Custom query)
          Mark Roberts

          Where and how are you using this query?

           

          This will need to be used on an appropriate page which will have the variable available to use i.e. Node Details page.

           

          You do not need to wrap the NodeID in single quotes as that column is an integer in the database, but this should cause an error.

           

          Check the InformationServicev3 log within C:\programdata\SolarWinds\InformationService folder for clues.

           

          Mark Roberts

          Prosperon - UK SolarWinds Partners

          Installation | Consultancy | Training | Licenses

          facebook_icon.jpglinkedin.pngblogger.pngtwitter-icon.jpg 

          1 of 1 people found this helpful
          • Re: Getting Error: A query to the SolarWinds Information Service failed when doing SWQL(Custom query)
            zackm

            You're not calling an actual SWIS entity with this line:

             

            where AlertHistory.AlertObjects.RelatedNodeID='${NodeID}'

             

            The entity is Orion.AlertHistory

             

            If you want to use a table alias, try it this way:

             

            SELECT
            h.AlertObjects.AlertConfigurations.Name AS [ALERT NAME]
            ,ISNULL(h.Message,'') AS [MESSAGE]
            ,h.AlertObjects.EntityCaption AS [TRIGGERING OBJECT]
            ,TOLOCAL(h.TimeStamp) AS [TIME]
            ,ISNULL(h.AlertObjects.RelatedNodeCaption,'') AS [RELATED NODE]
            ,'https://solarwinds.ci.northwestern.edu/Orion/NetPerfMon/ActiveAlertDetails.aspx?NetObject=AAT:'+TOSTRING(h.AlertObjectID) AS [_linkfor_ALERT NAME]
            ,'https://solarwinds.ci.northwestern.edu/Orion/NetPerfMon/ActiveAlertDetails.aspx?NetObject=AAT:'+TOSTRING(h.AlertObjectID) AS [_linkfor_MESSAGE]
            FROM Orion.AlertHistory h
            --Alert Triggers Only (0 = Triggered, 1 = Reset, 2 = Acknolwedged, 3 = Note, 5 = ActionFailed, 6 = ActionSucceeded )
            WHERE h.EventType = 0
            AND h.AlertObjects.RelatedNodeId = ${NodeID}
            ORDER BY h.TimeStamp DESC