I have created a custom query to show muted nodes. This works great and I love the feature, but the output is providing UTC time. How can I correct the query in SWQL?
TOLOCAL
Check here for more useful commands - SWQL Functions · solarwinds/OrionSDK Wiki · GitHub
cstimpert Please post your SWQL query so we can see what is going on with it.
We figured it out. After trying about every context we could. Here is what we ended up with. The ADDHOUR in the correct spot was key...
SELECT [N].Caption as [Element]
, [N].DetailsURL as [_LinkFor_Element]
, '/Orion/images/StatusIcons/Small-' + [N].StatusIcon AS [_IconFor_Element]
-- , [N].IP_Address as [IP]
-- , [N].DetailsURL as [_LinkFor_IP]
, ADDHOUR(-4,[Alerts].SuppressFrom) as [Mute From]
, ADDHOUR(-4,[Alerts].SuppressUntil) as [Mute Until]
FROM Orion.AlertSuppression AS [Alerts]
JOIN Orion.Nodes AS [N]
ON [N].Uri = [Alerts].EntityURI
UNION
( SELECT [I].FullName as [Element]
, [I].DetailsURL as [_LinkFor_Element]
, '/Orion/images/StatusIcons/Small-' + [I].StatusIcon AS [_IconFor_Element]
-- , [I].IP_Address as [IP]
-- , [I].DetailsURL as [_LinkFor_IP]
, ADDHOUR(-4,[Alerts].SuppressFrom) as [Mute from]
JOIN Orion.NPM.Interfaces AS [I]
ON [I].Uri = [Alerts].EntityURI
)
(
SELECT [A].FullyQualifiedName AS [Element]
, [A].DetailsUrl AS [_LinkFor_Element]
, '/Orion/APM/images/StatusIcons/Small-App-' + [A].StatusDescription + '.gif' AS [_IconFor_Element]
JOIN Orion.APM.Application AS [A]
ON [A].Uri = [Alerts].EntityURI