使用Ubuntu 12.10服务器。 与idoutils和icing-web的糖衣。 有能力看到主机,如果我把它们添加到localhost_icinga.cfg
但从我的理解,你可以创build一个基于系统的host.cfg。 例如:windows.cfg通过NSclient ++监视所有的Windows机器(类似于Nagios)
每次我创build一个新的host.cfg icinga要么给我一个重复的错误,或者不喜欢定义主机行。 例如:(localhost_icinga.cfg 工作 )
定义主机{使用generic-host host_name mikedoppdesk别名mikedoppdesk地址192.168.0.56}但是,如果我创build一个windows.cfg例如:定义主机{使用Windows主机名mikedoppdesk别名mikedoppdesk地址192.168.0.56}
并使用:/ usr / sbin / icinga -v /etc/icinga/icinga.cfg
输出错误行1 windows.cfg
我一直在追逐icing Web文件试图得到一个直接的答案。 我知道我缺less重要的东西,但找不到韵或理由。 请教育或certificate我愚蠢。 提前致谢
在通常为/usr/local/icinga/etc/icinga.cfg的主configuration文件中,您应该在开头添加一行不含空格的行:
cfg_file=/usr/local/icinga/etc/conf.d/hosts.cfg
(你也可以在这里看到它: http : //docs.icinga.org/latest/en/configobject.html )。
这意味着你在上面指定的文件中定义对象(这里是主机)。 在该文件中,您应该定义受监视的主机本身
例:
define host{ host_name bogus-router alias Bogus Router #1 address 192.168.1.254 parents server-backbone check_command check-host-alive check_interval 5 retry_interval 1 max_check_attempts 5 check_period 24x7 process_perf_data 0 retain_nonstatus_information 0 contact_groups router-admins notification_interval 30 notification_period 24x7 notification_options d,u,r }
所有可能的选项及其定义可以在这里find( http://docs.icinga.org/latest/en/objectdefinitions.html#objectdefinitions-host )。