5 Replies Latest reply on Jan 5, 2018 1:54 PM by stevengj1

    SWQL and Active Alerts


      I am trying to create a dashboard that has Active Alerts. We have SW integrated with Service Now so on this dashboard I want to show alerts that are assigned to a particular Assignment Group in Service Now. In SWQL Studio the query works correctly and returns the correct number of records but when I put this in as Custom Query in the dashboard no records are return.  If I remove the where clause in the dashboard it will return all of the active alerts.  Any ideas why it would not work in the dashboard, is there any limitation on the SWQL  compared to the Studio. Thanks

      SELECT ac.Name AS [Alert],  

             '/Orion/NetPerfMon/ActiveAlertDetails.aspx?NetObject=AAT:' + ToString(ao.AlertObjectID) AS [_LinkFor_Alert],

             ac.AlertMessage AS [Message], 

             ao.EntityCaption AS [Object], 

             ao.EntityDetailsUrl AS [_LinkFor_Object],

             aa.TriggeredDateTime as [Triggered Date],

             ao.LastTriggeredDateTime AS [Last Triggered On], 

             ao.RelatedNodeCaption AS [Node], 

             ao.RelatedNodeDetailsUrl AS [_LinkFor_Node],

             ao.AlertIncident.IncidentNumber as [Incident Number],

             ao.AlertObjectID AS [_LinkFor_Incident Number],

             ao.AlertIncident.AssignedTo AS [Assignment Group],

             ao.AlertObjectID AS [_LinkFor_Assignment Group],


      CASE WHEN aa.TriggeredDateTime IS NULL THEN NULL ELSE (

          TOSTRING(FLOOR(MINUTEDIFF(aa.TriggeredDateTime,GETUTCDATE())/60.0)) + 'h ' +

          TOSTRING(MINUTEDIFF(aa.TriggeredDateTime,GETUTCDATE())%60) + 'm'




      FROM Orion.AlertActive AS aa 

      LEFT OUTER JOIN Orion.AlertObjects AS ao ON aa.AlertObjectID = ao.AlertObjectID

      LEFT OUTER JOIN Orion.AlertConfigurations AS ac ON ao.AlertID = ac.AlertID

      WHERE ao.AlertIncident.AssignedTo = 'Global Network Services'

      ORDER BY  aa.TriggeredDateTime