How to Install Icinga Web 2 on CentOS 8 - CentLinux

Latest

Tuesday, 14 January 2020

How to Install Icinga Web 2 on CentOS 8

How to Install Icinga Web 2 on CentOS 8

Icinga web 2 is a web interface for Icinga, a popular network monitoring software. In this article, you will learn how to install Icinga web 2 on CentOS 8 server.

 

This Article Provides:

     

    What is Icinga Web 2? :

    Icinga web 2 is a PHP based web application that provides a web interface for Icinga 2 network monitoring server. Icinga Web 2 is fast, responsive, accessible and easily extensible with modules.

    Icinga Web 2 provides an intuitive user interface to monitor network devices with Icinga 2. Especially there are lots of list and detail views for hosts and services. You can sort and filter depending on what you want to see.

    System administrators can also control the network monitoring process itself by sending external commands to Icinga. Most such actions, like rescheduling a check, can be done with just a single click.

    We have configured an Icinga 2 server on CentOS 8 in our previous post. Now we are exploring how to install Icinga Web 2 on the same CentOS 8 server.

    Instructions in this article are of advance level, if you are new to Linux world then we strongly recommend you to read Red Hat RHCSA 8 Cert Guide: EX200 (Certification Guide) by Pearson IT Certification. It will provides basic to intermediate knowledge about the RHEL (Red Hat Enterprise Linux) 8, CentOS 8 or similar Linux distros.

     

    Environment Specification:

    We are using a CentOS 8 (minimal) virtual machine with following specifications.

    • CPU - 3.4 Ghz (2 cores)
    • Memory - 2 GB
    • Storage - 20 GB
    • Operating System - CentOS 8.0
    • Hostname - icinga-2.centlinux.com
    • IP Address - 192.168.116.206 /24

     

    Installing Apache Web Server with PHP on CentOS 8:

    Icinga Web 2 is a PHP based web interface for Icinga 2. Therefore, we need a PHP application server to deploy it.

    Connect with icinga-2.centlinux.com as root user by using a ssh client.

    We are installing Apache web server and PHP by using following dnf command.

    [root@icinga-2 ~]# dnf install -y httpd php-fpm php-ldap php-json Last metadata expiration check: 0:41:40 ago on Sat 11 Jan 2020 12:25:52 PM PKT. Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: httpd x86_64 2.4.37-12.module_el8.0.0+185+5908b0db AppStream 1.7 M php-fpm x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 1.6 M php-json x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 73 k php-ldap x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 79 k Installing dependencies: apr x86_64 1.6.3-9.el8 AppStream 125 k apr-util x86_64 1.6.1-6.el8 AppStream 105 k centos-logos-httpd noarch 80.5-2.el8 AppStream 24 k httpd-filesystem noarch 2.4.37-12.module_el8.0.0+185+5908b0db AppStream 35 k httpd-tools x86_64 2.4.37-12.module_el8.0.0+185+5908b0db AppStream 102 k mod_http2 x86_64 1.11.3-3.module_el8.0.0+185+5908b0db AppStream 158 k nginx-filesystem noarch 1:1.14.1-9.module_el8.0.0+184+e34fea82 AppStream 24 k php-common x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 653 k mailcap noarch 2.1.48-3.el8 BaseOS 39 k Installing weak dependencies: apr-util-bdb x86_64 1.6.1-6.el8 AppStream 25 k apr-util-openssl x86_64 1.6.1-6.el8 AppStream 27 k Enabling module streams: httpd 2.4 nginx 1.14 php 7.2 Transaction Summary ================================================================================ Install 15 Packages Total download size: 4.7 M Installed size: 17 M Downloading Packages: (1/15): apr-util-bdb-1.6.1-6.el8.x86_64.rpm 11 kB/s | 25 kB 00:02 (2/15): apr-util-openssl-1.6.1-6.el8.x86_64.rpm 44 kB/s | 27 kB 00:00 (3/15): apr-util-1.6.1-6.el8.x86_64.rpm 38 kB/s | 105 kB 00:02 (4/15): apr-1.6.3-9.el8.x86_64.rpm 43 kB/s | 125 kB 00:02 (5/15): centos-logos-httpd-80.5-2.el8.noarch.rp 59 kB/s | 24 kB 00:00 (6/15): httpd-filesystem-2.4.37-12.module_el8.0 91 kB/s | 35 kB 00:00 (7/15): httpd-tools-2.4.37-12.module_el8.0.0+18 75 kB/s | 102 kB 00:01 (8/15): nginx-filesystem-1.14.1-9.module_el8.0. 86 kB/s | 24 kB 00:00 (9/15): mod_http2-1.11.3-3.module_el8.0.0+185+5 71 kB/s | 158 kB 00:02 (10/15): php-common-7.2.11-1.module_el8.0.0+56+ 111 kB/s | 653 kB 00:05 (11/15): php-json-7.2.11-1.module_el8.0.0+56+d1 78 kB/s | 73 kB 00:00 (12/15): php-ldap-7.2.11-1.module_el8.0.0+56+d1 57 kB/s | 79 kB 00:01 (13/15): mailcap-2.1.48-3.el8.noarch.rpm 27 kB/s | 39 kB 00:01 (14/15): httpd-2.4.37-12.module_el8.0.0+185+590 112 kB/s | 1.7 MB 00:15 (15/15): php-fpm-7.2.11-1.module_el8.0.0+56+d1c 102 kB/s | 1.6 MB 00:16 -------------------------------------------------------------------------------- Total 200 kB/s | 4.7 MB 00:24 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : php-common-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86 1/15 Installing : apr-1.6.3-9.el8.x86_64 2/15 Running scriptlet: apr-1.6.3-9.el8.x86_64 2/15 Installing : apr-util-bdb-1.6.1-6.el8.x86_64 3/15 Installing : apr-util-openssl-1.6.1-6.el8.x86_64 4/15 Installing : apr-util-1.6.1-6.el8.x86_64 5/15 Running scriptlet: apr-util-1.6.1-6.el8.x86_64 5/15 Running scriptlet: httpd-filesystem-2.4.37-12.module_el8.0.0+185+5908 6/15 Installing : httpd-filesystem-2.4.37-12.module_el8.0.0+185+5908 6/15 Installing : httpd-tools-2.4.37-12.module_el8.0.0+185+5908b0db. 7/15 Installing : mailcap-2.1.48-3.el8.noarch 8/15 Running scriptlet: nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34 9/15 Installing : nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34 9/15 Installing : centos-logos-httpd-80.5-2.el8.noarch 10/15 Installing : mod_http2-1.11.3-3.module_el8.0.0+185+5908b0db.x86 11/15 Installing : httpd-2.4.37-12.module_el8.0.0+185+5908b0db.x86_64 12/15 Running scriptlet: httpd-2.4.37-12.module_el8.0.0+185+5908b0db.x86_64 12/15 Installing : php-fpm-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 13/15 Running scriptlet: php-fpm-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 13/15 Installing : php-json-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_6 14/15 Installing : php-ldap-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_6 15/15 Running scriptlet: httpd-2.4.37-12.module_el8.0.0+185+5908b0db.x86_64 15/15 Running scriptlet: php-ldap-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_6 15/15 Running scriptlet: php-fpm-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 15/15 Verifying : apr-1.6.3-9.el8.x86_64 1/15 Verifying : apr-util-1.6.1-6.el8.x86_64 2/15 Verifying : apr-util-bdb-1.6.1-6.el8.x86_64 3/15 Verifying : apr-util-openssl-1.6.1-6.el8.x86_64 4/15 Verifying : centos-logos-httpd-80.5-2.el8.noarch 5/15 Verifying : httpd-2.4.37-12.module_el8.0.0+185+5908b0db.x86_64 6/15 Verifying : httpd-filesystem-2.4.37-12.module_el8.0.0+185+5908 7/15 Verifying : httpd-tools-2.4.37-12.module_el8.0.0+185+5908b0db. 8/15 Verifying : mod_http2-1.11.3-3.module_el8.0.0+185+5908b0db.x86 9/15 Verifying : nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34 10/15 Verifying : php-common-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86 11/15 Verifying : php-fpm-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 12/15 Verifying : php-json-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_6 13/15 Verifying : php-ldap-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_6 14/15 Verifying : mailcap-2.1.48-3.el8.noarch 15/15 Installed: httpd-2.4.37-12.module_el8.0.0+185+5908b0db.x86_64 php-fpm-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 php-json-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 php-ldap-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 apr-util-bdb-1.6.1-6.el8.x86_64 apr-util-openssl-1.6.1-6.el8.x86_64 apr-1.6.3-9.el8.x86_64 apr-util-1.6.1-6.el8.x86_64 centos-logos-httpd-80.5-2.el8.noarch httpd-filesystem-2.4.37-12.module_el8.0.0+185+5908b0db.noarch httpd-tools-2.4.37-12.module_el8.0.0+185+5908b0db.x86_64 mod_http2-1.11.3-3.module_el8.0.0+185+5908b0db.x86_64 nginx-filesystem-1:1.14.1-9.module_el8.0.0+184+e34fea82.noarch php-common-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 mailcap-2.1.48-3.el8.noarch Complete!

    Add a default page for Apache web server. It is mandatory, or otherwise Icinga’s HTTP service will raise an 403 Forbidden Error.

    [root@icinga-2 ~]# echo "HomePage" > /var/www/html/index.html [root@icinga-2 ~]# chmod 755 /var/www/html/index.html

    Start and enable Apache and PHP services.

    [root@icinga-2 ~]# systemctl enable --now httpd.service php-fpm.service Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service /lib/systemd/system/httpd.service. Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.servic sr/lib/systemd/system/php-fpm.service.

    Allow Apache service in CentOS 8 firewall.

    [root@icinga-2 ~]# firewall-cmd --permanent --add-service=http success [root@icinga-2 ~]# firewall-cmd --reload success

     

    Create a MySQL Database for Icinga Web 2:

    We have already installed MariaDB on the same Linux server in our previous post. Therefore, we can now create the Icinga Web 2 backend database on the same MySQL server.

    Login to MySQL server as root user.

    [root@icinga-2 ~]# mysql -u root -p123 Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 16 Server version: 10.3.11-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>

    Create a MySQL database for Icinga Web 2 as follows.

    MariaDB [(none)]> CREATE DATABASE icingaweb; Query OK, 1 row affected (0.028 sec)

    Create a database user for Icinga Web 2 and grant complete privileges on icinga database.

    MariaDB [(none)]> GRANT ALL PRIVILEGES ON icingaweb.* TO 'icinga'@'localhost' IDENTIFIED BY 'Ahmer@1234'; Query OK, 0 rows affected (0.143 sec)

    Reload privileges table and exit from MySQL shell.

    MariaDB [(none)]> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.066 sec) MariaDB [(none)]> EXIT; Bye

     

    Installing Icinga Web 2 on CentOS 8:

    We have already added the Icinga 2 yum repository in our Linux package manager. Therefore, we can easily install Icinga Web 2 and Icinga CLI using a dnf command.

    [root@icinga-2 ~]# dnf install -y icingacli icingaweb2 icingaweb2-selinux Last metadata expiration check: 0:44:34 ago on Sat 11 Jan 2020 12:25:52 PM PKT. Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: icingacli noarch 2.7.3-1.el8.icinga icinga-stable-release 13 k icingaweb2 noarch 2.7.3-1.el8.icinga icinga-stable-release 2.4 M Installing dependencies: gd x86_64 2.2.5-6.el8 AppStream 144 k jbigkit-libs x86_64 2.1-14.el8 AppStream 55 k libX11 x86_64 1.6.7-1.el8 AppStream 612 k libX11-common noarch 1.6.7-1.el8 AppStream 157 k libXau x86_64 1.0.8-13.el8 AppStream 36 k libXpm x86_64 3.5.12-7.el8 AppStream 58 k libjpeg-turbo x86_64 1.5.3-7.el8 AppStream 155 k libpq x86_64 10.5-1.el8 AppStream 188 k libtiff x86_64 4.0.9-13.el8 AppStream 188 k libwebp x86_64 1.0.0-1.el8 AppStream 273 k libxcb x86_64 1.13-5.el8 AppStream 230 k php x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 1.5 M php-cli x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 3.1 M php-gd x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 83 k php-intl x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 192 k php-mbstring x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 580 k php-mysqlnd x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 190 k php-pdo x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 122 k php-pgsql x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 117 k php-xml x86_64 7.2.11-1.module_el8.0.0+56+d1ca79aa AppStream 188 k dejavu-fonts-common noarch 2.35-6.el8 BaseOS 74 k dejavu-sans-fonts noarch 2.35-6.el8 BaseOS 1.5 M fontconfig x86_64 2.13.1-3.el8 BaseOS 275 k fontpackages-filesystem noarch 1.44-22.el8 BaseOS 16 k icingaweb2-common noarch 2.7.3-1.el8.icinga icinga-stable-release 169 k icingaweb2-vendor-HTMLPurifier noarch 1:2.7.3-1.el8.icinga icinga-stable-release 268 k icingaweb2-vendor-JShrink noarch 2.7.3-1.el8.icinga icinga-stable-release 14 k icingaweb2-vendor-Parsedown noarch 2.7.3-1.el8.icinga icinga-stable-release 17 k icingaweb2-vendor-dompdf noarch 2.7.3-1.el8.icinga icinga-stable-release 2.1 M icingaweb2-vendor-lessphp noarch 2.7.3-1.el8.icinga icinga-stable-release 44 k icingaweb2-vendor-zf1 noarch 2.7.3-1.el8.icinga icinga-stable-release 678 k php-Icinga noarch 2.7.3-1.el8.icinga icinga-stable-release 308 k Transaction Summary ================================================================================ Install 34 Packages Total download size: 16 M Installed size: 57 M Downloading Packages: (1/34): jbigkit-libs-2.1-14.el8.x86_64.rpm 39 kB/s | 55 kB 00:01 (2/34): gd-2.2.5-6.el8.x86_64.rpm 66 kB/s | 144 kB 00:02 (3/34): libXau-1.0.8-13.el8.x86_64.rpm 102 kB/s | 36 kB 00:00 (4/34): libX11-common-1.6.7-1.el8.noarch.rpm 104 kB/s | 157 kB 00:01 (5/34): libXpm-3.5.12-7.el8.x86_64.rpm 93 kB/s | 58 kB 00:00 (6/34): libjpeg-turbo-1.5.3-7.el8.x86_64.rpm 116 kB/s | 155 kB 00:01 (7/34): libpq-10.5-1.el8.x86_64.rpm 109 kB/s | 188 kB 00:01 (8/34): libtiff-4.0.9-13.el8.x86_64.rpm 108 kB/s | 188 kB 00:01 (9/34): libX11-1.6.7-1.el8.x86_64.rpm 96 kB/s | 612 kB 00:06 (10/34): libwebp-1.0.0-1.el8.x86_64.rpm 114 kB/s | 273 kB 00:02 (11/34): libxcb-1.13-5.el8.x86_64.rpm 119 kB/s | 230 kB 00:01 (12/34): php-gd-7.2.11-1.module_el8.0.0+56+d1ca 95 kB/s | 83 kB 00:00 (13/34): php-intl-7.2.11-1.module_el8.0.0+56+d1 124 kB/s | 192 kB 00:01 (14/34): php-mbstring-7.2.11-1.module_el8.0.0+5 109 kB/s | 580 kB 00:05 (15/34): php-mysqlnd-7.2.11-1.module_el8.0.0+56 114 kB/s | 190 kB 00:01 (16/34): php-pdo-7.2.11-1.module_el8.0.0+56+d1c 92 kB/s | 122 kB 00:01 (17/34): php-pgsql-7.2.11-1.module_el8.0.0+56+d 71 kB/s | 117 kB 00:01 (18/34): php-7.2.11-1.module_el8.0.0+56+d1ca79a 112 kB/s | 1.5 MB 00:14 (19/34): php-xml-7.2.11-1.module_el8.0.0+56+d1c 93 kB/s | 188 kB 00:02 (20/34): dejavu-fonts-common-2.35-6.el8.noarch. 20 kB/s | 74 kB 00:03 (21/34): php-cli-7.2.11-1.module_el8.0.0+56+d1c 171 kB/s | 3.1 MB 00:18 (22/34): fontpackages-filesystem-1.44-22.el8.no 19 kB/s | 16 kB 00:00 (23/34): fontconfig-2.13.1-3.el8.x86_64.rpm 91 kB/s | 275 kB 00:03 (24/34): icingacli-2.7.3-1.el8.icinga.noarch.rp 7.6 kB/s | 13 kB 00:01 (25/34): icingaweb2-common-2.7.3-1.el8.icinga.n 121 kB/s | 169 kB 00:01 (26/34): icingaweb2-vendor-HTMLPurifier-2.7.3-1 118 kB/s | 268 kB 00:02 (27/34): icingaweb2-vendor-JShrink-2.7.3-1.el8. 36 kB/s | 14 kB 00:00 (28/34): icingaweb2-vendor-Parsedown-2.7.3-1.el 41 kB/s | 17 kB 00:00 (29/34): dejavu-sans-fonts-2.35-6.el8.noarch.rp 81 kB/s | 1.5 MB 00:18 (30/34): icingaweb2-2.7.3-1.el8.icinga.noarch.r 148 kB/s | 2.4 MB 00:16 (31/34): icingaweb2-vendor-lessphp-2.7.3-1.el8. 12 kB/s | 44 kB 00:03 (32/34): icingaweb2-vendor-dompdf-2.7.3-1.el8.i 156 kB/s | 2.1 MB 00:14 (33/34): icingaweb2-vendor-zf1-2.7.3-1.el8.icin 161 kB/s | 678 kB 00:04 (34/34): php-Icinga-2.7.3-1.el8.icinga.noarch.r 96 kB/s | 308 kB 00:03 -------------------------------------------------------------------------------- Total 323 kB/s | 16 MB 00:50 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Running scriptlet: icingaweb2-common-2.7.3-1.el8.icinga.noarch 1/34 Installing : icingaweb2-common-2.7.3-1.el8.icinga.noarch 1/34 Installing : php-pdo-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 2/34 Installing : libjpeg-turbo-1.5.3-7.el8.x86_64 3/34 Installing : fontpackages-filesystem-1.44-22.el8.noarch 4/34 Installing : php-cli-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 5/34 Installing : php-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 6/34 Installing : dejavu-fonts-common-2.35-6.el8.noarch 7/34 Installing : dejavu-sans-fonts-2.35-6.el8.noarch 8/34 Installing : fontconfig-2.13.1-3.el8.x86_64 9/34 Running scriptlet: fontconfig-2.13.1-3.el8.x86_64 9/34 Installing : php-mysqlnd-7.2.11-1.module_el8.0.0+56+d1ca79aa.x8 10/34 Installing : icingaweb2-vendor-HTMLPurifier-1:2.7.3-1.el8.icing 11/34 Installing : icingaweb2-vendor-JShrink-2.7.3-1.el8.icinga.noarc 12/34 Installing : icingaweb2-vendor-Parsedown-2.7.3-1.el8.icinga.noa 13/34 Installing : icingaweb2-vendor-dompdf-2.7.3-1.el8.icinga.noarch 14/34 Installing : icingaweb2-vendor-lessphp-2.7.3-1.el8.icinga.noarc 15/34 Installing : icingaweb2-vendor-zf1-2.7.3-1.el8.icinga.noarch 16/34 Installing : php-xml-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 17/34 Installing : php-mbstring-7.2.11-1.module_el8.0.0+56+d1ca79aa.x 18/34 Installing : php-intl-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_6 19/34 Installing : libwebp-1.0.0-1.el8.x86_64 20/34 Installing : libpq-10.5-1.el8.x86_64 21/34 Installing : php-pgsql-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_ 22/34 Installing : libXau-1.0.8-13.el8.x86_64 23/34 Installing : libxcb-1.13-5.el8.x86_64 24/34 Installing : libX11-common-1.6.7-1.el8.noarch 25/34 Installing : libX11-1.6.7-1.el8.x86_64 26/34 Installing : libXpm-3.5.12-7.el8.x86_64 27/34 Installing : jbigkit-libs-2.1-14.el8.x86_64 28/34 Running scriptlet: jbigkit-libs-2.1-14.el8.x86_64 28/34 Installing : libtiff-4.0.9-13.el8.x86_64 29/34 Installing : gd-2.2.5-6.el8.x86_64 30/34 Running scriptlet: gd-2.2.5-6.el8.x86_64 30/34 Installing : php-gd-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 31/34 Installing : php-Icinga-2.7.3-1.el8.icinga.noarch 32/34 Installing : icingacli-2.7.3-1.el8.icinga.noarch 33/34 Running scriptlet: icingaweb2-2.7.3-1.el8.icinga.noarch 34/34 Installing : icingaweb2-2.7.3-1.el8.icinga.noarch 34/34 Running scriptlet: icingaweb2-2.7.3-1.el8.icinga.noarch 34/34 Running scriptlet: fontconfig-2.13.1-3.el8.x86_64 34/34 Verifying : gd-2.2.5-6.el8.x86_64 1/34 Verifying : jbigkit-libs-2.1-14.el8.x86_64 2/34 Verifying : libX11-1.6.7-1.el8.x86_64 3/34 Verifying : libX11-common-1.6.7-1.el8.noarch 4/34 Verifying : libXau-1.0.8-13.el8.x86_64 5/34 Verifying : libXpm-3.5.12-7.el8.x86_64 6/34 Verifying : libjpeg-turbo-1.5.3-7.el8.x86_64 7/34 Verifying : libpq-10.5-1.el8.x86_64 8/34 Verifying : libtiff-4.0.9-13.el8.x86_64 9/34 Verifying : libwebp-1.0.0-1.el8.x86_64 10/34 Verifying : libxcb-1.13-5.el8.x86_64 11/34 Verifying : php-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 12/34 Verifying : php-cli-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 13/34 Verifying : php-gd-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 14/34 Verifying : php-intl-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_6 15/34 Verifying : php-mbstring-7.2.11-1.module_el8.0.0+56+d1ca79aa.x 16/34 Verifying : php-mysqlnd-7.2.11-1.module_el8.0.0+56+d1ca79aa.x8 17/34 Verifying : php-pdo-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 18/34 Verifying : php-pgsql-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_ 19/34 Verifying : php-xml-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 20/34 Verifying : dejavu-fonts-common-2.35-6.el8.noarch 21/34 Verifying : dejavu-sans-fonts-2.35-6.el8.noarch 22/34 Verifying : fontconfig-2.13.1-3.el8.x86_64 23/34 Verifying : fontpackages-filesystem-1.44-22.el8.noarch 24/34 Verifying : icingacli-2.7.3-1.el8.icinga.noarch 25/34 Verifying : icingaweb2-2.7.3-1.el8.icinga.noarch 26/34 Verifying : icingaweb2-common-2.7.3-1.el8.icinga.noarch 27/34 Verifying : icingaweb2-vendor-HTMLPurifier-1:2.7.3-1.el8.icing 28/34 Verifying : icingaweb2-vendor-JShrink-2.7.3-1.el8.icinga.noarc 29/34 Verifying : icingaweb2-vendor-Parsedown-2.7.3-1.el8.icinga.noa 30/34 Verifying : icingaweb2-vendor-dompdf-2.7.3-1.el8.icinga.noarch 31/34 Verifying : icingaweb2-vendor-lessphp-2.7.3-1.el8.icinga.noarc 32/34 Verifying : icingaweb2-vendor-zf1-2.7.3-1.el8.icinga.noarch 33/34 Verifying : php-Icinga-2.7.3-1.el8.icinga.noarch 34/34 Installed: icingacli-2.7.3-1.el8.icinga.noarch icingaweb2-2.7.3-1.el8.icinga.noarch gd-2.2.5-6.el8.x86_64 jbigkit-libs-2.1-14.el8.x86_64 libX11-1.6.7-1.el8.x86_64 libX11-common-1.6.7-1.el8.noarch libXau-1.0.8-13.el8.x86_64 libXpm-3.5.12-7.el8.x86_64 libjpeg-turbo-1.5.3-7.el8.x86_64 libpq-10.5-1.el8.x86_64 libtiff-4.0.9-13.el8.x86_64 libwebp-1.0.0-1.el8.x86_64 libxcb-1.13-5.el8.x86_64 php-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 php-cli-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 php-gd-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 php-intl-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 php-mbstring-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 php-mysqlnd-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 php-pdo-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 php-pgsql-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 php-xml-7.2.11-1.module_el8.0.0+56+d1ca79aa.x86_64 dejavu-fonts-common-2.35-6.el8.noarch dejavu-sans-fonts-2.35-6.el8.noarch fontconfig-2.13.1-3.el8.x86_64 fontpackages-filesystem-1.44-22.el8.noarch icingaweb2-common-2.7.3-1.el8.icinga.noarch icingaweb2-vendor-HTMLPurifier-1:2.7.3-1.el8.icinga.noarch icingaweb2-vendor-JShrink-2.7.3-1.el8.icinga.noarch icingaweb2-vendor-Parsedown-2.7.3-1.el8.icinga.noarch icingaweb2-vendor-dompdf-2.7.3-1.el8.icinga.noarch icingaweb2-vendor-lessphp-2.7.3-1.el8.icinga.noarch icingaweb2-vendor-zf1-2.7.3-1.el8.icinga.noarch php-Icinga-2.7.3-1.el8.icinga.noarch Complete!

    Icinga Web 2 web application runs as apache user, therefore, we need to adjust SELinux file context, so the apache user can edit Icinga Web 2 configuration files in /etc/icingaweb2 directory.

    [root@icinga-2 ~]# semanage fcontext -a -t httpd_sys_rw_content_t /etc/icingaweb2 [root@icinga-2 ~]# restorecon -Rv /etc/icingaweb2 Relabeled /etc/icingaweb2 from system_u:object_r:etc_t:s0 to system_u:object_r:httpd_sys_rw_content_t:s0

    Generate Icinga Web 2 configurations for Apache web server.

    [root@icinga-2 ~]# icingacli setup config webserver apache Alias /icingaweb2 "/usr/share/icingaweb2/public" # Remove comments if you want to use PHP FPM and your Apache version is older than 2.4 #<IfVersion < 2.4> # # Forward PHP requests to FPM # SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 # <LocationMatch "^/icingaweb2/(.*\.php)$"> # ProxyPassMatch "fcgi://127.0.0.1:9000//usr/share/icingaweb2/public/$1" # </LocationMatch> #</IfVersion> <Directory "/usr/share/icingaweb2/public"> Options SymLinksIfOwnerMatch AllowOverride None DirectoryIndex index.php <IfModule mod_authz_core.c> # Apache 2.4 <RequireAll> Require all granted </RequireAll> </IfModule> <IfModule !mod_authz_core.c> # Apache 2.2 Order allow,deny Allow from all </IfModule> SetEnv ICINGAWEB_CONFIGDIR "/etc/icingaweb2" EnableSendfile Off <IfModule mod_rewrite.c> RewriteEngine on RewriteBase /icingaweb2/ RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] </IfModule> <IfModule !mod_rewrite.c> DirectoryIndex error_norewrite.html ErrorDocument 404 /icingaweb2/error_norewrite.html </IfModule> # Remove comments if you want to use PHP FPM and your Apache version # is greater than or equal to 2.4 # <IfVersion >= 2.4> # # Forward PHP requests to FPM # SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 # <FilesMatch "\.php$"> # SetHandler "proxy:fcgi://127.0.0.1:9000" # ErrorDocument 503 /icingaweb2/error_unavailable.html # </FilesMatch> # </IfVersion> </Directory>

    Restart Apache service to apply new configurations.

    [root@icinga-2 ~]# systemctl restart httpd.service

     

    Run Web Setup to Configure Icinga Web 2 on CentOS 8:

    Generate a token for using on the Icinga web 2 setup.

    [root@icinga-2 ~]# icingacli setup token create The newly generated setup token is: da04f0b87929cec8

    open URL http://icinga-2.centlinux.com/icingaweb2/setup in a web browser.

    01-install-icinga-web-2-centos-8-welcome

    We are now started the web setup of Icinga Web 2.

    Enter the token here and click on Next.

    02-install-icinga-web-2-centos-8-modules

    Select the module to enable and click on Next.

    03-install-icinga-web-2-centos-8-requirements

    Check and rectify if there is any missing requirement.

    Click on Next.

    04-install-icinga-web-2-centos-8-authentication-type

    Choose your preferred authentication type. We are using "Database" authentication type.

    Click on Next.

    05-install-icinga-web-2-centos-8-database-resource

    Define parameters to access our MySQL data store and click on Validate configuration.

    When done, click on Next.

    06-install-icinga-web-2-centos-8-authentication-backend

    Click on Next.

    07-install-icinga-web-2-centos-8-administration

    Create an admin user for Icinga Web 2 and click on Next.

    08-install-icinga-web-2-centos-8-application-configuration

    Customize settings according to your requirements and click on Next.

    09-install-icinga-web-2-centos-8-summary

    Review the configurations that we have made so far and click on Next.

    10-install-icinga-web-2-centos-8-monitoring-module

    Click on Next.

    11-install-icinga-web-2-centos-8-monitoring-ido-resource

    Define parameters to access our MySQL data store and click on Validate configuration.

    12-install-icinga-web-2-centos-8-command-transport

    Choose "Local Command File" as Transport Type.

    Click on Next.

    13-install-icinga-web-2-centos-8-monitoring-security

    Click on Next.

    14-install-icinga-web-2-centos-8-monitoring-summary

    Click on Finish.

    15-install-icinga-web-2-centos-8-completed

    Click on Login

    16-install-icinga-web-2-centos-8-login-page

    Login as admin user.

    17-install-icinga-web-2-centos-8-dashboard

    We are now at the dashboard of the Icinga Web 2.

     

    Conclusion:

    We have successfully installed and configured Icinga Web 2 on CentOS 8 server. Now, you can use Icinga network monitoring software more conveniently.

    No comments:

    Post a comment