<\/span><\/h2>\n\n\n\nsudo apt install mariadb-server -y<\/pre>\n\n\n\nOnce, the installation is complete start the service.<\/p>\n\n\n\n
sudo systemctl start mariadb<\/pre>\n\n\n\nVerify that the service is up and running:<\/p>\n\n\n\n
sudo systemctl status mariadb<\/pre>\n\n\n\nYou should see the following output:<\/p>\n\n\n\n
root@vps:~# sudo systemctl status mariadb\n\u25cf mariadb.service - MariaDB 10.3.31 database server\nLoaded: loaded (\/lib\/systemd\/system\/mariadb.service; enabled; vendor preset: enabled)\nActive: active (running) since Wed 2021-10-13 21:03:58 UTC; 1min 14s ago\nDocs: man:mysqld(8)\nhttps:\/\/mariadb.com\/kb\/en\/library\/systemd\/\nMain PID: 120943 (mysqld)\nStatus: \"Taking your SQL requests now...\"\nTasks: 31 (limit: 4617)\nMemory: 67.6M\nCGroup: \/system.slice\/mariadb.service\n\u2514\u2500120943 \/usr\/sbin\/mysqld<\/pre>\n\n\n\n<\/span>Step 3. Install Apache2 as a Web Server<\/span><\/h2>\n\n\n\nsudo apt install apache2 -y<\/pre>\n\n\n\nOnce, installation is completed start the service:<\/p>\n\n\n\n
sudo systemctl start apache2<\/pre>\n\n\n\nEnable the service to start on system boot:<\/p>\n\n\n\n
sudo systemctl enable apache2<\/pre>\n\n\n\nCheck, if service is up and running:<\/p>\n\n\n\n
sudo systemctl status apache2<\/pre>\n\n\n\nYou should see the following output:<\/p>\n\n\n\n
root@vps:~# sudo systemctl status apache2\n\u25cf apache2.service - The Apache HTTP Server\nLoaded: loaded (\/lib\/systemd\/system\/apache2.service; enabled; vendor preset: enabled)\nActive: active (running) since Tue 2021-10-12 15:24:12 UTC; 1 day 5h ago\nDocs: https:\/\/httpd.apache.org\/docs\/2.4\/\nMain PID: 68804 (apache2\nTasks: 9 (limit: 4617)\nMemory: 22.1M\nCGroup: \/system.slice\/apache2.service<\/pre>\n\n\n\n<\/span>Step 4. Install PHP with dependencies<\/span><\/h2>\n\n\n\nFirst, we need to install the required dependencies:<\/p>\n\n\n\n
sudo apt install software-properties-common<\/pre>\n\n\n\nSince the latest version of PHP is PHP8.0 we need to add the Ondrej repository manually before we install it:<\/p>\n\n\n\n
sudo add-apt-repository ppa:ondrej\/php<\/pre>\n\n\n\nNow, you can install PHP8.0 with all required dependencies:<\/p>\n\n\n\n
sudo apt install php php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip php-cli php-mysql php8.0-common php8.0-opcache php-gmp php-imagick -y<\/pre>\n\n\n\nVerify that the PHP8.0 is installed with the following command:<\/p>\n\n\n\n
php -v<\/pre>\n\n\n\nYou should see the following output:<\/p>\n\n\n\n
root@vps:~# php -v\nPHP 8.0.11 (cli) (built: Sep 23 2021 21:26:24) ( NTS )\nCopyright (c) The PHP Group\nZend Engine v4.0.11, Copyright (c) Zend Technologies\nwith Zend OPcache v8.0.11, Copyright (c), by Zend Technologies<\/pre>\n\n\n\nWe need to modify some changes in the php.ini file before we proceed with the Icinga2 installation:<\/p>\n\n\n\n
sudo nano \/etc\/php\/8.0\/apache2\/php.ini<\/pre>\n\n\n\nUncomment the cgi.fix_pathinfo and set it to 0.<\/p>\n\n\n\n
cgi.fix_pathinfo=0<\/pre>\n\n\n\nSave and close the file.<\/p>\n\n\n\n
<\/span>Step 5. Add Icinga2 Repository<\/span><\/h2>\n\n\n\nManually add the Icinga2 repository with the following command:<\/p>\n\n\n\n
sudo curl https:\/\/packages.icinga.com\/icinga.key | apt-key add -<\/pre>\n\n\n\nCreate the repository file for Icinga2:<\/p>\n\n\n\n
sudo nano \/etc\/apt\/sources.list.d\/icinga-focal.list<\/pre>\n\n\n\nAdd the following lines of code:<\/p>\n\n\n\n
deb http:\/\/packages.icinga.com\/ubuntu icinga-focal main\ndeb-src http:\/\/packages.icinga.com\/ubuntu icinga-focal main<\/pre>\n\n\n\nSave the file, close it and update the system.<\/p>\n\n\n\n
sudo apt update -y<\/pre>\n\n\n\n<\/span>Step 6. Install Icinga2<\/span><\/h2>\n\n\n\nFinally, after all requirements are installed we are ready to install the Icinga monitoring software on our Ubuntu 20.04:<\/p>\n\n\n\n
sudo apt install icinga2 monitoring-plugins -y<\/pre>\n\n\n\nStart and Enable the service:<\/p>\n\n\n\n
sudo systemctl start icinga2 && sudo systemctl enable icinga2<\/pre>\n\n\n\nCheck, if the service is up and running:<\/p>\n\n\n\n
sudo systemctl status icinga2<\/pre>\n\n\n\nThe following output should be displayed:<\/p>\n\n\n\n
root@vps:~# sudo systemctl status icinga2\n\u25cf icinga2.service - Icinga host\/service\/network monitoring system\nLoaded: loaded (\/lib\/systemd\/system\/icinga2.service; enabled; vendor preset: enabled)\nDrop-In: \/etc\/systemd\/system\/icinga2.service.d\n\u2514\u2500limits.conf\nActive: active (running) since Wed 2021-10-13 21:20:21 UTC; 2min 50s ago\nMain PID: 136092 (icinga2)\nStatus: \"Startup finished.\"\nTasks: 20\nMemory: 14.0M\nCGroup: \/system.slice\/icinga2.service<\/pre>\n\n\n\n<\/span>Step 7. Install and Enable the Icinga2 IDO MySQL module<\/span><\/h2>\n\n\n\nWe need to install this module because the IDO database is used as a backend by Icinga Web 2:<\/p>\n\n\n\n
sudo apt install icinga2-ido-mysql -y<\/pre>\n\n\n\nOn the first window, you need to select “Yes<\/b>” and hit Enter.<\/p>\n\n\n\n <\/figure>\n\n\n\nOn the second window, you need to select “No<\/b>” and hit Enter.<\/p>\n\n\n\n <\/figure>\n\n\n\nOnce, the installation is completed, log in to manually create a database and user for Icinga2.<\/p>\n\n\n\n
sudo mysql -u root -p<\/pre>\n\n\n\nOnce logged in, enter the following lines:<\/p>\n\n\n\n
CREATE DATABASE icinga2;\nGRANT ALL ON icinga2.* TO 'icinga2'@'localhost' IDENTIFIED BY 'YourStrongPasswordHere';\nFLUSH PRIVILEGES;\nEXIT;<\/pre>\n\n\n\nNow, next step is to import the IDO<\/b> schema:<\/p>\n\n\n\nsudo mysql -u root -p icinga2 < \/usr\/share\/icinga2-ido-mysql\/schema\/mysql.sql<\/pre>\n\n\n\nIf the command is executed successfully you should receive nothing as output:<\/p>\n\n\n\n
root@vps:~# sudo mysql -u root -p icinga2 < \/usr\/share\/icinga2-ido-mysql\/schema\/mysql.sql\nEnter password:\nroot@vps:~#<\/pre>\n\n\n\nLet’s move on and enable the IDO MySQL Module. Open the ido-mysql.conf<\/b> file and set the database name, user and password that you created a while ago.<\/p>\n\n\n\nsudo nano \/etc\/icinga2\/features-available\/ido-mysql.conf<\/pre>\n\n\n\nSet the correct credentials, you created a while ago:<\/p>\n\n\n\n
\/**\n* The db_ido_mysql library implements IDO functionality\n* for MySQL.\n*\/\nlibrary \"db_ido_mysql\"\nobject IdoMysqlConnection \"ido-mysql\" {\nuser = \"icinga2<\/b>\",\npassword = \"YourStrongPasswordHere<\/b>\",\nhost = \"localhost<\/b>\",\ndatabase = \"icinga2<\/b>\"\n}<\/pre>\n\n\n\n Save the file, close it and enable the ido-mysql module<\/b>.<\/p>\n\n\n\nsudo icinga2 feature enable ido-mysql<\/pre>\n\n\n\nYou should receive the following output:<\/p>\n\n\n\n
root@vps:~# sudo icinga2 feature enable ido-mysql\nEnabling feature ido-mysql. Make sure to restart Icinga 2 for these changes to take effect.<\/pre>\n\n\n\nRestart the Icinga2 service:<\/p>\n\n\n\n
sudo systemctl restart icinga2<\/pre>\n\n\n\n<\/span>Step 8. Install Icinga Web 2<\/span><\/h2>\n\n\n\nFirst, we need to install it with the following command:<\/p>\n\n\n\n
sudo apt install icingaweb2 icingacli libapache2-mod-php -y<\/pre>\n\n\n\nNext, we need to create a database manually:<\/p>\n\n\n\n
sudo mysql -u root -p<\/pre>\n\n\n\nOnce, logged in to MySQL, execute the following commands:<\/p>\n\n\n\n
CREATE DATABASE icinga2web;\nGRANT ALL ON icinga2web.* TO 'icinga2web'@'localhost' IDENTIFIED BY 'YourStrongPasswordHere';\nFLUSH PRIVILEGES;\nEXIT<\/pre>\n\n\n\nNext, we need to create a token that will be used in the next steps while configuring the web interface:<\/p>\n\n\n\n
sudo icingacli setup token create<\/pre>\n\n\n\nYou should receive a random token and you need to save it for later use:<\/p>\n\n\n\n
root@vps:~# sudo icingacli setup token create\nThe newly generated setup token is: 7e33c2b90fe0fd83<\/b><\/pre>\n\n\n\n<\/span>Step 9. Access and setup Icinga Web 2 in the browser<\/span><\/h2>\n\n\n\nTo access the fresh installation of Icinga2 access the following URL:<\/p>\n\n\n\n
http:\/\/your_server_ip_address<\/b>\/icingaweb2\/setup<\/pre>\n\n\n\n You should see the Welcome page of Icinga.<\/p>\n\n\n\n <\/figure>\n\n\n\nPaste the token generated before and click on the “Next” button.<\/p>\n\n\n\n <\/figure>\n\n\n\nOn the Module tab click on “Next<\/b>” button.<\/p>\n\n\n\n <\/figure>\n\n\n\nOn the PHP dependencies tab click on the “Next<\/b>” button as well.<\/p>\n\n\n\n <\/figure>\n\n\n\nOn the Authentication tab<\/b> click on the “Next<\/b>” button and be sure to be selected “Database<\/b>” as an Authentication Type.<\/p>\n\n\n\n <\/figure>\n\n\n\nIn the next tab enter the required fields with the database credentials you created before validating the configuration and click on the “Next<\/b>” button.<\/p>\n\n\n\n <\/figure>\n\n\n\nOn the Authentication Backend tab<\/b>, click on the “Next” button, once you verify that the correct database name is entered in the “Backend Name<\/b>” field.<\/p>\n\n\n\n <\/figure>\n\n\n\nOn the Administration tab<\/b> enter your Icinga 2 Web username and password.<\/p>\n\n\n\n <\/figure>\n\n\n\nOn the Application Configuration<\/b> tab click “Next<\/b>“.<\/p>\n\n\n\n <\/figure>\n\n\n\nOn the next tab click “Next<\/b>” as well.<\/p>\n\n\n\n <\/figure>\n\n\n\nOn the next tab click “Next<\/b>“.<\/p>\n\n\n\n <\/figure>\n\n\n\nIn the Monitoring IDO Resource tab<\/b> fill the information for IDO database you created before.<\/p>\n\n\n\n <\/figure>\n\n\n\nIn the Command Transport tab<\/b> select “Local Command File<\/b>” as a Transport Type<\/b> and click on “Next<\/b>“.<\/p>\n\n\n\n <\/figure>\n\n\n\nIn the Monitor Security tab<\/b> click on the “Next<\/b>” button”.<\/p>\n\n\n\n <\/figure>\n\n\n\nReview All modules and click on “Finish<\/b>” button.<\/p>\n\n\n\n <\/figure>\n\n\n\nCongratulations! You successfully installed Icinga Web 2. You can log in now by clicking on the “Login to Icinga Web2<\/b>” button.<\/p>\n\n\n\n <\/figure>\n\n\n\nEnter the credentials and hit on the “Login<\/b>” button.<\/p>\n\n\n\n <\/figure>\n\n\n\nYou should see the following screen.<\/p>\n\n\n\n <\/figure>\n\n\n\nDone. You successfully installed and configured Icinga 2 monitoring software on Ubuntu 20.04.<\/p>\n\n\n\n
Of course, you don\u2019t have to install Icinga 2 on Ubuntu 20.04. If you use one of our Linux VPS Hosting plans, you can simply ask our expert Linux admins to install it for you. They are available 24\/7 and will take care of your request immediately.<\/p>\n\n\n\n
If you liked this post on how to install Icinga 2 on Ubuntu 20.04, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"
In this article, we are going to explain about installing Icinga 2 Monitoring Software on Ubuntu 20.04. Icinga is an … <\/p>\n
Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":39634,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,1698],"tags":[1603,1800,1839],"yoast_head":"\nHow to Install Icinga 2 on Ubuntu 20.04 | RoseHosting<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n \n \n \n \n\t \n\t \n\t \n