温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

nagios监控单个文件大小,超过设定的最大值则发出警报

发布时间:2020-06-15 05:27:51 来源:网络 阅读:1007 作者:24links 栏目:移动开发

nagios监控单个文件大小,超过设定的最大值则发出警报,找了半天结果发现nsclient内置就有这样的功能。解决办法如下

1:在nsc.ini中添加如下内容

check_tempdb=inject CheckFileSize ShowAll MaxWarn=600M MaxCrit=1000M File:Tempdb.MDF=C:\PROGRA~1\MICROS~1\MSSQL.1\MSSQL\Data\tempdb.mdf
 

check_templog=inject CheckFileSize ShowAll MaxWarn=600M MaxCrit=1000M File:Templog.ldf=C:\PROGRA~1\MICROS~1\MSSQL.1\MSSQL\Data\templog.ldf

这里主意如果目录中有空格请用~1来表示

 

2:在nagios中定义如下命令

define service{
        use                     generic-service
        host_name               DBSLHX
        service_description     Check tempdb
        check_command           check_nrpe!check_tempdb
        normal_check_interval   5
        max_check_attempts      6
        notification_interval   30
        retry_check_interval    1
        }
define service{
        use                     generic-service
        host_name               DBSLHX
        service_description     Check templog
        check_command           check_nrpe!check_templog
        normal_check_interval   5
        max_check_attempts      6
        notification_interval   30
        retry_check_interval    1
        }前提是你要已经定义好了check_nrpe哇,在command.cfg中定义

接下来去看看你的nagios中吧,已经现实ok了。。

http://www.nsclient.org/nscp/wiki/CheckFileSize这个文章有详细的说明这个命令。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI