September 2, 2022 at 10:47 am
Is there anyway to send alert email if someone disable the DDL trigger?
Alert notification should include detail like who did disable the trigger, when it was done, Trigger name etc
Please send me the script if possible
September 2, 2022 at 11:26 am
September 2, 2022 at 11:42 am
Thanks but this is more related to create DDL trigger and send alert for any DB OBJECT CHANGE events like Create/Alter/Drop etc
I am looking to alert if someone disable the DDL trigger itself.
September 2, 2022 at 1:30 pm
You can run a scheduled job to look for it w/ something like the following:
declare @recipientCSV varchar(8000)='recipients@yourcompany.com';
declare @subject varchar(1000)='ALERT - Trigger Missing or Disabled';
declare @text varchar(max)='Trigger ALERT on Server ' + @@servername;
if not exists (select * from sys.server_triggers where name='TriggerName' and is_disabled=0)
begin
exec msdb.dbo.sp_send_dbmail
@recipients = @recipientCSV,
@body = @html,
@body_format = 'text',
@subject = @subject;
end
September 2, 2022 at 10:01 pm
We have such a system in place. It won't stand up in court, though because, me being a DBA with SysAdmin privs (or anyone else with SysAdmin privs) could turn off the monitoring, have our way with things, and then turn it back on.
IMHO, there would need to be some sort of external monitoring that would write to a file that virtually no one had access to but I'm not sure even that would stand up in court because someone always has access to anything.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply