This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

SQL Script - acknowledge annoying alerts

--find nodeids from Nodes tables--

SELECT NodeID from [SolarWindsOrion].[dbo].[Nodes]

WHERE Caption IN ('Server1', 'Server2', 'Server3', etc)

--below script will clear the events and leave very critical/down alerts in the events table of the frontpage.

BEGIN TRAN

UPDATE E

SET E.ACKNOWLEDGED ='TRUE'

ROM [SolarWindsOrion].[dbo].[Events] E

LEFT JOIN [SolarWindsOrion].[dbo].[Nodes] N ON N.NODEID=E.NETWORKNODE

HERE E.NETWORKNODE IN

(NodeIDs) --NodeIDs from the above SELECT statment

AND E.Message LIKE 'Application%SQL%Up%'

OR  E.Message LIKE 'Application%SQL%WARNING%'

OR E.Message LIKE 'Component%SQL%Up%'

OR E.Message LIKE 'Component%SQL%Warning%'

OR E.Message LIKE '%managed%'

OR E.Message LIKE 'Component%Unknown%'

AND E.EventTime = DATEADD(HH, -1, GETDATE())

--if you like the count of records, uncomment and execute COMMIT TRAN--

--ROLLBACK TRAN

--COMMIT TRAN

Thanks.

Mahidhar Vattem