Anyone have a SWQL that will let me query my AlertConfigurations and see the associated trigger actions (and the actions properties?)
This is what we use:
SELECT TOP 1000 ac.AlertID,ac.AlertMessage,ac.AlertRefID,ac.Name,ac.Description,ac.ObjectType,ac.Enabled,ac.Frequency,ac.Trigger,ac.Reset,ac.Severity,ac.NotifyEnabled,ac.NotificationSettings,ac.LastEdit,ac.CreatedBy,aa.CategoryType, aa.ActionAssignmentID,aa.ActionID--,aa.ParentID--,aa.EnvironmentType--,aa.InstanceType,aa.Uri,ap.Action.Enabled,ap.Action.Title, ap.PropertyName, ap.PropertyValueFROM Orion.AlertConfigurations acLEFT OUTER JOIN Orion.ActionsAssignments aa ON ac.AlertID = aa.ParentIDLEFT OUTER JOIN Orion.ActionsProperties ap ON aa.ActionID = ap.ActionIDwhere 1=1 --and ac.Name like '%service is down%' --You can filter on the Alert name and ac.Enabled = 'True' and ap.PropertyValue like '%Platform%' --You can filter on the property values (such as the json payload) or uri)
@ctech291 Thanks for your QUERY!
SELECT AC.AlertID ,AC.Name ,AC.Enabled ,AA.ActionID ,AA.EnvironmentType ,AA.CategoryType ,AP.PropertyName ,AP.PropertyValueFROM [SolarWindsOrion].[dbo].[AlertConfigurations] ACINNER JOIN [SolarWindsOrion].[dbo].[ActionsAssignments] AA ON AC.AlertID = AA.ParentIDINNER JOIN [SolarWindsOrion].[dbo].[ActionsProperties] AP ON AA.ActionID = AP.ActionIDWHERE AC.Enabled = 1 AND AP.PropertyName IN ('EmailFrom', 'Sender');
Enabled = 1
EmailFrom
Sender
PropertyName = 'Sender'
${DefaultEmailFrom}
PropertyName = 'EmailFrom'
noreply@primient.com
UPDATE APSET AP.PropertyValue = CASE WHEN AP.PropertyName = 'Sender' THEN '${DefaultEmailFrom}' WHEN AP.PropertyName = 'EmailFrom' THEN 'noreply@primient.com' ENDFROM [SolarWindsOrion].[dbo].[ActionsProperties] APINNER JOIN [SolarWindsOrion].[dbo].[ActionsAssignments] AA ON AP.ActionID = AA.ActionIDINNER JOIN [SolarWindsOrion].[dbo].[AlertConfigurations] AC ON AA.ParentID = AC.AlertIDWHERE AC.Enabled = 1 AND AP.PropertyName IN ('Sender', 'EmailFrom');