How to instal Icinga2 on Ubuntu 20.04 LTS Focal – Guide

Icinga is a free and open source computer system and network monitoring application that checks the availability of your network and computer resources, notifies system failures, generates performance data of your resources, and provides highly available and distributed monitoring setup with the integrated cluster. ..

Icinga is a monitoring platform that can help you track your network resources, notify outages, and generate performance data for reporting. It’s scalable and extensible, and features include monitoring SMTP, POP3, HTTP, NNTP, ping, CPU load, disk usage, switches, routers and more. The Icinga stack consists of Icinga2 – the monitoring server – and Icinga Web 2 – the web interface for maintaining monitoring.

How to install Icinga2 on Ubuntu 20.04 LTS Focal

Install LAMP Stack

Icinga runs on a web server and is accessed from a browser. So the first step is to install the LAMP stack. LAMP is the acronym for Linux Apache MariaDB/MySQL and PHP. Apache is the web server, MariaDB is the database server, and PHP is the popular server-side scripting language. Let’s start by installing LAMP on our web server:

yum install lamp # apt-get install php5-mysql5 php5-apache2

  • Update the package lists for the Debian GNU/Linux distribution
  • Update the package lists for Ubuntu 12.04 LTS
  • Update the package lists for Fedora 24

sudo apt-get install apache2 ..

This will install the Apache web server. ..

To start Apache automatically at boot time, enable it.

$ sudo systemctl enable apache2

To start the Apache daemon, type the following command: sudo apachectl start. ..

$ sudo systemctl enable apache2

/usr/sbin/apache2 -k This will return a message that the web server is running.

apache2 is up and running.

We will install the MariaDB database server and client. ..

$ sudo apt install mariadb-server mariadb-client

When the installation is complete, enable MySQL to start on startup.

This command enables the mariadb service. ..

To start the MariaDB daemon, type the following command: sudo /etc/init.d/mariadb start ..

$ sudo systemctl enable mariadb

MariaDB is down again.

The systemctl status command shows the current state of Mariadb.

To secure the database server, run the script and enter your password.

  1. Protect the database server with a root password.
  2. Answer ‘Yes’ to the remaining prompts to secure the database server.
  3. Moving on, we’ll install PHP, which is the remaining component of the LAMP stack.
  4. But first, install the dependencies shown.

sudo apt install software-properties-common This will install the software properties common package. ..

Then, add the OndeJ repository which provides the latest version of PHP which is currently PHP 8.0. Icinga requires PHP 7.3 and later, so we are within the required version range.

$ sudo apt-get update $ sudo apt-get install php

Once the repository is added, install PHP and the necessary dependencies for installing Icinga.

sudo apt install php php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip php-cli php-mysql

If PHP is installed on your system, you can check its version by running the following command: php -v

Some modifications are necessary to get the site up and running. Edit the php.ini file. ..

$ vi /etc/php/8.0/apache2/php.ini [main]# Configuration file for the Apache web server

Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 The PHP Group

This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by the Free Software Foundation; # or you can use this program in source code form under the terms of the GPL.

$ php_ini = array( ‘cgi_binary’ => ‘./cgi-bin’, ‘debug’ => true, ’error_log’ => ‘/var/log/apache2/error.log’, ’executable’ => ‘/usr/bin/php’, );

Date.timezone = “UTC” CGI.fix_pathinfo = 0

Save your changes and exit.

Add Icinga2 repository

To install Icinga2 on Ubuntu, you first need to add the Icinga repository to your system. ..

Icinga’s GPG key is required to sign the logs and reports.

$ apt-key add icinga

apt-get update

apt-get install icinga

deb http://apt.icinga.com/debian main deb-src http://apt.icinga.com/debian main deb-xref http://apt.icinga.com/debian/pool/main/p/icinga-focal_1.0~beta1+dfsg-1_all

Ubuntu will download Icinga from the official Icinga website. ..

Debian’s package management system, “Icinga”, provides a web-based interface for managing Debian packages. This article describes how to install and use the icinga-focal package.

The icinga-focal package provides a focal point for managing Icinga installations. ..

Save the configuration file and exit.

Install Icinga2

Then, provide a comprehensive and concise overview of your system. Finally, provide a detailed description of the issues you are experiencing.

Install Icinga2 and monitoring plugins to improve your security.

Installing icinga2 monitoring plugins. ..

To install Icinga, first enable the monitoring tool. ..

$ sudo systemctl enable icinga2

The service starts automatically.

Starting icinga2… [sudo] password for root: Successfully started icinga2. ..

Icinga is a security software company that monitors your computer for potential threats. If it detects any changes, it’ll send you an email letting you know.

The icinga2 daemon is running. It has the following status: $ sudo systemctl status icinga2 icinga2 is running.

Icinga is doing as it is supposed to and this is a good sign that we are on the right track.

Final note

Installing Icinga2 on Ubuntu 20.04 LTS is a breeze with this guide. If you have any questions about it, feel free to ask us in the comments below. Plus, please share this guide with your friends so they can get started too! ..