nagios远程监控


nagios远程监控必须依赖于nrpe

不知道什么是nrpe的,此文略过

监控端需求 path/to/nagios/libexc/check_nrpe

被控端需求 nrpe --daemon

监控端配置checkcommand示例

define command {
                command_name                          check_remote
                command_line                          $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

被控端配置nrpe.cfg示例

 

command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_droot]=/usr/local/nagios/libexec/check_disk -w 30% -c 20% -p /dev/sda2
command[check_dhome2]=/usr/local/nagios/libexec/check_disk -w 30% -c 20% -p /dev/sdb1
command[check_cpu]=/usr/local/nagios/libexec/check_procs -w 150 -c 250 --metric=CPU 
command[check_procs]=/usr/local/nagios/libexec/check_procs -w 400 -c 600
command[check_mysqlcpu]=/usr/local/nagios/libexec/check_procs -w 100 -c 200 -u mysql -m CPU
command[check_whoistop]=/usr/local/nagios/libexec/check_whoistop 100 200


监控端service配置实例

define service {
                service_description                   check_whoistop
                check_command                         check_remotecheck_whoistop
                host_name                             php218
                check_period                          24x7
                notification_period                   24x7
                contact_groups                        admins
                event_handler_enabled                 0
                notification_interval                 15
                notification_options                  w,u,c,r
                max_check_attempts                    3
                check_interval                        5
                retry_interval                        1
                active_checks_enabled                 1
                passive_checks_enabled                0
                notifications_enabled                 1
                check_freshness                       0
                freshness_threshold                   86400
}

check_remote:服务端本地的command;调用本地check_nrpe来执行被控端的check_whoistop命令,check_whoistop在被控端的nrpe.cfg内定义
关于自定义的监控插件check_whoistop 见:
http://blog.csdn.net/sudoers/article/details/6913368

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值