Icinga 2: Web UI Setup (Part 3)

Robin O'Brien
7 min readFeb 20, 2018

--

Welcome to part 3 of my Icinga 2 guide. In this part we will configure Icinga Web 2. In part 1 we installed Icinga 2 and in part 2 we installed Icinga Web 2. Part 4 is available here.

I will assume you have run through part 1 and 2 and that you have freshly installed Icinga 2 and Icinga Web 2 instances.

Lets jump right in.

Setup

First up, open your browser of choice and head over to http://<ip-address>/icingaweb2/setup You will be presented with the following page.

Icinga Web 2 Configuration Wizard

The page has an input field for a token. We generated this token in the previous guide. If you have forgotten it, it can be retrieved by running the following:

$ icingacli setup token show

Insert the token and click next. The next page will allow you to choose which modules you want to install. We will just stick to the monitoring modules. Feel free to add extras if you want to. Click next.

Icinga Web 2 Configuration Wizard: Modules

Following the modules select page, we will be shown a busy requirements screen. This page shows us the status of the requirements needed for Icinga Web 2. Green means the requirements have been met, Yellow means they are not met but are not required and Red means that the requirement has not been met but needs to be rectified before we can continue.

Icinga Web 2 Configuration Wizard: Requirements

As we can see on the above screenshot, there are 2 issues we need to fix. The first is the timezone. I suggested the timezone change in the previous part, however it appears we changed it in the wrong place. This is different since the introduction of the new PHP requirements. We can go ahead and edit that file now to fix this requirement.

$ vi /etc/opt/rh/rh-php71/php.ini

Find and change the timezone line to look something like the following. Please have a look at part 2 if you want more information on changing the timezone.

date.timezone = Africa/Johannesburg

Once the timezone has been changed, we just need to restart the process to load the changes.

$ systemctl restart rh-php71-php-fpm.service

Next, lets turn our attention to the file that is not read and writable. This comes down to an issue with SELinux. Its quite a straight forward fix. We just need to execute the following:

$ semanage fcontext -a -t httpd_sys_rw_content_t '/etc/icingaweb2(/.*)?'
$ restorecon -RFvv /etc/icingaweb2
$ /usr/sbin/setsebool -P httpd_can_network_connect 1

This is a known issue, so it may be resolved in future versions. Refreshing the page should now show green when it was showing red. If you have any remaining red blocks, a quick web search should help you find the solution.

Clicking next, takes us to the authentication method screen. We will be using the database to store authentication data. Click next to proceed.

Icinga Web 2 Configuration Wizard: Authentication

We now need to configure Icinga Web 2 to access the database. Here we will define a resource that Icinga Web 2 can make use of. Remember we installed PostgreSQL as our database, if you chose another please adjust the config accordingly. Please see the screen shot below for the configuration we will be using. Using the validate button will allow you to check if the data you inserted is in fact correct. When you are satisfied you have entered the correct details, you can click next.

Icinga Web 2 Configuration Wizard: Database resource

The next screen ties the database with the authentication type we chose earlier. The default text here should be correct. Click next if you are happy.

Icinga Web 2 Configuration Wizard: Authentication backend

After we have set the Authentication backend, we will be configuring an admin user. It is quite important to select a strong password for this user. Perhaps generate one using a password manager such as LastPass or KeyPassX. You can go ahead and fill this in now and click next to proceed.

Icinga Web 2 Configuration Wizard: Administration user

The next step is setting up application and logging settings. The defaults are fine but feel free to adjust as you see fit. The defaults will log to the database and show stack traces which is fine for our needs. Click next when you are ready.

Icinga Web 2 Configuration Wizard: Application config.

You should now see a summary of what we have supplied Icinga Web 2 setup so far. Please take a moment to confirm that it looks correct for you setup. The summary of our setup is shown below. Click next when you are happy that the configuration so far is correct.

Icinga Web 2 Configuration Wizard: Summary

Now it gets a bit more exciting. We are moving on to configuring Icinga Web 2 to work with the correct monitoring backend. Since we have installed Icinga 2 first, we can continue with the wizard and add all the details needed for Icinga Web 2 to interact with Icinga 2. Click next to get started.

Icinga Web 2 Configuration Wizard: Monitoring module

We now can choose a backend name and its type. For this we will stick to the defaults as the name is simple and makes sense. The type of backed will remain IDO. Hit next to move on.

Icinga Web 2 Configuration Wizard: Monitoring backend

Next up we will configure how Icinga 2 will store the monitoring data it gathers. Ideally this should be stored in the database we created for it earlier. So as before when we configured the database for Icinga Web 2, we will do the same but for Icinga 2. Please see the screenshot below for the settings we made use of. Take note that this is the database that we imported the IDO schema into in the previous part and is not the same database as the Icinga Web 2 authentication database. Some details may vary if you have diverged from this tutorial series at all. Validate your config and click next to proceed.

Icinga Web 2 Configuration Wizard: Monitoring IDO resource

The next screen allows us to configure how the Web instance will make use of the monitoring backend. In our case we want to use the API and the API user we created earlier. Enter these details now, validate and click next. If you have trouble remembering the password used, please run the following and grab the username and password for the icingaweb2 API user.

$ cat /etc/icinga2/conf.d/api-users.conf
Icinga Web 2 Configuration Wizard: Command transport

The next screen is monitoring security. We are going to leave this as is. Click next to continue on.

Icinga Web 2 Configuration Wizard: Monitoring security

And that brings us to the end of the wizard. You should now see a summary screen. Please take a moment to confirm the details are correct and click finish to complete the setup. The summary of our setup is displayed below.

Icinga Web 2 Configuration Wizard: Final Summary

Icinga Web 2 should now be setup! You should see the final screen below that confirms everything is in order.

Icinga Web 2 Configuration Wizard: Confirmation of setup

Navigate to http://<ip-address>/icingaweb2/authentication/login in order to access the login screen. You can now login using the admin user we created in the guide above.

Icinga Web 2 Login Screen

Final thoughts

That completes part 3 of the guide. You should now have Icinga 2 installed correctly, Icinga Web 2 installed and configured correctly and you should be able to login successfully.

In the next parts we will create configuration for the monitoring. This will include adding remote hosts to monitor and defining service checks, notifications and user groups. I will also touch on storing this configuration in a version control system, Git and how to use Git to push new configuration to the server quicker and more easily.

Things have been pretty straight forward now. I promise things get more interesting when defining the actual monitoring configuration. I hope you are enjoying the guides so far.

Part 4 available here.

--

--