How to Install Icinga 2 and Icinga Web 2 on CentOS 7

Icinga is an open-source network monitoring application that provides us with Icinga Web 1 and Icinga Web 2 interfaces to fully manage and monitor the hosts and services through a dashboard. Icinga Web 2 is the successor of Icinga web which is lightweight, fast and flexible to embed into other projects that support multiple authentication methods like Active Directory, LDAP or database and multiple monitoring back ends. So, this a major advance in the creation of hosts and services actions, instead of defining them via Icinga's configuration files and every user is now enabled to create them with the web interface and even share them to others.

We can customize and configure the Icinga Web 2 using many modules for its views, filters and dashboards. Timestamps and status updates can be refreshed automatically every second, rolling along smoothly saving your eyes the strain of flickering displays.

In this tutorial we learn how to install Icinga 2 and Icinga Web2 on CentOS 7.

Installing Prerequisites

Icinga Web 2 installation depends upon a number of following packages that must be installed on your system before the installation of Icinga Web 2 on CentOS 7.

Let's follow the below steps to complete the prerequisites by installing required packages and other settings.

1) System Update

Login to your system with root or sudo user privileges and run the following command to update your system.

# yum update

2) Installing Icinga 2

To install Icinga 2 we will use the official package repositories that can be downloaded from this Icinga Web Page.

To setup EPRL repositories for Icinga Installation run the following commands.

To import the archive key and to setup the surrent stable builds of Icinga, run below command.

# rpm --import
# wget -O /etc/yum.repos.d/ICINGA-release.repo
# yum makecache

Now run the Icinga 2 Installation command as shown below.

# yum install icinga2

The following number of packages including the dependencies will be installed as shown. To proceed run type the "Y" key to continue.

Package Arch Version Repository Size
icinga2 x86_64 2.3.10-1.el7.centos icinga-stable-release 9.1 k
Installing for dependencies:
boost-program-options x86_64 1.53.0-23.el7 base 155 k
boost-regex x86_64 1.53.0-23.el7 base 294 k
boost-system x86_64 1.53.0-23.el7 base 39 k
boost-thread x86_64 1.53.0-23.el7 base 56 k
icinga2-bin x86_64 2.3.10-1.el7.centos icinga-stable-release 2.2 M
icinga2-common x86_64 2.3.10-1.el7.centos icinga-stable-release 73 k

Transaction Summary
Install 1 Package (+6 Dependent packages)

Total download size: 2.8 M
Installed size: 15 M
Is this ok [y/d/N]: y

3) Starting Icinga 2

Upon successful installation of Icinga 2 , now start its services and enable them to start at each reboot.

Run the following commands to Enable, Start and check the the status of Icinga 2 service on Centos 7.

# systemctl enable icinga2
# systemctl start icinga2
# systemctl status icinga2

4) MySQL Database Setup

We will be using the MySQL data base that will be used for Icinga web 2 interface. So, let's run the below commands to install MySQL MariaDB.

# yum install mariadb-server mariadb

After installation completes, start the mariadb services and configure its root password using the below command.

#systemctl enable mariadb
#systemctl start mariadb

Create New Database

Now login to the mysql/mariadb and create the new database with a new user with its specific privileges on the database using the below commands.

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

MariaDB [(none)]> GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga2.* TO 'icinga2'@'localhost' IDENTIFIED BY 'icinga123';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]>exit

5) Installing MySQL IDO Module

Run the below command to install IDO MySQL module for Icinga2.

#yum install icinga2-ido-mysql

Now import the Icinga 2 IDO schema using the following command.

# mysql -u root -p icinga2 < /usr/share/icinga2-ido-mysql/schema/mysql.sql

A new configuration file will be created after installation of Icinga IDO Module which is located in /etc/icinga2/features-available/ido-mysql.conf. So, open this file using any editor and update the database credentials in this file.

library "db_ido_mysql"
object IdoMysqlConnection "ido-mysql" {
//user = "icinga"
//password = "icinga"
//host = "localhost"
//database = "icinga"

Then enable module and check the list it should now listed under the enabled module by using the following command in centos 7.

[root@centos-7 ~]# icinga2 feature enable ido-mysql
warning/cli: Feature 'ido-mysql' already enabled.

To check which features are enabled and disabled.

[root@centos-7 ~]# icinga2 feature list

You check and change the dataabase configuration setting if required by using the below file.

# vim /etc/icinga2/features-available/ido-mysql.conf

6) Web server Setup

After completing the database installation and configuration setup, now we move towards Apache web server installation before starting the Icinga Web 2.

Let's run the below commands to to setup your web server installation.

In centOS, you can use the following commands to install apache server and start its services as shown.

# yum install httpd
# systemctl enable httpd
# systemctl start httpd

Firewall Setting
Use the following commands to allow apache services in your firewall.

# firewall-cmd --add-service=http
# firewall-cmd --permanent --add-service=http
# firewall-cmd --reload
# iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
# service iptables save

7) External Command Pipe Setup

To enable the External Command Pipe we will be using the below, so that the Web interfaces and other Icinga addons are able to send commands to Icinga 2 through the external command pipe.

# icinga2 feature enable command
Enabling feature command. Make sure to restart Icinga 2 for these changes to take effect.
# service icinga2 restart
# icinga2 feature list
Disabled features: api compatlog debuglog gelf graphite icingastatus livestatus opentsdb perfdata statusdata syslog
Enabled features: checker command ido-mysql mainlog notification

Icinga Web 2 Installation

Now start the installation of Icinga Web 2

# rpm --import
# curl -o /etc/yum.repos.d/ICINGA-release.repo
# yum makecache
# yum install icingaweb2 icingacli

Icinga Web 2 Setup

When the installion is complete, Open your web browser and give the URL using your hostname or the IP address with the addition to ‘/icingaweb2/setup’. You will find the below Icinga Web 2 setup wizard as shown.

Icinga Web 2 Setp

As shown above this asks for a setup token, so make sure you run the server this installation of Icinga Web 2 runs on. Go back to your terminal and run the below commands.

# icingacli setup token create

The newly generated setup token is: 8cfe15c9b0d7ef2a

I you forget the newly created token, you can check by using the below command.

# icingacli setup token show
The current setup token is: 8cfe15c9b0d7ef2a

Copy the newly created token and place it on the web setup to move to next setup.

Then you will be directed to the pre installed modules setup so, simply press the next key.

Icinga Web 2 Modules

Now this the below is the main section to configure all the requirements before moving to the next step.

Icinga Web 2 Requirements

We have to fulfill all these requirements, so first of all we will configure the time zone and then install the required php modules using the below commands.

# vim /etc/php5/apache2/php.ini
date.timezone = Europe/London
# apt-get install php5-json php5-gd php5-imagick php5-pgsql php5-intl

After installation restart the apache web services and press the refresh key to re check the requirements and you will found no missing module as shown below.

Icinga Web 2 Requirements

Next option is to choose the authentication type, where as we will be using here the database as a authentication method.

Icinga Web 2 Auth

Now we need to configure the database resource where to store users and user groups. Before moving to next option press the Database validation key.

Icinga Web2 DB

Upon providing the credentials you might get the below message, but there is nothing to worry if your are unable to validate your database just choose the skip validation option and click on the next button.

Icinga Web2 DB setup

If you chooses to skip validation, then you will be asked to recreate your administrator account, choose the user name and give it a password.

Icinga Web2 Admin

Then choose the appropriate options to adjust all application and logging related configuration options to fit your needs as shown.

Icinga Web2 App Conf

At this point you've configured Icinga Web 2 successfully. You can review the changes supposed to be made before setting it up. Make sure that everything is correct (Feel free to navigate back to make any corrections!) so that you can start using Icinga Web 2 right after it has successfully been set up.

Icinga Web 2 Configurations

Welcome to the configuration of the monitoring module for Icinga Web 2!

This is the core module for Icinga Web 2. It offers various status and reporting views with powerful filter capabilities that allow you to keep track of the most important events in your monitoring environment.

Then choose the monitoring backend configuration that how it retrieve the information.

Icinga Monitoring BAcken

Choose the database name, user and its password that you created after installing the Icinga IDO MySQL Module and then validate the database.

Monitoring IDO database

Choose the default options for Command transport and Monitoring Security and that it you've configured the monitoring module successfully. Now take review of the changes and click on the finish button to ‘Finish’ to make sure everything has been setup well.

Icinga Web 2

Icinga Web 2 Dashboard

Icinga Web 2 Dashboard


We have successfully installed and configured Icinga Web 2 and ready to Monitoring our hosts and services through its interactive web interface. Hopefully you understand all the steps, so feel free to to share your your experience if you face any kind of difficulty while preparing your own Icinga Web 2 setup on CentOS or Ubutu.

8 Comments... add one

  1. Your instructions stop working for me at the follow point (I'm installing via CentOS 7):

    Icinga Web 2 Setup:

    When the installion is complete, Open your web browser and give the URL using your hostname or the IP address with the addition to ‘/icingaweb2/setup’. You will find the below Icinga Web 2 setup wizard as shown.

    I do not see the web configuration page (however I do see the apache default website), did we need to set the apache default location by chance? If so, can you update your instructions?

    Also the firewall settings below do not work as well:

    # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
    # service iptables save

    • Hi,

      It looks you might have some issue at "Icinga Web 2 Installation"

      # yum install icingaweb2 icingacli

      ERROR: icingaweb2 requires php-pecl-imagick

      To install php-pecl-imagick on CentOS 7, you have to enable REMI Repository using following commands.

      1) # yum install epel-release
      2) # rpm -Uvh
      3) # yum install php-pecl-imagick
      4) # yum install icingaweb2 icingacli

      After successful installation, you can check its following Virtual Host file.

      5) # cat /etc/httpd/conf.d/icingaweb2.conf

      After that Restart Apache Services and then Open the mentioned URL.

      6) # systemctl restart httpd
      7) http://your_servers_ip/icingaweb2/setup

      Please Note Following Firewall settings are in case if you are using iptables like in CentOS 6.

      # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
      # service iptables save

      I hope this helps you in fix of your issue.


  2. Hi You,
    The first, thanks for your'guild is so great ! I installed and go the final steps but i get a problem with install Icinga Web2 . I hope you will help me fix problem this.
    Thanks for all !
    (monitoring module for Icinga Web 2!)

    Step: Monitoring IDO Resource
    When i login with user: icinga2-idol-mysq / pass: ****** into database: cinga2idolmysql, then i get warning:

    Failed to successfully validate the configuration: Connection failed SQLSTATE[28000] [1045] Access denied for user 'icinga2-ido-mysq'@'localhost' (using password: YES)
    Validation Log

    After i login with user: icinga2 and pass icinga123 into datase:icinga123, then i get log:

    " There is currently no icinga instance writing to the IDO. Make sure that a icinga instance is configured and able to write to the IDO."

    • Two important steps are missed in the manual:
      1. You have to create manually DB to store your credentials
      mysql> create database icingaweb2;

      2. You have to give correct permissions for your admin user to get access to the DB
      mysql> GRANT ALL PRIVILEGES ON *.* TO admin@localhost IDENTIFIED BY '***';

      where *** - your password which you defined during icingaweb2 setup (as well as "admin" user if you have another one).

  3. Hi All,
    I'm hoping someone can give me a little help. I am installing Icinga2 and the web interface on CentOS 6.7. I'm stuck on the Requirements screen. This should be simple but I can't get past it. The only problem is this:
    "The directory /etc/icingaweb2 is not writable."
    Yet look at this output:
    [root@prodlxdeploy01 icinga2]# ls -ld /etc/* | grep 'icinga'
    drwxr-x---. 8 root icinga 4096 Sep 29 14:51 /etc/icinga2
    drwxrwsrwx. 3 root icingaweb2 4096 Sep 29 13:32 /etc/icingaweb2

    I'm no linux guru but the icingaweb2 directory looks writable to me.
    And, the icingaweb2 directory has several conf files in it so something was able to write to it.
    What am I missing?

    • Figured it out. We have SELinux, which I didn't know, and it was displaying permissions as if they were correct but not allowing access to the folder.

  4. I have the issue that I can't continue after the second page. All is green and some icons are yellow but nothing is red. Does anyone have an idea?
    Thanks a lot!


Leave a Comment