I am working on an extract of all enabled alerts configured in my environment that should include trigger conditions, reset conditions, trigger actions, reset actions, Email recipients and object type.
Can anyone help me writing the swql query for the above requirement please?
Currently I have the following query but it doesn't contain all the columns that I need.
SELECT
ac.Name,
CASE WHEN ac.Severity = 2 THEN 'Critical' WHEN ac.Severity = 1 THEN 'Warning' END AS Severity,
ac.ObjectType,
a.Title,
ap.PropertyValue AS EmailTo,
ap1.PropertyValue AS EmailCC,
ap2.PropertyValue AS EmailBCC,
CategoryType
FROM
Orion.Actions a
INNER JOIN Orion.ActionsProperties ap ON ap.ActionID = a.ActionID
AND ap.PropertyName = 'EmailTo'
INNER JOIN Orion.ActionsProperties ap1 ON ap1.ActionID = a.ActionID
AND ap1.PropertyName = 'EmailCC'
INNER JOIN Orion.ActionsProperties ap2 ON ap2.ActionID = a.ActionID
AND ap2.PropertyName = 'EmailBCC'
INNER JOIN Orion.ActionsAssignments aa ON aa.ActionID = a.ActionID
INNER JOIN Orion.AlertConfigurations ac ON aa.ParentID = ac.AlertID
WHERE
CategoryType = 'trigger'--, 'Reset')
AND ActionTypeID = 'Email'
AND ac.Enabled = 1
ORDER BY
ac.Name