Im trying to create an alert table for a specific container. We have multiple containers for different sites, only allowing the site chiefs access to the custom dashboard for their site. I got this from a different post and have tried to edit it in SWQL Studio to fit a specific container; however I keep returning errors. Extremely new to SWQL and no super proficient in programing languages other than Cisco lol.
SELECT
o.AlertConfigurations.Name AS [ALERT NAME]
,o.EntityCaption AS [ALERT OBJECT]
,o.RelatedNodeCaption AS [RELATED NODE]
,ToLocal(o.AlertActive.TriggeredDateTime) AS [ALERT TRIGGER TIME]
,o.AlertActive.TriggeredMessage AS [ALERT MESSAGE]
,CASE o.AlertConfigurations.Severity
WHEN 0 THEN 'Informational'
WHEN 1 THEN 'Warning'
WHEN 2 THEN 'Critical'
WHEN 3 THEN 'Serious'
WHEN 4 THEN 'Notice'
ELSE CONCAT('Unknown Severity: ', o.AlertConfigurations.Severity)
END AS [Severity]
FROM Orion.AlertObjects AS o
LEFT JOIN Orion.Nodes AS N ON N.Caption = o.RelatedNodeCaption
WHERE o.AlertActive.TriggeredMessage <> ''
ORDER by o.AlertActive.TriggeredDateTime DESC