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

linux实现Icinga_第1张图片   

看到这个图片证明 htpasswd成功

用户名为 icinga 

密码就是htpasswd 设置的密码


linux实现Icinga_第2张图片


客户端安装(Linux)

yum install -y openssl* gcc* 

/usr/sbin/useradd icinga

passwd icinga


tar xvf nagios-cn-plugins-2.0.3.tar.xz

cd nagios-cn-plugins-2.0.3

./configure --prefix=/usr/local/icinga

make

make install

ll /usr/local/icinga/

total 12

drwxr-xr-x 2 icinga icinga 4096 Feb 20 20:30 include

drwxr-xr-x 2 icinga icinga 4096 Feb 20 20:30 libexec

drwxr-xr-x 3 icinga icinga 4096 Feb 20 20:30 share


tar xzvf icinga-nrpe-2.14.tar.gz 

cd icinga-nrpe-2.14

./configure

make all

make install

make install-plugin

make install-daemon

make install-daemon-config

make install-init

/etc/rc.d/init.d/icinga-nrpe restart

netstat -tuplna | grep nrpe

tcp        0      0 0.0.0.0:5666    0.0.0.0:*      LISTEN      51239/nrpe 


/usr/local/icinga/libexec/check_nrpe -H 192.168.1.104  此命令用于在服务端测试

CHECK_NRPE: Error - Could not complete SSL handshake.

vim /usr/local/icinga/etc/nrpe.cfg   此命令用于在Linux客户端修改

allowed_hosts=127.0.0.1 找到

allowed_hosts=127.0.0.1,192.168.1.102  改为(192.168.1.102为服务器ip) 此命令用于在服务端测试

/usr/local/icinga/libexec/check_nrpe -H 192.168.1.104

NRPE v2.14


客户端安装(windows)

NSCP-0.4.1.73-x64.msi


linux实现Icinga_第3张图片



linux实现Icinga_第4张图片


linux实现Icinga_第5张图片

选择 custom


linux实现Icinga_第6张图片



linux实现Icinga_第7张图片



linux实现Icinga_第8张图片



linux实现Icinga_第9张图片


linux实现Icinga_第10张图片


linux实现Icinga_第11张图片



linux实现Icinga_第12张图片



linux实现Icinga_第13张图片


C:\Program Files\NSClient++  修改添加服务端ip

ALLOWED HOSTS - A comaseparated list of allowed hosts. You can use netmasks (/ syntax) or * to create ranges.

allowed hosts = 192.168.1.102

你可能感兴趣的:(linux,实现,icinga)