icinga 1.9 添加host

通过编译的方式在UBuntu12.10 server上成功安装了Icinga1.9, 这里选用的是Apache2,Nginx暂时还没搞定。

打开网页后,发现只能看到监控localhost,所以需要监控其他host。没有web UI可以完成这个功能。需要到icinga server上操作。

第一步:创建/usr/local/icinga/etc/objects/linux.cfg文件

内容如下:

define host{
        use             linux-server            ; Inherit default values from a template
        host_name       StaticFileServer              ; The name we're giving to this host                                                                                       
        alias           static filer server         ; A longer name associated with the host                                           
        address         10.112.18.131            ; IP address of the host                                                                                                        
        contact_groups  admins                ; Host groups this host is associated with                                                                                         
        }


注意这里的contact_groups的值admins是在文件/usr/local/icinga/etc/objects/contacts.cfg文件中找到的。

第二步:在/usr/local/icinga/etc/icinga.cfg文件中添加一行

cfg_file=/usr/local/icinga/etc/objects/linux.cfg

第三步,运行命令检测配置:

/usr/local/icinga/bin/icinga -v /usr/local/icinga/etc/icinga.cfg


第四步,重新读取配置文件:

service icinga reload


好,现在到网页上查看一下:

有了。

这里有几个网页都说了这个话题,请参考:

http://serverfault.com/questions/305239/how-do-i-add-a-host-in-icinga-web

https://lbtwiki.cern.ch/bin/view/Online/IcingaHosts

http://docs.icinga.org/latest/en/configmain.html#configmain-cfg_file

http://docs.icinga.org/latest/en/objectdefinitions.html#host

原文地址:https://www.cnblogs.com/javawebsoa/p/3080558.html