Icinga2 + IcingaWeb2 安装小结

Icinga2 安装

1
2
3
4
5
6
7
rpm -i http://packages.icinga.org/epel/6/release/noarch/icinga-rpm-release-6-1.el6.noarch.rpm;
rpm --import http://packages.icinga.org/icinga.key;
curl -o /etc/yum.repos.d/ICINGA-release.repo http://packages.icinga.org/epel/ICINGA-release.repo;
yum makecache;
yum install -y icinga2;
chkconfig icinga2 on;
service icinga2 start;

mysql 安装

1
2
3
4
yum install -y mysql-server mysql;
chkconfig mysqld on;
service mysqld start;
mysql_secure_installation;

导入 mysql 数据

1
2
3
4
5
yum install -y icinga2-ido-mysql;
echo "CREATE DATABASE icinga;GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga.* TO 'icinga'@'localhost' IDENTIFIED BY 'icinga';"|mysql -u root -p;
mysql -u root -p icinga < /usr/share/icinga2-ido-mysql/schema/mysql.sql;
icinga2 feature enable ido-mysql;
service icinga2 restart;

安装 webserver

1
2
3
4
5
6
yum install -y httpd;
chkconfig httpd on;
service httpd start;
setenforce 0;
service iptables stop;
usermod -a -G icingacmd icinga

设置插件权限

1
2
icinga2 feature enable command;
service icinga2 restart;

Icinga Web 2 安装

1
2
3
4
5
6
7
yum install -y epel-release;
yum install -y nagios-plugins-all;
yum install -y icingaweb2 icingacli;
yum install -y php-ldap;
vi /etc/php.ini; #date.timezone = cst
icingacli setup token create;
icingacli setup token show;

登陆 http://IP/icingaweb2/setup 进行配置。