I have a request from a client to incorporate SNMP Traps as the method for alerting in SQL Server. The only way I have found to do this is by using [dbo].[sp_add_alert] found in the [msdb] database.
-- Add Message in sysmessages to be used for the alert EXEC sp_addmessage @msgnum = 2624470, @severity = 1, @msgtext = 'A DEV GOT SYSADMIN, RUN!', @lang = 'us_english', @with_log = 'TRUE' -- Create an Alert for a user-defined message in sysmessages EXEC msdb.dbo.sp_add_alert @name = N'Alert_For_UserDefined_Message', @message_id = 2624470, @severity = 0, @enabled = 1, @include_event_description_in = 1, @raise_snmp_trap = 1, @job_id = N'00000000-0000-0000-0000-000000000000' -- Raise error to trigger the Alert RAISERROR (2624470,-1,-1)
However, when I actually raise the error, I only receive the actual Message located in sysmessages.
Now, I'm not too familiar with SNMP Traps, but I feel as though there are some settings that would need to be defined; whether that be at the time of creating the alert or as settings in the server configuration. Am I missing something here?
I came across this forum thread and all I gathered from it was that after version 6.5 this feature stopped doing anything, but there is no documentation to support its lack of functionality.