icinga2 php模块,安装配置icinga2

申明:

程序:icinga2

网页:icingaweb2

一、设置SELinux

[[email protected] ~]# setenforce 0

[[email protected] ~]# echo ‘setenforce 0‘ >> /etc/rc.local

二、设置iptables

[[email protected] ~]# vi /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

[[email protected] ~]# service iptables restart

[[email protected] ~]# chkconfig iptables on

三、设置ntp

[[email protected] ~]# yum install ntp -y

*/20 * * * * /usr/sbin/ntpdate 202.120.2.101 >/dev/null &

四、安装开发工具

[[email protected] ~]# yum groupinstall Development tools

五、安装软件依赖包

[[email protected] ~]# yum install php-cli php-pear php-xmlrpc php-xsl php-pdo php-soap php-gd php-ldap

[[email protected]_139_76_centos ~]# yum install php php-mysql -y

[[email protected]_139_76_centos ~]# yum update

六、获取icinga2 epel

[[email protected] ~]# wget http://packages.icinga.org/epel/ICINGA-release.repo -O /etc/yum.repos.d/ICINGA-release.repo

[[email protected] ~]# yum makecache

七、安装icinga2

[[email protected] ~]# yum install icinga2

[[email protected] ~]# yum install   boost-regex boost-system boost-test boost-thread icinga2-common libboost_regex-mt   libboost_system-mt libboost_thread-mt

八、安装MySQL

[[email protected] ~]# yum install mysql-server mysql -y

[[email protected] ~]# service mysqld start

[[email protected] ~]# /usr/bin/mysqladmin -u root password ‘Delln4020‘

[[email protected] ~]# chkconfig mysqld on

九、安装icingaweb2

[[email protected]_139_76_centos ~]# yum install httpd -y

[[email protected]_139_76_centos ~]# git clone git://git.icinga.org/icingaweb2.git

[[email protected]_139_76_centos ~]# mv icingaweb2 /usr/share/icingaweb

[[email protected]_139_76_centos ~]# /usr/share/icingaweb/bin/icingacli setup config webserver apache --document-root /usr/share/icingaweb/public

Alias /icingaweb "/usr/share/icingaweb/public"

Options SymLinksIfOwnerMatch

AllowOverride None

# Apache 2.4

Require all granted

# Apache 2.2

Order allow,deny

Allow from all

SetEnv ICINGAWEB_CONFIGDIR "/etc/icingaweb"

EnableSendfile Off

RewriteEngine on

RewriteBase /icingaweb/

RewriteCond %{REQUEST_FILENAME} -s [OR]

RewriteCond %{REQUEST_FILENAME} -l [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]

RewriteRule ^.*$ index.php [NC,L]

DirectoryIndex error_norewrite.html

ErrorDocument 404 /error_norewrite.html

[[email protected]_139_76_centos ~]# vi /etc/httpd/conf.d/icingaweb.conf

#写入以上生成的配置文件

[[email protected]_139_76_centos ~]# chown apache.apache /usr/share/icingaweb/public/* -R

[[email protected]_139_76_centos ~]# service httpd start

[[email protected]_139_76_centos ~]# chkconfig iptables on

十、创建icinga数据库

[[email protected] ~]# mysql -u root -p

mysql> create database icinga;

mysql> grant select, insert, update, delete, drop, create view, index, execute on icinga.* to [email protected] identified by ‘icinga‘;

mysql> grant execute on icinga.* to [email protected];

mysql> flush privileges;

mysql> quit

十一、创建icingaweb2数据库

[[email protected] ~]# mysql -u root -p

mysql> create database icingaweb2;

mysql> grant select, insert, update, delete, drop, create view, index, execute on icingaweb2.* to [email protected] identified by ‘

‘;

mysql> flush privileges;

mysql> quit

十二、安装DB DBO

[[email protected] ~]# yum install icinga2-ido-mysql icinga-idoutils-libdbi-mysql

十三、导入数据库

[[email protected] ~]# mysql -u root -p icinga < /usr/share/icinga2-ido-mysql/schema/mysql.sql

[[email protected]_139_76_centos ~]# mysql -u root -p icingaweb2 < /usr/share/icingaweb/etc/schema/mysql.schema.sql

十四、安装插件

[[email protected] ~]# yum install nagios-plugins-all

十五、启动icinga2和IDO

[[email protected] ~]# service icinga2 start

[[email protected] ~]# chkconfig icinga2 on

[[email protected] ~]# service ido2db start

[[email protected] ~]# chkconfig ido2db on

十六、访问icinga2

[[email protected] conf]# service httpd restart

[[email protected] conf]# chkconfig httpd on

1f82413c6b6660a9adc02f3830e888c3.png

[[email protected]_139_76_centos ~]# /usr/share/icingaweb/bin/icingacli setup config createDirectory apache

[[email protected]_139_76_centos ~]# /usr/share/icingaweb/bin/icingacli setup token create

The newly generated setup token is: 3d10d82c93f20cb3

8d001cbafd00ce42e8099228a0a10d35.png5e9298c5a21f90e16facf4ff1f1db24e.png

[[email protected]_139_76_centos ~]# vi /etc/php.ini

;date.timezone =

改成:

date.timezone = Asia/Shanghai

[[email protected]_139_76_centos ~]# yum install php-intl

[[email protected]_139_76_centos ~]# yum install php-pecl-imagick

[[email protected]_139_76_centos ~]# yum install php-pgsql

[[email protected]_139_76_centos ~]# service httpd restart

a8e4a2716ee071b940782c44b5f435c9.pnga5621374da482f8925172d75a1c83930.png5aadc864136a2c07b08083b350035e32.png42e66d6fbb4807fc277d83f3f368581d.png3470fe380e439013b86cb7b3eb3c166c.png29bd46a616c319cbaeb6120adfb004cb.png479a8b0c6148196f041a5bd3b4b7f16a.png60f017a8b5867d52244983f283d39aee.pngfa98e34e2ba1b4f375e41a266f397192.pngdd2cf6a70eb321062a0b8228059abdc7.png001c870333716d382fe53aa53f908dc1.png4f1c52680097c96e1b333e114e35b932.png2f85b50d744eeb04cfb40524370672c9.pnga38a5c20f25c126bf92cd6ba58606ef6.png884757d59994a54859a3731902ad88e5.png

本文出自 “linjianying110” 博客,谢绝转载!

原文:http://linjianying110.blog.51cto.com/3482215/1591635

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值