How to Install Icinga 2 on CentOS 8 - CentLinux

Latest

Sunday, 12 January 2020

How to Install Icinga 2 on CentOS 8

How to Install Icinga 2 on CentOS 8

Icinga 2 is an open-source computer and network monitoring software. Icinga 2 was originally forked from Nagios network monitoring application in 2009. Icinga 2 is distributed under GNU GPL v2.

Being a fork of Nagios, Icinga has all the features of Nagios Core and it also has some additional features like modern Web 2.0 style user interface, database connectors (for MySQL, Oracle and PostgreSQL) and a REST API that lets SysAdmins integrate numerous extensions without complicated modifications.

Icinga developers also seek to reflect the community needs more closely by integrating patches more quickly.

In this article, we are writing a guide on how to install Icinga 2 on CentOS 8 and we are also configuring MariaDB as backend data store for Icinga 2 by means of IDO (Icinga Data Out) module.

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 or CentOS 8.

 

This Article Provides:

     

    Icinga 2 Features:

    Some of the core features of Icinga 2 are.

    • Monitors network services (http, smtp, pop3, ping, etc.)
    • Monitors host system resources (CPU load, Memory usage, disk usage, etc.)
    • Monitors server components (switches, routers, humidity and temperature sensors,etc.)
    • Simple plugin design
    • Parallel service checks

     

    Environment Specification:

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

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

     

    Installing EPEL yum repository on CentOS 8:

    Connect with icinga-2.recipes.com server as root user by using an ssh tool.

    Icinga 2 requires Nagios Plugins, that are available in EPEL (Extra Packages for Enterprise Linux) yum repository, therefore we are installing EPEL yum repository.

    [root@icinga-2 ~]# dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm Last metadata expiration check: 0:01:54 ago on Sat 11 Jan 2020 09:18:26 AM PKT. epel-release-latest-8.noarch.rpm 9.2 kB/s | 21 kB 00:02 Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: epel-release noarch 8-7.el8 @commandline 21 k Transaction Summary ================================================================================ Install 1 Package Total size: 21 k Installed size: 30 k Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : epel-release-8-7.el8.noarch 1/1 Running scriptlet: epel-release-8-7.el8.noarch 1/1 Verifying : epel-release-8-7.el8.noarch 1/1 Installed: epel-release-8-7.el8.noarch Complete!

     

    Installing MariaDB Server on CentOS 8:

    We are installing MariaDB server to be used as the data store for Icinga 2.

    [root@icinga-2 ~]# dnf install -y @mariadb/server ... Installed: mariadb-server-3:10.3.11-2.module_el8.0.0+35+6f2527ed.x86_64 mariadb-backup-3:10.3.11-2.module_el8.0.0+35+6f2527ed.x86_64 mariadb-gssapi-server-3:10.3.11-2.module_el8.0.0+35+6f2527ed.x86_64 mariadb-server-utils-3:10.3.11-2.module_el8.0.0+35+6f2527ed.x86_64 perl-IO-Socket-IP-0.39-5.el8.noarch perl-IO-Socket-SSL-2.060-2.el8.noarch perl-Mozilla-CA-20160104-7.el8.noarch mariadb-3:10.3.11-2.module_el8.0.0+35+6f2527ed.x86_64 mariadb-common-3:10.3.11-2.module_el8.0.0+35+6f2527ed.x86_64 mariadb-connector-c-3.0.7-1.el8.x86_64 mariadb-connector-c-config-3.0.7-1.el8.noarch mariadb-errmsg-3:10.3.11-2.module_el8.0.0+35+6f2527ed.x86_64 perl-DBD-MySQL-4.046-2.module_el8.0.0+72+668237d8.x86_64 perl-DBI-1.641-2.module_el8.0.0+66+fe1eca09.x86_64 perl-Digest-1.17-395.el8.noarch perl-Digest-MD5-2.55-396.el8.x86_64 perl-Net-SSLeay-1.85-6.el8.x86_64 perl-URI-1.73-3.el8.noarch perl-libnet-3.11-3.el8.noarch perl-Carp-1.42-396.el8.noarch perl-Data-Dumper-2.167-399.el8.x86_64 perl-Encode-4:2.97-3.el8.x86_64 perl-Errno-1.28-416.el8.x86_64 perl-Exporter-5.72-396.el8.noarch perl-File-Path-2.15-2.el8.noarch perl-File-Temp-0.230.600-1.el8.noarch perl-Getopt-Long-1:2.50-4.el8.noarch perl-HTTP-Tiny-0.074-1.el8.noarch perl-IO-1.38-416.el8.x86_64 perl-MIME-Base64-3.15-396.el8.x86_64 perl-Math-BigInt-1:1.9998.11-5.el8.noarch perl-Math-Complex-1.59-416.el8.noarch perl-PathTools-3.74-1.el8.x86_64 perl-Pod-Escapes-1:1.07-395.el8.noarch perl-Pod-Perldoc-3.28-396.el8.noarch perl-Pod-Simple-1:3.35-395.el8.noarch perl-Pod-Usage-4:1.69-395.el8.noarch perl-Scalar-List-Utils-3:1.49-2.el8.x86_64 perl-Socket-4:2.027-2.el8.x86_64 perl-Storable-1:3.11-3.el8.x86_64 perl-Term-ANSIColor-4.06-396.el8.noarch perl-Term-Cap-1.17-395.el8.noarch perl-Text-ParseWords-3.30-395.el8.noarch perl-Text-Tabs+Wrap-2013.0523-395.el8.noarch perl-Time-Local-1:1.280-1.el8.noarch perl-Unicode-Normalize-1.25-396.el8.x86_64 perl-constant-1.33-396.el8.noarch perl-interpreter-4:5.26.3-416.el8.x86_64 perl-libs-4:5.26.3-416.el8.x86_64 perl-macros-4:5.26.3-416.el8.x86_64 perl-parent-1:0.237-1.el8.noarch perl-podlators-4.11-1.el8.noarch perl-threads-1:2.21-2.el8.x86_64 perl-threads-shared-1.58-2.el8.x86_64 psmisc-23.1-3.el8.x86_64 Complete!

    Start and enable MariaDB service.

    [root@icinga-2 ~]# systemctl enable --now mariadb.service Created symlink /etc/systemd/system/mysql.service â /usr/lib/systemd/system/mariadb.service. Created symlink /etc/systemd/system/mysqld.service â /usr/lib/systemd/system/mariadb.service. Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service â /usr/lib/systemd/system/mariadb.service.

    Configure MariaDB server and set root user password.

    [root@icinga-2 ~]# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. Set root password? [Y/n] Y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] Y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] Y ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] Y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] Y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB!

     

    Installing Icinga 2 Yum Repository on CentOS 8:

    Icinga 2 rpms are provided within its own yum repository, therefore it is necessary to install Icinga 2 yum repository, if we want to install Icinga 2 by using dnf command.

    [root@icinga-2 ~]# dnf install -y https://packages.icinga.com/epel/icinga-rpm-release-8-latest.noarch.rpm Last metadata expiration check: 0:47:35 ago on Sat 11 Jan 2020 09:22:02 AM PKT. icinga-rpm-release-8-latest.noarch.rpm 6.1 kB/s | 9.5 kB 00:01 Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: icinga-rpm-release noarch 8-4.el8.icinga @commandline 9.5 k Transaction Summary ================================================================================ Install 1 Package Total size: 9.5 k Installed size: 2.6 k Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : icinga-rpm-release-8-4.el8.icinga.noarch 1/1 Verifying : icinga-rpm-release-8-4.el8.icinga.noarch 1/1 Installed: icinga-rpm-release-8-4.el8.icinga.noarch Complete! Build cache for newly installed yum repositories. [root@icinga-2 ~]# dnf makecache CentOS-8 - AppStream 4.6 kB/s | 4.3 kB 00:00 CentOS-8 - Base 5.2 kB/s | 3.9 kB 00:00 CentOS-8 - Extras 4.5 kB/s | 1.5 kB 00:00 ICINGA (stable release for epel) 43 kB/s | 66 kB 00:01 Extra Packages for Enterprise Linux 8 - x86_64 5.1 kB/s | 9.9 kB 00:01 Metadata cache created.

     

    Installing Nagios Plugins on CentOS 8:

    For collection of different metrics, we need commands provided by the respective Nagios plugins tools.

    Nagios Plugins are available in EPEL yum repository. Since, we have already installed EPEL, therefore, we can now easily install Nagios Plugins using dnf commands.

    [root@icinga-2 ~]# dnf install -y nagios-plugins-{http,ping,disk,users,swap,procs,ssh,load} Last metadata expiration check: 0:33:27 ago on Sat 11 Jan 2020 02:36:17 PM PKT. Package nagios-plugins-http-2.2.2-2.20190926git1b8ad57.el8.x86_64 is already installed. Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: nagios-plugins-disk x86_64 2.2.2-2.20190926git1b8ad57.el8 epel 61 k nagios-plugins-load x86_64 2.2.2-2.20190926git1b8ad57.el8 epel 45 k nagios-plugins-ping x86_64 2.2.2-2.20190926git1b8ad57.el8 epel 49 k nagios-plugins-procs x86_64 2.2.2-2.20190926git1b8ad57.el8 epel 49 k nagios-plugins-ssh x86_64 2.2.2-2.20190926git1b8ad57.el8 epel 44 k nagios-plugins-swap x86_64 2.2.2-2.20190926git1b8ad57.el8 epel 43 k nagios-plugins-users x86_64 2.2.2-2.20190926git1b8ad57.el8 epel 40 k Transaction Summary ================================================================================ Install 7 Packages Total download size: 331 k Installed size: 436 k Downloading Packages: (1/7): nagios-plugins-load-2.2.2-2.20190926git1 29 kB/s | 45 kB 00:01 (2/7): nagios-plugins-disk-2.2.2-2.20190926git1 39 kB/s | 61 kB 00:01 (3/7): nagios-plugins-ping-2.2.2-2.20190926git1 26 kB/s | 49 kB 00:01 (4/7): nagios-plugins-ssh-2.2.2-2.20190926git1b 109 kB/s | 44 kB 00:00 (5/7): nagios-plugins-procs-2.2.2-2.20190926git 82 kB/s | 49 kB 00:00 (6/7): nagios-plugins-swap-2.2.2-2.20190926git1 45 kB/s | 43 kB 00:00 (7/7): nagios-plugins-users-2.2.2-2.20190926git 41 kB/s | 40 kB 00:00 -------------------------------------------------------------------------------- Total 86 kB/s | 331 kB 00:03 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : nagios-plugins-users-2.2.2-2.20190926git1b8ad57.el8. 1/7 Installing : nagios-plugins-swap-2.2.2-2.20190926git1b8ad57.el8.x 2/7 Installing : nagios-plugins-ssh-2.2.2-2.20190926git1b8ad57.el8.x8 3/7 Installing : nagios-plugins-procs-2.2.2-2.20190926git1b8ad57.el8. 4/7 Installing : nagios-plugins-ping-2.2.2-2.20190926git1b8ad57.el8.x 5/7 Installing : nagios-plugins-load-2.2.2-2.20190926git1b8ad57.el8.x 6/7 Installing : nagios-plugins-disk-2.2.2-2.20190926git1b8ad57.el8.x 7/7 Running scriptlet: nagios-plugins-disk-2.2.2-2.20190926git1b8ad57.el8.x 7/7 Verifying : nagios-plugins-disk-2.2.2-2.20190926git1b8ad57.el8.x 1/7 Verifying : nagios-plugins-load-2.2.2-2.20190926git1b8ad57.el8.x 2/7 Verifying : nagios-plugins-ping-2.2.2-2.20190926git1b8ad57.el8.x 3/7 Verifying : nagios-plugins-procs-2.2.2-2.20190926git1b8ad57.el8. 4/7 Verifying : nagios-plugins-ssh-2.2.2-2.20190926git1b8ad57.el8.x8 5/7 Verifying : nagios-plugins-swap-2.2.2-2.20190926git1b8ad57.el8.x 6/7 Verifying : nagios-plugins-users-2.2.2-2.20190926git1b8ad57.el8. 7/7 Installed: nagios-plugins-disk-2.2.2-2.20190926git1b8ad57.el8.x86_64 nagios-plugins-load-2.2.2-2.20190926git1b8ad57.el8.x86_64 nagios-plugins-ping-2.2.2-2.20190926git1b8ad57.el8.x86_64 nagios-plugins-procs-2.2.2-2.20190926git1b8ad57.el8.x86_64 nagios-plugins-ssh-2.2.2-2.20190926git1b8ad57.el8.x86_64 nagios-plugins-swap-2.2.2-2.20190926git1b8ad57.el8.x86_64 nagios-plugins-users-2.2.2-2.20190926git1b8ad57.el8.x86_64 Complete!

    There are thousands of Nagios Plugins are freely available, but we are only installing the required plugins.

     

    Installing Icinga 2 on CentOS 8:

    We have installed Icinga 2 yum repository. Therefore, we can now install Icinga 2 by using dnf command.

    [root@icinga-2 ~]# dnf install -y icinga2 icinga2-selinux icinga2-ido-mysql vim-icinga2 Last metadata expiration check: 0:00:12 ago on Sat 11 Jan 2020 11:39:42 AM PKT. Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: icinga2 x86_64 2.11.2-1.el8.icinga icinga-stable-release 33 k icinga2-ido-mysql x86_64 2.11.2-1.el8.icinga icinga-stable-release 117 k icinga2-selinux x86_64 2.11.2-1.el8.icinga icinga-stable-release 64 k vim-icinga2 x86_64 2.11.2-1.el8.icinga icinga-stable-release 13 k Installing dependencies: boost-atomic x86_64 1.66.0-6.el8 AppStream 13 k boost-chrono x86_64 1.66.0-6.el8 AppStream 23 k 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-date-time x86_64 1.66.0-6.el8 AppStream 29 k boost-filesystem x86_64 1.66.0-6.el8 AppStream 49 k boost-program-options x86_64 1.66.0-6.el8 AppStream 143 k boost-regex x86_64 1.66.0-6.el8 AppStream 286 k boost-system x86_64 1.66.0-6.el8 AppStream 18 k boost-thread x86_64 1.66.0-6.el8 AppStream 59 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 vim-filesystem noarch 2:8.0.1763-10.el8 AppStream 48 k checkpolicy x86_64 2.8-2.el8 BaseOS 338 k policycoreutils-python-utils noarch 2.8-16.1.el8 BaseOS 228 k python3-audit x86_64 3.0-0.10.20180831git0047a6c.el8 BaseOS 85 k python3-libsemanage x86_64 2.8-5.el8 BaseOS 127 k python3-policycoreutils noarch 2.8-16.1.el8 BaseOS 2.2 M python3-setools x86_64 4.2.0-2.el8 BaseOS 598 k icinga2-bin x86_64 2.11.2-1.el8.icinga icinga-stable-release 3.8 M icinga2-common x86_64 2.11.2-1.el8.icinga icinga-stable-release 152 k Enabling module streams: mysql 8.0 Transaction Summary ================================================================================ Install 25 Packages Total download size: 9.8 M Installed size: 39 M Downloading Packages: (1/25): boost-atomic-1.66.0-6.el8.x86_64.rpm 12 kB/s | 13 kB 00:01 (2/25): boost-context-1.66.0-6.el8.x86_64.rpm 13 kB/s | 15 kB 00:01 (3/25): boost-chrono-1.66.0-6.el8.x86_64.rpm 20 kB/s | 23 kB 00:01 (4/25): boost-coroutine-1.66.0-6.el8.x86_64.rpm 280 kB/s | 31 kB 00:00 (5/25): boost-filesystem-1.66.0-6.el8.x86_64.rp 110 kB/s | 49 kB 00:00 (6/25): boost-date-time-1.66.0-6.el8.x86_64.rpm 60 kB/s | 29 kB 00:00 (7/25): boost-system-1.66.0-6.el8.x86_64.rpm 56 kB/s | 18 kB 00:00 (8/25): boost-program-options-1.66.0-6.el8.x86_ 105 kB/s | 143 kB 00:01 (9/25): boost-thread-1.66.0-6.el8.x86_64.rpm 59 kB/s | 59 kB 00:00 (10/25): boost-regex-1.66.0-6.el8.x86_64.rpm 193 kB/s | 286 kB 00:01 (11/25): vim-filesystem-8.0.1763-10.el8.noarch. 158 kB/s | 48 kB 00:00 (12/25): checkpolicy-2.8-2.el8.x86_64.rpm 257 kB/s | 338 kB 00:01 (13/25): mysql-common-8.0.17-3.module_el8.0.0+1 56 kB/s | 143 kB 00:02 (14/25): policycoreutils-python-utils-2.8-16.1. 258 kB/s | 228 kB 00:00 (15/25): python3-libsemanage-2.8-5.el8.x86_64.r 260 kB/s | 127 kB 00:00 (16/25): python3-audit-3.0-0.10.20180831git0047 30 kB/s | 85 kB 00:02 (17/25): python3-policycoreutils-2.8-16.1.el8.n 246 kB/s | 2.2 MB 00:09 (18/25): python3-setools-4.2.0-2.el8.x86_64.rpm 76 kB/s | 598 kB 00:07 (19/25): icinga2-2.11.2-1.el8.icinga.x86_64.rpm 27 kB/s | 33 kB 00:01 (20/25): icinga2-common-2.11.2-1.el8.icinga.x86 145 kB/s | 152 kB 00:01 (21/25): icinga2-ido-mysql-2.11.2-1.el8.icinga. 148 kB/s | 117 kB 00:00 (22/25): icinga2-selinux-2.11.2-1.el8.icinga.x8 125 kB/s | 64 kB 00:00 (23/25): vim-icinga2-2.11.2-1.el8.icinga.x86_64 63 kB/s | 13 kB 00:00 (24/25): mysql-libs-8.0.17-3.module_el8.0.0+181 75 kB/s | 1.2 MB 00:16 (25/25): icinga2-bin-2.11.2-1.el8.icinga.x86_64 229 kB/s | 3.8 MB 00:17 -------------------------------------------------------------------------------- Total 281 kB/s | 9.8 MB 00:35 warning: /var/cache/dnf/icinga-stable-release-e0a9f5dbfd3eb465/packages/icinga2-2.11.2-1.el8.icinga.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 34410682: NOKEY ICINGA (stable release for epel) 1.6 MB/s | 1.7 kB 00:00 Importing GPG key 0x34410682: Userid : "Icinga Open Source Monitoring (Build server) <info@icinga.org>" Fingerprint: F51A 91A5 EE00 1AA5 D77D 53C4 C6E3 19C3 3441 0682 From : /etc/pki/rpm-gpg/RPM-GPG-KEY-ICINGA Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : boost-system-1.66.0-6.el8.x86_64 1/25 Running scriptlet: boost-system-1.66.0-6.el8.x86_64 1/25 Installing : boost-chrono-1.66.0-6.el8.x86_64 2/25 Running scriptlet: boost-chrono-1.66.0-6.el8.x86_64 2/25 Installing : boost-thread-1.66.0-6.el8.x86_64 3/25 Running scriptlet: boost-thread-1.66.0-6.el8.x86_64 3/25 Installing : boost-context-1.66.0-6.el8.x86_64 4/25 Running scriptlet: boost-context-1.66.0-6.el8.x86_64 4/25 Installing : boost-coroutine-1.66.0-6.el8.x86_64 5/25 Running scriptlet: boost-coroutine-1.66.0-6.el8.x86_64 5/25 Installing : boost-filesystem-1.66.0-6.el8.x86_64 6/25 Running scriptlet: boost-filesystem-1.66.0-6.el8.x86_64 6/25 Running scriptlet: icinga2-common-2.11.2-1.el8.icinga.x86_64 7/25 Installing : icinga2-common-2.11.2-1.el8.icinga.x86_64 7/25 Running scriptlet: icinga2-common-2.11.2-1.el8.icinga.x86_64 7/25 Installing : python3-setools-4.2.0-2.el8.x86_64 8/25 Installing : python3-libsemanage-2.8-5.el8.x86_64 9/25 Installing : python3-audit-3.0-0.10.20180831git0047a6c.el8.x86_ 10/25 Installing : checkpolicy-2.8-2.el8.x86_64 11/25 Installing : python3-policycoreutils-2.8-16.1.el8.noarch 12/25 Installing : policycoreutils-python-utils-2.8-16.1.el8.noarch 13/25 Installing : vim-filesystem-2:8.0.1763-10.el8.noarch 14/25 Installing : mysql-common-8.0.17-3.module_el8.0.0+181+899d6349. 15/25 Installing : mysql-libs-8.0.17-3.module_el8.0.0+181+899d6349.x8 16/25 Installing : boost-regex-1.66.0-6.el8.x86_64 17/25 Running scriptlet: boost-regex-1.66.0-6.el8.x86_64 17/25 Installing : boost-program-options-1.66.0-6.el8.x86_64 18/25 Running scriptlet: boost-program-options-1.66.0-6.el8.x86_64 18/25 Installing : boost-date-time-1.66.0-6.el8.x86_64 19/25 Running scriptlet: boost-date-time-1.66.0-6.el8.x86_64 19/25 Installing : boost-atomic-1.66.0-6.el8.x86_64 20/25 Running scriptlet: boost-atomic-1.66.0-6.el8.x86_64 20/25 Installing : icinga2-bin-2.11.2-1.el8.icinga.x86_64 21/25 Running scriptlet: icinga2-2.11.2-1.el8.icinga.x86_64 22/25 Installing : icinga2-2.11.2-1.el8.icinga.x86_64 22/25 Running scriptlet: icinga2-2.11.2-1.el8.icinga.x86_64 22/25 Installing : icinga2-ido-mysql-2.11.2-1.el8.icinga.x86_64 23/25 Running scriptlet: icinga2-ido-mysql-2.11.2-1.el8.icinga.x86_64 23/25 Installing : icinga2-selinux-2.11.2-1.el8.icinga.x86_64 24/25 Running scriptlet: icinga2-selinux-2.11.2-1.el8.icinga.x86_64 24/25 Installing : vim-icinga2-2.11.2-1.el8.icinga.x86_64 25/25 Running scriptlet: vim-icinga2-2.11.2-1.el8.icinga.x86_64 25/25 Verifying : boost-atomic-1.66.0-6.el8.x86_64 1/25 Verifying : boost-chrono-1.66.0-6.el8.x86_64 2/25 Verifying : boost-context-1.66.0-6.el8.x86_64 3/25 Verifying : boost-coroutine-1.66.0-6.el8.x86_64 4/25 Verifying : boost-date-time-1.66.0-6.el8.x86_64 5/25 Verifying : boost-filesystem-1.66.0-6.el8.x86_64 6/25 Verifying : boost-program-options-1.66.0-6.el8.x86_64 7/25 Verifying : boost-regex-1.66.0-6.el8.x86_64 8/25 Verifying : boost-system-1.66.0-6.el8.x86_64 9/25 Verifying : boost-thread-1.66.0-6.el8.x86_64 10/25 Verifying : mysql-common-8.0.17-3.module_el8.0.0+181+899d6349. 11/25 Verifying : mysql-libs-8.0.17-3.module_el8.0.0+181+899d6349.x8 12/25 Verifying : vim-filesystem-2:8.0.1763-10.el8.noarch 13/25 Verifying : checkpolicy-2.8-2.el8.x86_64 14/25 Verifying : policycoreutils-python-utils-2.8-16.1.el8.noarch 15/25 Verifying : python3-audit-3.0-0.10.20180831git0047a6c.el8.x86_ 16/25 Verifying : python3-libsemanage-2.8-5.el8.x86_64 17/25 Verifying : python3-policycoreutils-2.8-16.1.el8.noarch 18/25 Verifying : python3-setools-4.2.0-2.el8.x86_64 19/25 Verifying : icinga2-2.11.2-1.el8.icinga.x86_64 20/25 Verifying : icinga2-bin-2.11.2-1.el8.icinga.x86_64 21/25 Verifying : icinga2-common-2.11.2-1.el8.icinga.x86_64 22/25 Verifying : icinga2-ido-mysql-2.11.2-1.el8.icinga.x86_64 23/25 Verifying : icinga2-selinux-2.11.2-1.el8.icinga.x86_64 24/25 Verifying : vim-icinga2-2.11.2-1.el8.icinga.x86_64 25/25 Installed: icinga2-2.11.2-1.el8.icinga.x86_64 icinga2-ido-mysql-2.11.2-1.el8.icinga.x86_64 icinga2-selinux-2.11.2-1.el8.icinga.x86_64 vim-icinga2-2.11.2-1.el8.icinga.x86_64 boost-atomic-1.66.0-6.el8.x86_64 boost-chrono-1.66.0-6.el8.x86_64 boost-context-1.66.0-6.el8.x86_64 boost-coroutine-1.66.0-6.el8.x86_64 boost-date-time-1.66.0-6.el8.x86_64 boost-filesystem-1.66.0-6.el8.x86_64 boost-program-options-1.66.0-6.el8.x86_64 boost-regex-1.66.0-6.el8.x86_64 boost-system-1.66.0-6.el8.x86_64 boost-thread-1.66.0-6.el8.x86_64 mysql-common-8.0.17-3.module_el8.0.0+181+899d6349.x86_64 mysql-libs-8.0.17-3.module_el8.0.0+181+899d6349.x86_64 vim-filesystem-2:8.0.1763-10.el8.noarch checkpolicy-2.8-2.el8.x86_64 policycoreutils-python-utils-2.8-16.1.el8.noarch python3-audit-3.0-0.10.20180831git0047a6c.el8.x86_64 python3-libsemanage-2.8-5.el8.x86_64 python3-policycoreutils-2.8-16.1.el8.noarch python3-setools-4.2.0-2.el8.x86_64 icinga2-bin-2.11.2-1.el8.icinga.x86_64 icinga2-common-2.11.2-1.el8.icinga.x86_64 Complete!

    Check Icinga 2 installed features.

    [root@icinga-2 ~]# icinga2 feature list Disabled features: api command compatlog debuglog elasticsearch gelf graphite ido-mysql influxdb livestatus opentsdb perfdata statusdata syslog Enabled features: checker mainlog notification

     

    Configure Icinga 2 IDO to use MariaDB Data Store:

    Connect with MariaDB 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 MariaDB database for Icinga 2 as follows.

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

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

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

    Reload privileges table and exit from MySQL prompt.

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

    Import database from the script provided with the Icinga 2 software.

    [root@icinga-2 ~]# mysql -u root -p123 icinga < /usr/share/icinga2-ido-mysql/schema/mysql.sql

    Configure IDO configurations according to our environment.

    [root@icinga-2 ~]# vi /etc/icinga2/features-available/ido-mysql.conf

    Uncomment and set directives as follows.

    /** * The IdoMysqlConnection type implements MySQL support * for DB IDO. */ object IdoMysqlConnection "ido-mysql" { user = "icinga" password = "Ahmer@1234" host = "localhost" database = "icinga" }

    Enable IDO and other required features.

    [root@icinga-2 ~]# icinga2 feature enable command ido-mysql syslog Enabling feature command. Make sure to restart Icinga 2 for these changes to take effect. Enabling feature ido-mysql. Make sure to restart Icinga 2 for these changes to take effect. Enabling feature syslog. Make sure to restart Icinga 2 for these changes to take effect.

    Enable and start Icinga 2 Service.

    [root@icinga-2 ~]# systemctl enable --now icinga2.service Created symlink /etc/systemd/system/multi-user.target.wants/icinga2.service â /usr/lib/systemd/system/icinga2.service.

    Verify status of Icinga 2 Service.

    [root@icinga-2 ~]# systemctl status icinga2.service â icinga2.service - Icinga host/service/network monitoring system Loaded: loaded (/usr/lib/systemd/system/icinga2.service; enabled; vendor pre> Active: active (running) since Sat 2020-01-11 12:34:00 PKT; 27s ago Process: 14847 ExecStartPre=/usr/lib/icinga2/prepare-dirs /etc/sysconfig/icin> Main PID: 14857 (icinga2) Tasks: 13 (limit: 5948) Memory: 13.5M CGroup: /system.slice/icinga2.service ââ14857 /usr/lib64/icinga2/sbin/icinga2 --no-stack-rlimit daemon --c> ââ14872 /usr/lib64/icinga2/sbin/icinga2 --no-stack-rlimit daemon --c> ââ14873 /usr/lib64/icinga2/sbin/icinga2 --no-stack-rlimit daemon --c> Jan 11 12:34:00 icinga-2.recipes.com icinga2[14857]: [2020-01-11 12:34:00 +0500> Jan 11 12:34:00 icinga-2.recipes.com icinga2[14857]: [2020-01-11 12:34:00 +0500> Jan 11 12:34:00 icinga-2.recipes.com icinga2[14857]: [2020-01-11 12:34:00 +0500> Jan 11 12:34:00 icinga-2.recipes.com icinga2[14857]: [2020-01-11 12:34:00 +0500> Jan 11 12:34:00 icinga-2.recipes.com icinga2[14857]: [2020-01-11 12:34:00 +0500> Jan 11 12:34:00 icinga-2.recipes.com icinga2[14857]: [2020-01-11 12:34:00 +0500> Jan 11 12:34:00 icinga-2.recipes.com icinga2[14857]: [2020-01-11 12:34:00 +0500> Jan 11 12:34:00 icinga-2.recipes.com icinga2[14857]: [2020-01-11 12:34:00 +0500> Jan 11 12:34:00 icinga-2.recipes.com icinga2[14857]: [2020-01-11 12:34:00 +0500> Jan 11 12:34:00 icinga-2.recipes.com systemd[1]: Started Icinga host/service/ne>

    We have successfully installed Icinga 2 on CentOS 8. Continue reading our next article for installation of Icinga Web 2 on CentOS 8.

    No comments:

    Post a comment