系统环境rhel和Centos都可以安装
这里我们所使用的安装包为中文版的icinga-cn-1.9.3.tar.bz2
(1)安装icinga软件所支持的组件包(我们这里采用yum源的方式)
组件:
libdbi-dbd-mysql-0.8.3-5.1.el6.x86_64.rpm
gd-devel-2.0.35-11.el6.x86_64.rpm libdbi-0.8.3-4.el6.x86_64.rpm
libdbi-devel-0.8.3-4.el6.x86_64.rpm
yum install gd-* libdbi-* (centos安装方式)
3.安装icinga中文安装包
tar jxf icinga-cn-1.9.3.tar.bz2 //解压
编译 ./configure
Web Interface Options:
------------------------
HTML URL: http://localhost/icinga/
CGI URL: http://localhost/icinga/cgi-bin/
Main URL: http://localhost/icinga/cgi-bin/tac.cgi
Review the options above for accuracy. If they look okay,
type 'make all' to compile the main program and CGIs.
!!! Please take care about the upgrade documentation !!!
以上提示安装成功
icinga-cn-1.9.3]#make all //全部编译
icinga-cn-1.9.3]# make fullinstall
make[1]: Entering directory `/opt/icinga/icinga-cn-1.9.3'
cd ./base && make install
make[2]: Entering directory `/opt/icinga/icinga-cn-1.9.3/base'
make install-basic
make[3]: Entering directory `/opt/icinga/icinga-cn-1.9.3/base'
/usr/bin/install -c -m 775 -o icinga -g icinga -d /usr/local/icinga/bin
/usr/bin/install: 无效的用户"icinga"
make[3]: *** [install-basic] 错误 1
make[3]: Leaving directory `/opt/icinga/icinga-cn-1.9.3/base'
make[2]: *** [install] 错误 2
make[2]: Leaving directory `/opt/icinga/icinga-cn-1.9.3/base'
make[1]: *** [install] 错误 2
make[1]: Leaving directory `/opt/icinga/icinga-cn-1.9.3'
Run make install-config for installing/overwriting the configs...
以上错误时没有创建用户
创建用户
icinga-cn-1.9.3]# useradd icinga
再次编译
icinga-cn-1.9.3]# make fullinstall
Resuming with install...
/usr/bin/install -c -m 775 -o icinga -g icinga -d /usr/local/icinga/bin
/usr/bin/install -c -m 775 -o icinga -g icinga -d /usr/local/icinga/lib
/usr/bin/install -c -m 755 -o icinga -g icinga ido2db /usr/local/icinga/bin
/usr/bin/install -c -m 755 -o icinga -g icinga log2ido /usr/local/icinga/bin
/usr/bin/install -c -m 755 -o icinga -g icinga idomod.so /usr/local/icinga/lib
make[3]: Leaving directory `/opt/icinga/icinga-cn-1.9.3/module/idoutils/src'
/usr/bin/install -c -m 775 -o icinga -g icinga -d /usr/local/icinga/etc
/usr/bin/install: 无法创建目录"/usr/local/icinga/etc": 文件已存在
make[2]: *** [install] 错误 1
make[2]: Leaving directory `/opt/icinga/icinga-cn-1.9.3/module/idoutils'
make[1]: *** [install-idoutils] 错误 2
make[1]: Leaving directory `/opt/icinga/icinga-cn-1.9.3'
Run make install-config for installing/overwriting the configs...
以上错误提示 etc这个目录存在了
我们就把这个/usr/local/icinga/etc/ 删除 rm -rf /usr/local/etc
重新安装配置文件 icinga-cn-1.9.3]# make install-config
给用户添加密码
etc]# htpasswd -mc htpasswd.users icingaadmin
New password:
Re-type new password:
htpasswd: password verification error
You have mail in /var/spool/mail/root
以上就配置完成了。
4.安装服务插件(这里我使用了nagios的插件)
步骤:
(1)将nagios的服务插件制作成yum源安装
(2)配置yum源
(3)安装nrpe和nagios服务控件
(4)查看nrpe服务和测试
(5)查看各自的服务器目录
icinga生成的服务插件目录是:/usr/local/icinga/libexec
nagios生成的服务插件目录是:/usr/local/nagios/libexec
5.启动icinga
首先启动 httpd 服务
service httpd restart
再次启动
service icinga restart
6.访问http
http://127.0.0.1/icinga
成功
7.配置被监控端的配置(这里也需要安装nrpe和nagios服务插件《步骤同上4》)
(1)被监控端配置nrpe插件服务(添加服务端的ip)
8.在icinga软件中配置主机模本和主机服务
(1)服务配置模板目录:(/usr/local/icinga/etc/objects/commands.cfg)
(2)配置主机模本目录:/usr/local/icinga/etc/objects(复制源模板并修改成自己定义的模板)
(3)指定服务模板路径(/usr/local/icinga/etc/icinga.cfg)
8.实现mysql的监控
(1)在被监控端创建mysql的监控授权用户和密码
grant all privileges on *.* to 'monitor'@'192.168.*.*' identified by 'monitor';
(2)模板引用(/usr/local/icinga/etc/objects/commands.cfg)
(3)定义服务(/usr/local/icinga/etc/objects/linux.cfg)