{"id":3932,"date":"2019-08-10T23:44:09","date_gmt":"2019-08-10T20:44:09","guid":{"rendered":"https:\/\/kifarunix.com\/?p=3932"},"modified":"2019-09-01T17:21:14","modified_gmt":"2019-09-01T14:21:14","slug":"install-icinga-2-on-debian-10-buster","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-icinga-2-on-debian-10-buster\/","title":{"rendered":"Install Icinga 2 on Debian 10 Buster"},"content":{"rendered":"\n<p>In this guide, we are going to learn how to install Icinga 2 on Debian 10 Buster. <a rel=\"noreferrer noopener\" aria-label=\"Icinga 2 (opens in a new tab)\" href=\"https:\/\/icinga.com\/docs\/icinga2\/latest\/doc\/01-about\/\" target=\"_blank\">Icinga 2<\/a> is an opensource monitoring solution that is used to monitor the availability of various network resources including host metrics such as system uptime, load, memory, disk free space, running processes, network services such as HTTP, SMTP, SNMP, SSH, etc. Icinga supports notification and can be configured to notify users of system\/service outages and generates performance data for reporting.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install Icinga 2 on Debian 10 Buster<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Run system update<\/h3>\n\n\n\n<p>Run the command below to update your system packages.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update\napt upgrade<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install Icinga 2 APT Repository<\/h3>\n\n\n\n<p>Install the Icinga 2 repo signing key<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install -y apt-transport-https wget gnupg<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget -O - https:\/\/packages.icinga.com\/icinga.key | apt-key add <\/code><\/pre>\n\n\n\n<p>Next, install Debian 10 Buster Icinga 2 repositories.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>echo \"deb https:\/\/packages.icinga.com\/debian icinga-buster main\" > \/etc\/apt\/sources.list.d\/icinga.list<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>echo \"deb-src https:\/\/packages.icinga.com\/debian icinga-buster main\" >> \/etc\/apt\/sources.list.d\/icinga.list<\/code><\/pre>\n\n\n\n<p>Run system package update.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install Icinga 2 on Debian 10 Buster<\/h3>\n\n\n\n<p>Now that Icinga 2 repos are in place, you can install it by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install icinga2<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Restart Icinga 2<\/h3>\n\n\n\n<p>During the installation, there are three main Icinga 2 features that are enabled;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>checker<\/code>&nbsp;for executing checks<\/li><li><code>notification<\/code>&nbsp;for sending notifications<\/li><li><code>mainlog<\/code>&nbsp;for writing the&nbsp;<code>icinga2.log<\/code>&nbsp;file<\/li><\/ul>\n\n\n\n<p>For the enablement of these features to take effect, you need to restart Icinga 2.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl restart icinga2<\/code><\/pre>\n\n\n\n<p>To check the status of Icinga 2 service;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl status icinga2<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\u25cf icinga2.service - Icinga host\/service\/network monitoring system\n   Loaded: loaded (\/lib\/systemd\/system\/icinga2.service; enabled; vendor preset: enabled)\n  Drop-In: \/etc\/systemd\/system\/icinga2.service.d\n           \u2514\u2500limits.conf\n   Active: active (running) since Sat 2019-08-10 07:07:09 EDT; 1s ago\n  Process: 12246 ExecStartPre=\/usr\/lib\/icinga2\/prepare-dirs \/etc\/default\/icinga2 (code=exited, status=0\/SUCCESS)\n Main PID: 12253 (icinga2)\n    Tasks: 9\n   Memory: 12.7M\n   CGroup: \/system.slice\/icinga2.service\n           \u251c\u250012253 \/usr\/lib\/x86_64-linux-gnu\/icinga2\/sbin\/icinga2 --no-stack-rlimit daemon --close-stdio -e \/var\/log\/icinga2\/error.log\n           \u2514\u250012285 \/usr\/lib\/x86_64-linux-gnu\/icinga2\/sbin\/icinga2 --no-stack-rlimit daemon --close-stdio -e \/var\/log\/icinga2\/error.log\n\nAug 10 07:07:09 icinga2.example.com icinga2[12253]: [2019-08-10 07:07:09 -0400] information\/ScriptGlobal: Dumping variables to file '\/var\/cache\/icinga2\nAug 10 07:07:09 icinga2.example.com icinga2[12253]: [2019-08-10 07:07:09 -0400] information\/ConfigObject: Restoring program state from file '\/var\/lib\/i\nAug 10 07:07:09 icinga2.example.com icinga2[12253]: [2019-08-10 07:07:09 -0400] information\/ConfigObject: Restored 264 objects. Loaded 29 new objects w\nAug 10 07:07:09 icinga2.example.com icinga2[12253]: [2019-08-10 07:07:09 -0400] information\/ConfigItem: Triggering Start signal for config items\nAug 10 07:07:09 icinga2.example.com icinga2[12253]: [2019-08-10 07:07:09 -0400] information\/FileLogger: 'main-log' started.\nAug 10 07:07:09 icinga2.example.com icinga2[12253]: [2019-08-10 07:07:09 -0400] information\/NotificationComponent: 'notification' started.\nAug 10 07:07:09 icinga2.example.com icinga2[12253]: [2019-08-10 07:07:09 -0400] information\/CheckerComponent: 'checker' started.\nAug 10 07:07:09 icinga2.example.com icinga2[12253]: [2019-08-10 07:07:09 -0400] information\/ConfigItem: Activated all objects.\nAug 10 07:07:09 icinga2.example.com icinga2[12253]: [2019-08-10 07:07:09 -0400] information\/cli: Closing console log.\nAug 10 07:07:09 icinga2.example.com systemd[1]: Started Icinga host\/service\/network monitoring system.<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install Icinga 2 Monitoring Plugins<\/h3>\n\n\n\n<p>Icinga 2 requires monitoring plugins in order to &nbsp;check external services. Run the command below to install Icinga 2 monitoring plugins.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install monitoring-plugins<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install and Configure Icinga 2 Backend Database<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Install Icinga Data Output Database Backend<\/h4>\n\n\n\n<p>At the moment, IDO only supports MySQL and PostgreSQL database backends. In this guide, we are going to use MySQL as our database backend server.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Install MySQL Database<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install mariadb-server mariadb-client<\/code><\/pre>\n\n\n\n<p>Perform the usual MySQL initial security to remove anonymous database users, test databases, disable remote root login using the <strong>mysql_secure_installation<\/strong> script.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"installing-the-ido-modules-for-mysql\">Install IDO modules for MySQL<\/h4>\n\n\n\n<p>The package <strong>icinga2-ido-mysql<\/strong> provides IDO modules for MySQL and can be installed by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install icinga2-ido-mysql<\/code><\/pre>\n\n\n\n<p>During installation, you are prompted  to specify whether Icinga 2 should use MySQL. Select yes to enable this feature. To list enabled features, run the command;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>icinga2 feature list<\/code><\/pre>\n\n\n\n<p>If <strong>ido-mysql<\/strong> feature is not enabled, you can enable it later from command line;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>icinga2 feature enable ido-mysql<\/code><\/pre>\n\n\n\n<p>Restart Icinga 2.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl restart icinga2<\/code><\/pre>\n\n\n\n<p>You are then prompted on whether to use the automated setup wizard to configure icinga2-ido-mysql. You can skip it by selecting <strong>No<\/strong> so that you can manually configure it.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Create MySQL database for Icinga 2<\/h4>\n\n\n\n<p>Login to MariaDB and create Icinga 2 database. If you have enabled MariaDB root password authentication, use the command <strong>mysql -u root -p<\/strong> otherwise login using <strong>mysql<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<p>Create Icinga 2 IDO database<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>create database icinga2db;<\/code><\/pre>\n\n\n\n<p>Create the Icinga 2 database user with all the privileges on Icinga 2 database created above.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>grant all on icinga2db.* to icingaadmin@localhost identified by 'P@ssWORD';<\/code><\/pre>\n\n\n\n<p>Reload privileges tables and quit.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>flush privileges;\nquit<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Import the Icinga 2 IDO schema<\/h4>\n\n\n\n<p>Once you have created the database, run the command below to import Icinga 2 IDO schema.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql -u root -p icinga2db &lt; \/usr\/share\/icinga2-ido-mysql\/schema\/mysql.sql<\/code><\/pre>\n\n\n\n<p>Next, open Icinga 2 MySQL IDO configuration file and set the Icinga2 database connection details.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vim \/etc\/icinga2\/features-available\/ido-mysql.conf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * The db_ido_mysql library implements IDO functionality\n * for MySQL.\n *\/\n\nlibrary \"db_ido_mysql\"\n\nobject IdoMysqlConnection \"ido-mysql\" {\n  user = \"icingaadmin\",\n  password = \"P@ssWORD\",\n  host = \"localhost\",\n  database = \"icinga2db\"\n}<\/code><\/pre>\n\n\n\n<p>Save and quit the configuration file.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Restart Icinga 2 daemon<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl restart icinga2<\/code><\/pre>\n\n\n\n<p>The next step is to install Icinga Web 2 which provides the web management interface for Icinga 2. Follow the link to install Icinga Web 2 on Debian 10 Buster.<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-icinga-web-2-on-debian-10-buster\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Install Icinga Web 2 on Debian 10 Buster<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Related Tutorials;<\/h4>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/how-to-install-icinga-2-and-icinga-web-2-on-ubuntu-18-04-lts\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">How to Install Icinga 2 and Icinga Web 2 on Ubuntu 18.04 LTS<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-nagios-core-on-debian-10-buster\/\" target=\"_blank\">Install Nagios Core on Debian 10 Buster<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-zabbix-4-x-from-sources-on-debian-10-buster\/\" target=\"_blank\">Install Zabbix 4.x from Sources on Debian 10 Buster<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/nagios-snmp-monitoring-of-linux-hosts-on-alienvault-usm-ossim\/\" target=\"_blank\">Nagios SNMP Monitoring of Linux Hosts on AlienVault USM\/OSSIM<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/how-to-install-and-configure-alienvault-ossim-5-5-on-virtualbox\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">How to install and configure AlienVault OSSIM 5.5 on VirtualBox<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we are going to learn how to install Icinga 2 on Debian 10 Buster. Icinga 2 is an opensource monitoring solution that<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,179,72],"tags":[1025,997,1064,183,180],"class_list":["post-3932","post","type-post","status-publish","format-standard","hentry","category-howtos","category-icinga","category-monitoring","tag-buster","tag-debian-10","tag-icinga","tag-icinga-monitoring","tag-icinga2","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3932"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=3932"}],"version-history":[{"count":9,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3932\/revisions"}],"predecessor-version":[{"id":4124,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3932\/revisions\/4124"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=3932"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=3932"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=3932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}