1、概述
ICINGA项目是 由Michael Luebben、Hendrik Backer和JoergLinge等人发起的,他们都是现有的Nagios项目社区委员会的成员,他们承诺,新的开源项 目将完全兼容以前的Nagios应用程序及扩展功能。在新项目的网站上,他们是如此定义ICINGA的,这将是一个介于Nagios社区版和企业版间的产 品。特别将致力于解决Nagios项目现在的问题,比如不能及时处理Nagios项目的bug、新功能不能及时添加等。还有在新的ICINGA项目中,将 更好的实现数据库集成方面的功能,标准化第三发应用程序的接口等。
中文项目地址:http://icinga-cn.sourceforge.net/

2、安装基础环境apache+php+mysql,请注意php版本需求,要求5.2以上
系统环境,建议Centos6,因为Centos5的php版本低,会导致icinga-web界面无法显示。

[root@monitor ~]#yum install zlib libpng libjpeg fontconfig gd libxml2 libgd-devel libpng-devel libjpeg-devel zlib-devel gd-devel
[root@monitor ~]#yum install php-mysql php-gd php-bcmath php-mbstring mysql-server httpd php mysql-dev gcc net-snmp-devel curl-devel perl-DBI mysql-dev gcc net-snmp net-snmp-devel curl-devel perl-DBI  php-xml

3、安装icinga

[root@monitor ~]#tar xjvf  icinga-cn-1.6.1.tar.bz2 
[root@monitor ~]#cd icinga-cn-1.6.1
[root@monitor ~]#useradd -M icinga -s /sbin/nologin
[root@monitor ~]#groupadd icingaadmin
[root@monitor ~]#usermod -G icingaadmin icinga
[root@monitor ~]#usermod -G icingaadmin apache
[root@monitor ~]#yum install libdbi libdbi-devel libdbi-dbd-mysql libdbi-drivers
[root@monitor ~]#./configure --prefix=/usr/local/icinga   --with-command-group=icinga   --enable-idoutils --with-web-apache-path=/etc/httpd/conf.d/ --enable-embedded-perl
[root@monitor ~]#make all
[root@monitor ~]#make install
[root@monitor ~]#make install-init
[root@monitor ~]#make install-commandmode
[root@monitor ~]#make install-idoutils
[root@monitor ~]#make install-api
[root@monitor ~]#make install-config
[root@monitor ~]#make install-webconf
[root@monitor ~]#ldd /usr/local/icinga/bin/ido2db 
[root@monitor ~]#htpasswd -c /usr/local/icinga/etc/htpasswd.users icinga

[root@monitor ~]#vi /usr/local/icinga/etc/cgi.cfg
在所有含有icingaadmin的行后面添加icinga

[root@monitor ~]#mysql -u root -p
[root@monitor ~]#mysql> CREATE DATABASE icinga;
[root@monitor ~]#mysql> GRANT USAGE ON *.* TO 'icinga'@'localhost' IDENTIFIED BY 'icinga' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0;
[root@monitor ~]#mysql> GRANT SELECT , INSERT , UPDATE , DELETE ON icinga.* TO 'icinga'@'localhost';
[root@monitor ~]#mysql> FLUSH PRIVILEGES;
[root@monitor ~]#mysql> quit
 
IDOUtils配置文件
[root@monitor ~]#vi /usr/local/icinga/etc/ido2db.cfg
db_servertype=mysql
db_port=3306
db_user=icinga
db_pass=icinga

[root@monitor ~]#mysql -uroot -p icinga < /opt/icinga/icinga-cn-1.6.1/module/idoutils/db/mysql/mysql.sql 
配置数据库支持
[root@monitor ~]#vi /usr/local/icinga/etc/icinga.cfg
broker_module=/usr/local/icinga/bin/idomod.o config_file=/usr/local/icinga/etc/idomod.cfg
[root@monitor ~]#/usr/local/icinga/bin/icinga -v /usr/local/icinga/etc/icinga.cfg
[root@monitor ~]#/etc/init.d/ido2db start
[root@monitor ~]#/etc/init.d/icinga start


[root@monitor ~]#tar xjvf icinga-cn-web-1.5.2.tar.bz2 
[root@monitor ~]#cd icinga-cn-web-1.5.2
[root@monitor ~]#./configure --prefix=/usr/local/icinga-web --with-web-user=apache --with-web-group=apache --with-db-type=mysql --with-db-host=localhost --with-db-port=3306 --with-db-name=icinga_web --with-db-user=icinga --with-db-pass=icinga --with-icinga-api=/usr/local/icinga/share/icinga-api --with-web-apache-path=/etc/httpd/conf.d
[root@monitor ~]#make
[root@monitor ~]#make install
[root@monitor ~]#make install-apache-config
[root@monitor ~]#mysql -u root -p
[root@monitor ~]#mysql> CREATE DATABASE icinga_web;
[root@monitor ~]#mysql> GRANT USAGE ON *.* TO 'icinga'@'localhost' IDENTIFIED BY 'icinga' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0;
[root@monitor ~]#mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, INDEX ON icinga_web.* TO 'icinga'@'localhost';
[root@monitor ~]#mysql> quit
[root@monitor ~]#make db-initialize
   

[root@monitor ~]#tar xjvf icinga\(nagios\)-cn-plugins-1.4.15.tar.bz2 
[root@monitor ~]#cd icinga-cn-plugins-1.4.15/
[root@monitor ~]#./configure  
[root@monitor ~]#make
[root@monitor ~]#make install
[root@monitor ~]#/etc/init.d/icinga restart
[root@monitor ~]#/etc/init.d/httpd restart
 

One thought on “Icinga-cn安装”

发表评论

电子邮件地址不会被公开。 必填项已用*标注