Alert发送告警邮件少了的原因银河网站登录

作者: 银河网站登录  发布:2019-11-07

近期意想不到发掘我们配备在数据库方面包车型客车报告急察方(Alert卡塔 尔(阿拉伯语:قطر‎,当错误日志里面现身错误时,并不是各样错误日志都会发送邮件出来。如下所示,设置了报告急察方“SQL Server Severity Event 14”

 

USE [msdb]

GO

 

 

IF NOT EXISTS(SELECT 1 FROM msdb.dbo.syscategories WHERE NAME='DBA_MONITORING' AND category_class=2)

BEGIN

 

EXEC msdb.dbo.sp_add_category

    @class=N'ALERT',

    @type=N'NONE',

    @name=N'DBA_MONITORING' ;

 

END

GO

 

IF EXISTS(SELECT name FROM msdb.dbo.sysalerts WHERE name= N'SQL Server Severity Event 14')

 

    EXEC msdb.dbo.sp_delete_alert @name=N'SQL Server Severity Event 14'

GO

 

 

EXEC msdb.dbo.sp_add_alert @name=N'SQL Server Severity Event 14',

        @message_id=0,

        @severity=14,

        @enabled=1,

        @delay_between_responses=60,

        @include_event_description_in=1,

        @category_name=N'DBA_MONITORING',

        @job_id=N'00000000-0000-0000-0000-000000000000'

GO

 

 

EXEC msdb.dbo.sp_add_notification @alert_name=N'SQL Server Severity Event 14', @operator_name=N'YourSQLDba_Operator', @notification_method = 1

GO

 

 

下一场本人尝试用sa登陆(sa已经被剥夺卡塔尔了三遍,但是作者只接收了意气风发封邮件。特意查看了大器晚成晃sp_add_alert的合阿尔巴尼亚语档,才驾驭出现那个原因,是因为参数@delay_between_responses的值设置缘故,通过安装该值,能够免守在在长时间内再度发送一些无需的电子邮件。如上所示,一分钟内,固然不当日志里面现身了大气相符的怪诞,也只会发送生机勃勃封报告急察方邮件。其实只是为了减小发送告警的频率,假如你想当错误日志里冒出那几个等级的报告急察方时,都必得发送告警邮件,能够将其值设置为0。但是临时,要是设置为0,你会收取八种的邮件。其实那些小题目,只是因为早先并未有特意注意这几个参数而已。存粹归于未有通透到底驾驭那一个作用罢了。

 

 

 

银河网站登录 1

 

 

 

@delay_between_responses = ] delay_between_responses

The wait period, in seconds, between responses to the alert. delay_between_responsesis int, with a default of 银河网站登录,0, which means there is no waiting between responses (each occurrence of the alert generates a response). The response can be in either or both of these forms:

·          

·         One or more notifications sent through e-mail or pager.

·          

·         A job to execute.

·         By setting this value, it is possible to prevent, for example, unwanted e-mail messages from being sent when an alert repeatedly occurs in a short period of time.

 

@delay_between_responses =] delay_between_responses

警示响应时期的等候时间 (以秒为单位)。delay_between_responsesis int, 暗中认可值为 0, 那代表在响应时期未有等待 (每一遍现身警告都会转变响应)。响应得以是在偏下二种方式中的三个, 只怕都以:

经过电子邮件或寻呼机发送的贰个或几个通告。

要推行的学业。

因此设置此值, 可避防守比方, 在长时间内再一次产生警告时发送不必要的电子邮件。

 

 

参照他事他说加以调查资料:

 

本文由银河网站登录发布于银河网站登录,转载请注明出处:Alert发送告警邮件少了的原因银河网站登录

关键词: