Nagios的安装与使用详细教程

2019-10-13 23:41:56丽君

找到” dont_blame_nrpe=0” 改为  “dont_blame_nrpe=1”

启动客户端 /etc/init.d/nrpe start

3. 监控中心(192.168.0.11)添加被监控主机(192.168.0.12)


vim /etc/nagios/conf.d/192.168.0.12.cfg                 
define host{
        use                   linux-server           
       host_name          192.168.0.12
       alias                      0.12
       address                192.168.0.12
        }
define service{
        use                   generic-service
       host_name              192.168.0.12              
       service_description     check_ping
       check_command          check_ping!100.0,20%!200.0,50%      #0是ok,20是警告,50是危险
        max_check_attempts5                    #单位是秒数
       normal_check_interval 1
}
define service{
        use                   generic-service
       host_name              192.168.0.12
       service_description     check_ssh
       check_command          check_ssh
       max_check_attempts      5    ;当nagios检测到问题时,一共尝试检测5次都有问题才会告警,如果该数值为1,那么检测到问题立即告警
       normal_check_interval 1   ;重新检测的时间间隔,单位是分钟,默认是3分钟