How to Install Icinga2 Monitoring Tool on OpenSUSE

Icinga is an open-source network monitoring tool that was initially created as a fork of the Nagios monitoring tool back in 2009.

Icinga checks the availability of servers and network devices such as switches and routers and sends a report to sysadmins about any failures or downtime. It also provides comprehensive data which can be visualized and used for reporting.

Its scalability and extensibility make it possible to monitor small and large network environments across several locations.

In this guide, you will learn how to install the Icinga network monitoring tool on OpenSUSE Linux.

Prerequisites

Before you proceed, ensure that you have the following list of requirements.

  • An instance of OpenSUSE with a sudo user configured.
  • LAMP stack installed. Check our guide on how to install LAMP on OpenSUSE.

Step 1: Install PHP Extensions in OpenSUSE

First off, install and run the following zypper command below to install the following PHP extensions which will be required by Icinga2.

$ sudo zypper install php-gd php-pgsql php-ldap php-mbstring php-mysql php-curl php-xml php-cli php-soap php-intl php-zip php-xmlrpc php-opcache php-gmp php-imagick -y

Some additional configuration will be required. To access the main PHP configuration file.

$ vim /etc/php7/apache2/php.ini

Make the following changes to these directives.

memory_limit = 256M 
post_max_size = 64M
upload_max_filesize = 100M	
max_execution_time = 300
default_charset = "UTF-8"
date.timezone = "Africa/Nairobi"
cgi.fix_pathinfo=0

Be sure to set the date.timezone directive to reflect your geographical region.

Step 2: Add the Icinga Repository in OpenSUSE

By default, the Icinga package is not provided by OpenSUSE repositories. Therefore, you need to manually add the Official Icinga repository from Icinga in order to install Icinga2.

So, begin by adding the GPG key.

$ sudo rpm --import https://packages.icinga.com/icinga.key

Once the key is added. Add the Icinga repository as follows.

$ sudo zypper ar https://packages.icinga.com/openSUSE/ICINGA-release.repo

Then refresh all the repositories.

$ sudo zypper ref

Step 3: Instal Icinga2 and Monitoring Plugins in OpenSUSE

With the Icinga repository enabled, the next step is to install Icinga and the monitoring plugins. To do so, run the command:

$ sudo zypper install icinga2 nagios-plugins-all 

Next, start the Icinga service and enable it to start automatically during boot time.

$ sudo systemctl start icinga2
$ sudo systemctl enable icinga2

Just to be sure that the Icinga daemon is running, check its status as shown:

$ sudo systemctl status icinga2
Check Icinga Status
Check Icinga Status

Step 4: Install Icinga IDO (Icinga Data Output) Module

The IDO (Icinga Data Output) module is a core feature that exports configuration and status information into a relational database such as MySQL or MariaDB. The database is used as a backend by Icinga Web2.

To install the Icinga IDO feature, run the command:

$ sudo zypper install icinga2-ido-mysql

Once installed, the next step is to create a database for the IDO feature where all the configuration and status information will be exported.

So, log in to the MariaDB database:

$ sudo mysql -u root -p

Next, create the database and database user and grant all privileges to the user on the database.

> CREATE DATABASE icinga;
> GRANT ALL ON icinga.* TO 'icingauser'@'localhost' IDENTIFIED BY '[email protected]';
> FLUSH PRIVILEGES;
> EXIT;
Create Icinga Database
Create Icinga Database

Next, import the Icinga2 IDO schema as follows. Once prompted for a password, provide the MariaDB root password.

$ sudo mysql -u root -p icinga < /usr/share/icinga2-ido-mysql/schema/mysql.sql

Step 5: Enable IDO-MySQL Feature

The next step is to enable the ido-mysql feature. To do this, use the icinga2 command:

$ sudo icinga2 feature enable ido-mysql

Module 'ido-mysql' was enabled.

Make sure to restart Icinga 2 for these changes to take effect.

$ sudo systemctl restart icinga2

The IDO-MySQL package comes with a default configuration file called ido-mysql.conf. We need to make a few changes to the file in order to allow connection to the IDO database.

Therefore, open the configuration file.

$ sudo vim /etc/icinga2/features-available/ido-mysql.conf

Navigate to this section, uncomment and provide the IDO database details.

Enable IDO Database Connection
Enable IDO Database Connection

Save and exit the file. To apply the changes made, restart Icinga2:

$ sudo systemctl restart icinga2

Step 6: Install and Configure IcingaWeb2 in OpenSUSE

IcingaWeb2 is an open-source monitoring web interface, command-line tool, and framework developed by Icinga. It provides support for Icinga2, Icinga Core, and any other backend that is compatible with the IDO database.

The IcingaWeb2 interface provides you with a neat and intuitive dashboard for monitoring your network resources. To install IcingaWeb2 and the Icinga CLI, run the command:

$ sudo zypper install icingaweb2 icingacli -y

Next, we are going to create a second database schema for Icinga Web2. Once again, log in to the MySQL database server.

$ sudo mysql -u root -p

Create a database and user for Icinga Web2 and assign all privileges to the user on the database.

> CREATE DATABASE icingaweb2;
> GRANT ALL ON icingaweb2.* TO 'icingaweb2user'@'localhost' IDENTIFIED BY '[email protected]';
> FLUSH PRIVILEGES;
> EXIT;

Next, enable the Apache rewrite module and restart Apache for the changes to take effect.

$ sudo a2enmod rewrite
$ sudo systemctl restart apache2

Now create a secret token, which is being used for authentication when completing the setup on a web browser.

$ sudo icingacli setup token create

The newly generated setup token is: 12cd61c1700fa80e

Copy and Save the token as it will be used in the next step.

Step 7: Complete IcingaWeb2 Installation from Browser

With all the configurations in place, the last step is to complete the IcingaWeb2 setup on a browser.

To finalize the setup, open your browser and browse the following URL.

http://server-ip/icingaweb2/setup

This directs you to the Icinga Web 2 installation wizard as shown. The first section is the configuration of Icinga Web2.

To proceed, paste the Setup Token that you generated in the previous step to the ‘Setup Token’ field and click ‘Next’.

Add Setup Token
Add Setup Token

The next step provides a list of modules in Icinga2 which can be enabled. By default, the ‘Monitoring’ module is enabled. You can enable the modules you want and then click ‘Next’ to continue.

Icinga2 Monitoring Module
Icinga2 Monitoring Module

The next step lists all the PHP modules and other requirements required by Icinga Web 2. Scroll through the list and ensure that all the requirements have been met. Then click ‘Next’.

Icinga2 Web PHP Modules
Icinga2 Web PHP Modules

For the ‘Authentication’ step, just accept the default selection and click ‘Next’.

Icinga2Web Authentication Type
Icinga2Web Authentication Type

In the next step, provide the database details for IcingaWeb2 as specified.

Icinga2Web Database Details
Icinga2Web Database Details

Once done, scroll all the way down and click on ‘Validate configuration’ to verify that the credentials are correct.

Validate Configuration
Validate Configuration

If the details you provided are correct, the configuration should be validated. Once again, scroll all the way to the bottom and click on ‘Next’.

Activated Configuration
Activated Configuration

For ‘Authentication Backend’ simply accept the default option and click ‘Next’.

Authentication Backend
Authentication Backend

In the next step, create an administrative user by providing a username and password. This is the user that will be used to log in to the Icinga dashboard.

Icinga2 Admin User
Icinga2 Admin User

For ‘Application Configuration’, accept the default values and click ‘Next’.

Application Configuration
Application Configuration

Next, review all the configurations that you have provided. If all looks good, scroll down and click ‘Next’.

Icinga2 Configuration Summary
Icinga2 Configuration Summary

The next section is the configuration of the monitoring module for Icinga Web 2. So, click ‘Next’ to go to the next step.

Icinga2Web Configuration Module
Icinga2Web Configuration Module

In the ‘Monitoring IDO Resource’ provide the database details for the IDO database as specified in Step 4.

Icinga IDO Database Details
Icinga IDO Database Details

Scroll down and click on ‘Validate Configuration’.

Icinga IDO Validate Configuration
Icinga IDO Validate Configuration

If all went all, the configuration will be successfully validated. Once again, scroll all the way down and click ‘Next’.

Icinga IDO Configuration Validated
Icinga IDO Configuration Validated

In the ‘Command Transport’ section, select ‘Local Command File’ as the Transport Type. and click ‘Next’.

Command Transport
Command Transport

In the ‘Monitoring Security’ section, simply press ‘Next’ to go with the default option.

Monitoring Security
Monitoring Security

Finally, review the configurations for the monitoring module. If everything looks okay, scroll down and click on ‘Finish’.

Icinga2Web Configuration Review
Icinga2Web Configuration Review

You should get a congratulatory message informing you that Icinga Web 2 has been set up. To log in to Icinga Web 2, click on the ‘Login to Icinga Web2’ button.

Icinga2Web Installation Finishes
Icinga2Web Installation Finishes

This takes you to the login page as shown. Provide the username and password of the Icinga Admin user that you created and click ‘Login’.

Icinga2Web Admin Login
Icinga2Web Admin Login

This ushers you to the Icinga Web2 dashboard as you can see. From there you can add your network devices for monitoring.

Icinga Web2 Dashboard
Icinga Web2 Dashboard

We have come to the end of this guide. We have successfully installed Icinga Monitoring Tool on OpenSUSE.

If you liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or doubts? do ask for help in the comments section.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

Got something to say? Join the discussion.

Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published.