linux实现Icinga
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux实现Icinga相关的知识,希望对你有一定的参考价值。
ICINGA项目是 由Michael Luebben、HendrikB?cker和JoergLinge等人发起的,他们都是现有的Nagios项目社区委员会的成员,他们承诺,新的开源项 目将完全兼容以前的Nagios应用程序及扩展功能。在新项目的网站上,他们是如此定义ICINGA的,这将是一个介于Nagios社区版和企业版间的产 品。特别将致力于解决Nagios项目现在的问题,比如不能及时处理Nagios项目的bug、新功能不能及时添加等。还有在新的ICINGA项目中,将 更好的实现数据库集成方面的功能,标准化第三发应用程序的接口等。
实验环境
centos6.5(x64)
实验软件
icinga-cn-1.12.2.tar.xz
nagios-cn-plugins-2.0.3.tar.xz
icinga-nrpe-2.14.tar.gz
软件安装
yum clean all
yum makecache -y
yum install -y httpd* gcc* glibc* gd* libjpeg* libpng* mysql* libdbi*
/usr/sbin/useradd -m icinga
passwd icinga
/usr/sbin/groupadd icinga-cmd
/usr/sbin/usermod -a -G icinga-cmd icinga
/usr/sbin/usermod -a -G icinga-cmd apache
vim /etc/httpd/conf/httpd.conf
#ServerName www.example.com:80 找到
ServerName *:80 修改
tar xvf icinga-cn-1.12.2.tar.xz
cd icinga-cn-1.12.2
./configure --with-command-group=icinga-cmd --enable-idoutils
Web Interface Options:
------------------------
html URL: http://localhost/icinga/
CGI URL: http://localhost/icinga/cgi-bin/
Main URL: http://localhost/icinga/cgi-bin/status.cgi?allunhandledproblems
UI THEME: ui_theme=ui-smoothness
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 !!! 出现这个说明配置没有错误
make all
make fullinstall
make install-config
service mysqld restart
mysqladmin -uroot password 123456
mysql -uroot -p
CREATE DATABASE icinga;
GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga.* TO ‘icinga‘@‘localhost‘ IDENTIFIED BY ‘icinga‘;
cd icinga-cn-1.12.2/module/idoutils/db/mysql/
mysql -uroot -p icinga < mysql.sql
vim /usr/local/icinga/etc/ido2db.cfg 查看四行配置
db_servertype=mysql
db_port=3306
db_user=icinga
db_pass=icinga
cd icinga-cn-1.12.2
make cgis
make install-cgis
make install-html
make install-webconf
htpasswd -c /usr/local/icinga/etc/htpasswd.users icingaadmin
service httpd restart
tar xvf nagios-cn-plugins-2.0.3.tar.xz
cd nagios-cn-plugins-2.0.3
./configure --prefix=/usr/local/icinga --with-cgiurl=/icinga/cgi-bin --with-nagios-user=icinga --with-nagios-group=icinga
make
make install
tar xvf icinga-nrpe-2.14.tar.gz
cd icinga-nrpe-2.14
./configure
make
make install
make install-plugin
make install-init
make install-xinetd
make install-daemon-config
vim /etc/sysconfig/selinux
SELINUX=disabled
/etc/rc.d/init.d/ido2db restart
/etc/rc.d/init.d/icinga restart
chkconfig --level 35 ido2db on
chkconfig --level 35 icinga on
/usr/local/icinga/bin/icinga -v /usr/local/icinga/etc/icinga.cfg
Icinga 1.12.2
Copyright (c) 2009-2015 Icinga Development Team (http://www.icinga.org)
Copyright (c) 2009-2013 Nagios Core Development Team and Community Contributors
Copyright (c) 2009-2014 icinga-cn中文化组
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 02-14-2015
License: GPL
读取配置数据...
警报: 未知 ‘event_profiling_enabled‘ 配置设置. 将其从配置中移除!
Read main config file okay...
Processing object config directory ‘/usr/local/icinga/etc/conf.d‘...
Processing object config file ‘/usr/local/icinga/etc/objects/commands.cfg‘...
Processing object config file ‘/usr/local/icinga/etc/objects/contacts.cfg‘...
Processing object config file ‘/usr/local/icinga/etc/objects/notifications.cfg‘...
Processing object config file ‘/usr/local/icinga/etc/objects/timeperiods.cfg‘...
Processing object config file ‘/usr/local/icinga/etc/objects/templates.cfg‘...
Processing object config file ‘/usr/local/icinga/etc/objects/localhost.cfg‘...
Processing object config file ‘/usr/local/icinga/etc/objects/linux.cfg‘...
Processing object config directory ‘/usr/local/icinga/etc/modules‘...
Processing object config file ‘/usr/local/icinga/etc/modules/idoutils.cfg‘...
Read object config files okay...
Running pre-flight check on configuration data...
Checking services...
已检查17服务.
检查主机...
已检查2主机.
检查主机组...
已检查2主机组.
检查服务组...
已检查2服务组.
检查联系人...
已检查1联系人.
检查联系人组...
已检查1联系人组.
检查服务升级...
已检查0服务升级.
检查服务依赖关系...
已检查0服务依赖关系.
检查主机升级...
已检查0主机升级.
检查主机依赖关系...
已检查0主机依赖关系.
检查命令...
已检查36命令.
检查时间段...
已检查6时间段.
检查模块...
已检查1模块.
检查主机之间的回路...
检查回路主机和服务的依赖性...
检查全局事件处理...
检查强迫性处理命令...
检查杂项设置...
总计警报s: 0
总计错误: 0 出现这些信息表示配置文件没有错误
登入web界面测试
http://192.168.1.101/icinga
看到这个图片证明 htpasswd成功
用户名为 icinga
密码就是htpasswd 设置的密码
看到这个页面服务端配置完成
以上是关于linux实现Icinga的主要内容,如果未能解决你的问题,请参考以下文章