Recreate the Acknowledge prompt on custom table using SQL query

Hi,

In the Alerts section there's a button you can click to acknowledge an alert which pops up with the following which you can enter notes in, is there a way to recreate this in a custom table using a SQL query?

Thanks

Parents
  • Hi, with below query you see all unacknowledged alerts and the link to the right "ack's" the alert. But you don't get any popup....

    SELECT
        AC.Name as [Alert Name]
    	,CASE 
    		WHEN MINUTEDIFF(A.TriggeredDateTime, GETUTCDATE()) > 1440 -- More than 1 Day (1440 minutes)
    			THEN (TOSTRING(ROUND(MINUTEDIFF(A.TriggeredDateTime, GETUTCDATE()) / 1440.0, 1)) + ' Days')
    		WHEN MINUTEDIFF(A.TriggeredDateTime, GETUTCDATE()) > 60  -- More than 1 Hour (60 minutes)
    			THEN (TOSTRING(ROUND(MINUTEDIFF(A.TriggeredDateTime, GETUTCDATE()) / 60.0, 1)) + ' Hours')
    		ELSE (TOSTRING(MINUTEDIFF(A.TriggeredDateTime, GETUTCDATE())) + ' Minutes')
    		END AS [Active]
        ,A.TriggeredMessage AS [Message]
        ,AO.EntityCaption as [Triggering Object]
    	,CASE 
    		WHEN [AO].RelatedNodeCaption = EntityCaption
    			THEN '[Self]'
    		ELSE [AO].RelatedNodeCaption
    		END AS [Related Node]
        ,AO.EntityDetailsUrl as [_LinkFor_Triggering Object]
        ,CASE 
            WHEN AC.Severity=0 THEN '/Orion/images/ActiveAlerts/Informational.png'
            WHEN AC.Severity=1 THEN '/Orion/images/ActiveAlerts/warning.png'
            WHEN AC.Severity=2 THEN '/Orion/images/ActiveAlerts/Critical.png'
            WHEN AC.Severity=3 THEN '/Orion/images/ActiveAlerts/Serious.png'
            WHEN AC.Severity=4 THEN '/Orion/images/ActiveAlerts/Notice.png'
        END as [_IconFor_Alert Name]
        ,CONCAT('/Orion/NetPerfMon/ActiveAlertDetails.aspx?NetObject=AAT:',A.AlertObjectID) AS [_LinkFor_Alert Name]
        ,AO.RelatedNodeDetailsURL AS [_LinkFor_Related Node]
        ,'Ack' AS [Ack]
        ,'/Orion/Netperfmon/AckAlert.aspx?ObjID=' + ToString([AO].AlertObjectID) AS [_LinkFor_Ack]
    FROM Orion.AlertActive AS A
    INNER JOIN Orion.AlertObjects AO on A.AlertObjectID=AO.AlertObjectID
    INNER JOIN Orion.AlertConfigurations AC on AO.AlertID=AC.AlertID
    LEFT OUTER JOIN Orion.NodesCustomProperties AS NCP ON AO.RelatedNodeID=NCP.NodeID
    WHERE 
        ISNULL(A.Acknowledged,0)<>1 
    ORDER BY A.TriggeredDateTime DESC
    
    
    

  • Great thanks, I'll give that a go.

Reply Children
No Data