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.

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

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

  • 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 

  • 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]
    ,'solarwinds.ci.northwestern.edu/.../ActiveAlertDetails.aspx AS [_linkfor_ALERT NAME]
    ,'solarwinds.ci.northwestern.edu/.../ActiveAlertDetails.aspx 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