I am preparing a report to show the activations of a specific alarm in the last 24 hours. In addition, I want to include the time of the first activation of that alarm for each affected item.
Regarding the activations in the last 24 hours, the query always fails me.
On the other hand, I have no idea how to put the first time it was activated in the last 24h, does anyone know how to do it? Checking (solarwinds.github.io/.../Orion.AlertObjects.html) I don't see any element to catch.
Query:
SELECT
aa.AlertActiveID AS [ID Global],
aa.TriggeredMessage AS [Alert],
ao.AlertID AS [ID Alart],
aa.TriggeredDateTime AS [Trigger Time],
ao.EntityCaption AS [Element],
ao.EntityDetailsUrl AS [URL],
ao.TriggeredCount AS [CountTrigger],
ao.IsActiveAlert AS [Active Alert]
FROM
Orion.AlertActive aa
JOIN
Orion.AlertObjects ao ON aa.AlertObjectID = ao.AlertObjectID
WHERE
ao.AlertID LIKE '401'
AND aa.TriggeredDateTime >= DATEADD(-1, GETUTCDATE())