Notice (8): file_put_contents(): Write of 274 bytes failed with errno=28 No space left on device [CORE/src/Log/Engine/FileLog.php, line 140]

Notice: file_put_contents() [function.file-put-contents]: Write of 1108 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Notice (8): unserialize() [<a href='https://secure.php.net/function.unserialize'>function.unserialize</a>]: Error at offset 4079 of 4085 bytes [APP/Controller/NewsController.php, line 5571]

Notice: file_put_contents() [function.file-put-contents]: Write of 2758 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Warning (2): Undefined array key "nsort" [APP/Controller/NewsController.php, line 3613]

Notice: file_put_contents() [function.file-put-contents]: Write of 2074 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Warning (2): Trying to access array offset on value of type null [APP/Controller/NewsController.php, line 3613]

Notice: file_put_contents() [function.file-put-contents]: Write of 2098 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Warning (2): Undefined array key "nsort" [APP/Controller/NewsController.php, line 3613]

Notice: file_put_contents() [function.file-put-contents]: Write of 2074 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Warning (2): Trying to access array offset on value of type null [APP/Controller/NewsController.php, line 3613]

Notice: file_put_contents() [function.file-put-contents]: Write of 2098 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
SQLServerAlert发送告警邮件少了的原因 - 站长搜索
首页 > 资讯列表 > 编程/数据库 >>

SQLServerAlert发送告警邮件少了的原因

Warning (2): Undefined array key "nsort" [ROOT/plugins/Kuhuang/templates/Websites/view.php, line 430]
Notice: file_put_contents() [function.file-put-contents]: Write of 2422 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Warning (2): Trying to access array offset on value of type null [ROOT/plugins/Kuhuang/templates/Websites/view.php, line 430]

Notice: file_put_contents() [function.file-put-contents]: Write of 2446 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
">
Warning (2): Undefined array key "nsort" [ROOT/plugins/Kuhuang/templates/Websites/view.php, line 430]

Notice: file_put_contents() [function.file-put-contents]: Write of 2422 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Warning (2): Trying to access array offset on value of type null [ROOT/plugins/Kuhuang/templates/Websites/view.php, line 430]

Notice: file_put_contents() [function.file-put-contents]: Write of 2446 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
2022-09-23 18:22:59 转载来源: 网络整理/侵权必删

最近突然发现我们部署在数据库上面的告警(Alert),当错误日志里面出现错误时,并不是每个错误日志都会发送邮件出来。如下所示,设置了告警“SQLServerSeverityEvent14” USE[msdb]GOIFNOTEXISTS(SELECT1FROMmsdb.dbo.syscategoriesWHERENAME='DBA_MONITORING'ANDcategory_class=2)BEGINEXECmsdb.dbo.sp_add_category@class=N'ALERT',@type=N'NONE',@name=N'DBA_MONITORING';ENDGOIFEXISTS(SELECTnameFROMmsdb.dbo.sysalertsWHEREname=N'SQLServerSeverityEvent14')EXECmsdb.dbo.sp_delete_alert@name=N'SQLServerSeverityEvent14'GOEXECmsdb.dbo.sp_add_alert@name=N'SQLServerSeverityEvent14',@mess

最近突然发现我们部署在数据库上面的告警(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' ; ENDGO 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 = 1GO

然后我尝试用sa登录(sa已经被禁用)了三次,但是我只收到了一封邮件。特意查看了一下sp_add_alert的官方文档,才知道出现这个原因,是因为参数@delay_between_responses的值设置缘故,通过设置该值,可以防止在在短时间内重复发送一些不需要的电子邮件。如上所示,一分钟内,即使错误日志里面出现了大量类似的错误,也只会发送一封告警邮件。其实只是为了减少发送告警的频率,如果你想当错误日志里出现这个级别的告警时,都必须发送告警邮件,可以将其值设置为0。但是有时候,如果设置为0,你会收到铺天盖地的邮件。其实这个小问题,只是因为以前没有特意留意这个参数而已。存粹属于没有彻底了解这些功能罢了。

警报响应之间的等待时间 (以秒为单位)。delay_between_responsesis int, 默认值为 0, 这意味着在响应之间没有等待 (每次出现警报都会生成响应)。响应可以是在以下两种形式中的一个, 或者都是:
通过电子邮件或寻呼机发送的一个或多个通知。
要执行的作业。
通过设置此值, 可以防止例如, 在短时间内重复发生警报时发送不需要的电子邮件。 

参考资料: 

https://docs.microsoft.com/zh-cn/sql/relational-databases/system-stored-procedures/sp-add-alert-transact-sql

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

标签: SQLServerAlert 发送 告警 邮件 了的 原因


声明:本文内容来源自网络,文字、图片等素材版权属于原作者,平台转载素材出于传递更多信息,文章内容仅供参考与学习,切勿作为商业目的使用。如果侵害了您的合法权益,请您及时与我们联系,我们会在第一时间进行处理!我们尊重版权,也致力于保护版权,站搜网感谢您的分享!

站长搜索

http://www.adminso.com

Copyright @ 2007~2025 All Rights Reserved.

Powered By 站长搜索

打开手机扫描上面的二维码打开手机版


使用手机软件扫描微信二维码

关注我们可获取更多热点资讯

站长搜索目录系统技术支持