手工添加nagios监控的组的流程

 
首先定义一个组group01
define hostgroup{
        hostgroup_name                  group01
        alias                           group01
}
再定义一个主机host01属于group01
define host{
        host_name                       host01
        alias                           host01
        address                        (ip)
        hostgroups                      group01
        check_command                   check-host-alive
        check_interval                  5
        retry_interval                  1
        max_check_attempts              5
        check_period                    24x7
        contacts                        nagiosadmin
        contact_groups                  admins
        notification_interval           30
        notification_period             24x7
        }
 
接着定义n个service,让它检测group01组的host01,host02・・・・・主机
 
define service{
        host_name                host01,host02
        hostgroups              group01
        service_description     check-disk
        check_command           check_nrpe!check_sda
        check_interval             5
        retry_interval             1
        max_check_attempts         5
        check_period             24x7
        contacts                nagiosadmin
        contact_groups          admins
        notification_interval   30
        notification_period     24x7
        }
 
可以把以上的配置写成.cfg文件,再把文件的路径的加到nagios.cfg,方法如下
cfg_file=(文件路径)

你可能感兴趣的:(职场,nagios,休闲,nagios组)