Welcome to out guide on how to install Icinga 2 on CentOS 8 / RHEL 8 with Icinga Web 2. Icinga 2 is a free and open source monitoring tool designed to be scalable and extensible Icinga 2 checks the availability of your network resources, notifies users of outages, and generates performance data for reporting. Icinga 2 can be used to monitor large and complex environments across multiple locations.

With Icinga 2  you can monitor:

  • Server resources – RAM usage, CPU load, disk usage
  • Network services –  HTTP, HTTPS, SMTP, IMAP, POP3, NNTP, ping e.t.c
  • Network devices – Routers and switches

Features of Icinga 2

These are the top features which Icinga 2 provides:

  • Performance-oriented: Icinga 2 has a multi-threaded design, it can run thousands of checks each second without any sign of CPU strain.
  • Distributed Architecture: For large and complex environments do a distributed setup with high availability.
  • REST API: Icinga 2 provides a RESTful API which enables you to update your configurations on the fly or show live information about current problems on your custom dashboards.
  • Rule-based Configuration: Monitoring as code with dynamic configurations. Apply rules to hosts and services to create a continuous monitoring environment.
  • Alerting: You get instant notifications when problems occur via email, text message or mobile message applications.
  • Icinga 2 has native support for  Graphite and InfluxDB. You can easily send performance data gathered directly to the third party tools.
  • Icinga 2 support NagiosGrapher, PNP4Nagios, and InGraph addons

The standard web interface for Icinga 2 is called Icinga Web 2

Install Icinga 2 on CentOS 8 / RHEL 8

Let’s now begin the installation of Icinga 2 on CentOS 8 / RHEL 8. Below are the steps you’ll follow to ensure you have a running Icinga 2 on CentOS 8 / RHEL 8 Linux distribution.

Step 1: Update system

Ensure your CentOS / RHEL system is up-to-date:

sudo yum -y update

Step 2: Enable EPEL Repository

Ensure EPEL repository is enabled in your RHEL 8 / CentOS 8 system.

Enable EPEL repository on CentOS 8 / RHEL 8

One line command to run is:

sudo dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

If you’re running RHEL 8, consider enabling additional repositories.

sudo subscription-manager repos --enable=rhel-8-server-optional-rpms \
  --enable=rhel-8-server-extras-rpms

Step 3: Add Icinga 2 Repository to CentOS 8 / RHEL 8

After addition of EPEL repository, add Icinga 2 repository to your system.

sudo tee /etc/yum.repos.d/icinga2.repo<<EOF
[icinga2]
name=Icinga 2 Repository for EPEL 8
baseurl=https://packages.icinga.com/epel/8/release
enabled=1
EOF

Import GPG Key:

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

Update Yum cache

sudo dnf clean all
sudo dnf makecache

Step 4: Install MariaDB Database Server

Install MariaDB database server on your CentOS / RHEL 8 server.

Install MariaDB on CentOS / RHEL 8

After installation, create database and user for Icinga2:

$ mysql -u root -p
CREATE DATABASE icinga;
GRANT ALL PRIVILEGES ON icinga.* TO 'icinga'@'localhost' IDENTIFIED BY '[email protected]';
FLUSH PRIVILEGES;
EXIT;

Step 5: Install Icinga 2 on CentOS 8 / RHEL 8

Run the commands below to install Icinga 2 on CentOS 8 / RHEL 8.

sudo dnf -y install icinga2 icinga2-selinux icinga2-ido-mysql vim-icinga2

Below is the dependency tree:

Dependencies resolved.
===================================================================================================================================================
 Package                            Arch                    Version                                               Repository                  Size
===================================================================================================================================================
Installing:
 icinga2                            x86_64                  2.11.2-1.el8.icinga                                   icinga2                     33 k
 icinga2-ido-mysql                  x86_64                  2.11.2-1.el8.icinga                                   icinga2                    117 k
 icinga2-selinux                    x86_64                  2.11.2-1.el8.icinga                                   icinga2                     64 k
Installing dependencies:
 boost-context                      x86_64                  1.66.0-6.el8                                          AppStream                   15 k
 boost-coroutine                    x86_64                  1.66.0-6.el8                                          AppStream                   31 k
 boost-filesystem                   x86_64                  1.66.0-6.el8                                          AppStream                   49 k
 mysql-common                       x86_64                  8.0.17-3.module_el8.0.0+181+899d6349                  AppStream                  143 k
 mysql-libs                         x86_64                  8.0.17-3.module_el8.0.0+181+899d6349                  AppStream                  1.2 M
 icinga2-bin                        x86_64                  2.11.2-1.el8.icinga                                   icinga2                    3.8 M
 icinga2-common                     x86_64                  2.11.2-1.el8.icinga                                   icinga2                    152 k
Enabling module streams:
 mysql                                                      8.0                                                                                   

Transaction Summary
===================================================================================================================================================
Install  10 Packages

Total download size: 5.7 M
Installed size: 27 M

Start and enable

Enable Icinga 2 required modules:

sudo icinga2 feature enable command ido-mysql syslog

You can check and enable other features on demand:

$ sudo icinga2 feature list
Disabled features: api compatlog debuglog elasticsearch gelf graphite influxdb livestatus opentsdb perfdata statusdata syslog
Enabled features: checker command ido-mysql mainlog notification

Import Icinga 2 Database:

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

Configure Database access:

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

Uncomment the lines and set access credentials.

/**
 * The IdoMysqlConnection type implements MySQL support
 * for DB IDO.
 */

object IdoMysqlConnection "ido-mysql" {
  user = "icinga"
  password = "[email protected]"
  host = "localhost"
  database = "icinga"
}

Then start and enable icinga2 service.

sudo systemctl enable --now icinga2.service

Confirm service status.

$ systemctl status icinga2.service
● icinga2.service - Icinga host/service/network monitoring system
   Loaded: loaded (/usr/lib/systemd/system/icinga2.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2019-11-12 10:27:10 EAT; 6s ago
  Process: 13756 ExecStartPre=/usr/lib/icinga2/prepare-dirs /etc/sysconfig/icinga2 (code=exited, status=0/SUCCESS)
 Main PID: 13766 (icinga2)
    Tasks: 11 (limit: 11512)
   Memory: 16.6M
   CGroup: /system.slice/icinga2.service
           ├─13766 /usr/lib64/icinga2/sbin/icinga2 --no-stack-rlimit daemon --close-stdio -e /var/log/icinga2/error.log
           ├─13781 /usr/lib64/icinga2/sbin/icinga2 --no-stack-rlimit daemon --close-stdio -e /var/log/icinga2/error.log
           └─13782 /usr/lib64/icinga2/sbin/icinga2 --no-stack-rlimit daemon --close-stdio -e /var/log/icinga2/error.log

Nov 12 10:27:10 centos8.novalocal icinga2[13766]: [2019-11-12 10:27:10 +0300] information/ConfigItem: Instantiated 1 UserGroup.
Nov 12 10:27:10 centos8.novalocal icinga2[13766]: [2019-11-12 10:27:10 +0300] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
Nov 12 10:27:10 centos8.novalocal icinga2[13766]: [2019-11-12 10:27:10 +0300] information/ConfigItem: Instantiated 235 CheckCommands.
Nov 12 10:27:10 centos8.novalocal icinga2[13766]: [2019-11-12 10:27:10 +0300] information/ConfigItem: Instantiated 3 TimePeriods.
Nov 12 10:27:10 centos8.novalocal icinga2[13766]: [2019-11-12 10:27:10 +0300] information/ConfigItem: Instantiated 1 User.
Nov 12 10:27:10 centos8.novalocal icinga2[13766]: [2019-11-12 10:27:10 +0300] information/ConfigItem: Instantiated 11 Services.
Nov 12 10:27:10 centos8.novalocal icinga2[13766]: [2019-11-12 10:27:10 +0300] information/ConfigItem: Instantiated 3 ServiceGroups.
Nov 12 10:27:10 centos8.novalocal icinga2[13766]: [2019-11-12 10:27:10 +0300] information/ScriptGlobal: Dumping variables to file '/var/cache/icin>
Nov 12 10:27:10 centos8.novalocal icinga2[13766]: [2019-11-12 10:27:10 +0300] information/cli: Closing console log.
Nov 12 10:27:10 centos8.novalocal systemd[1]: Started Icinga host/service/network monitoring system.

Install Icinga Web 2 on CentOS 8 / RHEL 8

Now that we’ve completed the installation of Icinga 2 on CentOS 8 / RHEL 8 server, let’s move on to install Icinga Web 2 on CentOS 8 / RHEL 8. Refer to the guide below for installation steps:

How To Install Icinga Web 2 on CentOS 8 / RHEL 8

More on Monitoring:

Install Zabbix Server on CentOS / RHEL 8

Install Cacti on CentOS / RHEL 8

Install LibreNMS on CentOS / RHEL 8

Install Netdata on CentOS / RHEL 8

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!


As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.

LEAVE A REPLY

Please enter your comment!
Please enter your name here