define hostgroup{
hostgroup_name Basestations and Equipment
alias ACCESS NETWORK
members Buziga-AP1,Buziga-AP2,Buziga-AP4,Buziga-Nsambya BH,Gulu BTS-AP,Hoima-AP1,Hoima-AP2,Hoima-Switch,IPS Fiber-Switch,Jinja-AP1,Katabi Router,Katabi-AP1,Katabi-AP2,Nsambya-AP1,Nsambya-AP2,Nsambya-AP2,Nsambya-AP3,Nsambya-GoddiesAP,Nsambya-LubowaBH,Nsambya-Switch,NsambyaBuzigaBH,SegukuAP,SegukuMAFAP1,Signet-Kololo-TVs-Switch,Soroti-AP1
}
define hostgroup{
hostgroup_name NSAMBYA
alias NSAMBYA
members Nsambya-AP1,Nsambya-AP2,Nsambya-AP3,Nsambya-GoddiesAP,Nsambya-Switch
}
我需要一种方法将NSAMBYA主机组添加到访问网络主机组。我已经尝试了+NSAMBYA的成员,但给出错误下面。
错误:无法找到任何匹配'NSAMBYA'的主机(配置文件'/usr/local/nagios/etc/objects/hostgroups.cfg',从第1行开始)错误:无法展开主机组中指定的成员(配置文件'/usr/local/nagios/etc/objects/hostgroups.cfg',从第1行开始)处理对象配置文件出错!
使用hostgroup_members
将主机组嵌入到另一个主机组中:
define hostgroup{
hostgroup_name linux-subgroup
alias some linux servers
members linux-host01, linux-host02
}
define hostgroup{
hostgroup_name linux-servers
alias all linux servers
members linux-host03, linux-host04
hostgroup_members linux-subgroup
}