1. Define a host group (this file does not exist and must be defined by itself)
[Email protected] objects]# vim hostgroups.cfg
Define Hostgroup{
Hostgroup_name Node1 #主机组名
Alias Tingyun #别名
Members hostname 1, host name 2 #组中的成员 (host name of each host)
}
Define Hostgroup{
Hostgroup_name Node2
Alias goods
Members hostname 3, hostname 4
}
[Email protected] objects]# vim/usr/local/nagios-4.1.1/etc/nagios.cfg
Cfg_file=/usr/local/nagios-4.1.1/etc/objects/hostgroups.cfg #加载定义主机组的配置文件
[Email protected] objects]# #重启nagios服务
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/82/2D/wKiom1dNVIrBntGcAAB57Cyc7xQ742.png-wh_500x0-wm_3 -wmp_4-s_1737321358.png "title=" 1.png "alt=" Wkiom1dnvirbntgcaab57cyc7xq742.png-wh_50 "/>
2. Define a service group (this file does not exist and must be defined by itself)
[Email protected] objects]# vim servicegroups.cfg
Define Servicegroup{
Servicegroup_name Service Group Name
Alias aliases
Members 1, service 1, Member 2, service 2
}
[Email protected] objects]# vim/usr/local/nagios-4.1.1/etc/nagios.cfg
Cfg_file=/usr/local/nagios-4.1.1/etc/objects/servicegroups.cfg #添加文件
[Email protected] objects]#
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/82/2C/wKioL1dNYFnSiTzZAAAxuxc2nbk091.png-wh_500x0-wm_3 -wmp_4-s_3390503810.png "title=" 2.png "alt=" Wkiol1dnyfnsitzzaaaxuxc2nbk091.png-wh_50 "/>
This article is from the "Days Together" blog, please be sure to keep this source http://tongcheng.blog.51cto.com/6214144/1784951
Nagios Add host Group, service group, contact Group