{"id":46317,"date":"2024-05-24T03:02:13","date_gmt":"2024-05-24T03:02:13","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=46317"},"modified":"2024-05-29T03:05:08","modified_gmt":"2024-05-29T03:05:08","slug":"icinga-step-by-step-installing-icinga-director-in-ubuntu","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/icinga-step-by-step-installing-icinga-director-in-ubuntu\/","title":{"rendered":"icinga: Step by Step installing Icinga Director in ubuntu"},"content":{"rendered":"\n<p>Installing Icinga Director on an Ubuntu system involves several steps, primarily focused on ensuring that your system meets the prerequisites, installing Icinga Director, and integrating it with Icinga 2 and Icinga Web 2. Here&#8217;s a step-by-step guide to help you through the process:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Prerequisites<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Icinga 2<\/strong>: Ensure Icinga 2 is installed and running on your Ubuntu system.<\/li>\n\n\n\n<li><strong>Icinga Web 2<\/strong>: Ensure Icinga Web 2 is installed and operational as Icinga Director is a module for Icinga Web 2.<\/li>\n\n\n\n<li><strong>Database<\/strong>: Icinga Director requires a database. MySQL or MariaDB is recommended. Ensure that the database service is installed and running.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Install Required Packages<\/h3>\n\n\n\n<p>First, you need to install PHP and other necessary packages that Icinga Director depends on:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">sudo apt update\nsudo apt install php php-cli php-gd php-xml php-bcmath php-mbstring php-json php-curl php-zip git\n<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Step 2: Download Icinga Director<\/h3>\n\n\n\n<p>You can clone the Icinga Director from its GitHub repository. It&#8217;s advisable to get the latest stable version:<\/p>\n\n\n\n<p>REFERENCE &#8211; <a href=\"https:\/\/icinga.com\/docs\/icinga-director\/latest\/doc\/02-Installation\/Ubuntu\/\" target=\"_blank\" rel=\"noopener\">https:\/\/icinga.com\/docs\/icinga-director\/latest\/doc\/02-Installation\/Ubuntu\/<\/a><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">cd \/usr\/share\/icingaweb2\/modules\nsudo git clone https:<span class=\"hljs-comment\">\/\/github.com\/Icinga\/icingaweb2-module-director.git director<\/span>\nsudo git checkout $(git describe --tags <span class=\"hljs-string\">`git rev-list --tags --max-count=1`<\/span>)\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Step 3: Set up Permissions<\/h3>\n\n\n\n<p>Ensure the web server user (usually <code>www-data<\/code> on Ubuntu) owns the Icinga Web 2 modules directory:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">sudo chown -R www-data:www-data \/usr\/share\/icingaweb2\/modules\/director\n<\/code><\/span><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Step 4: Prepare the Database<\/h3>\n\n\n\n<p>Create a database and user for Icinga Director:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">sudo mysql -u root -p\n\nCREATE DATABASE director;\nGRANT ALL PRIVILEGES ON director.* TO <span class=\"hljs-string\">'director'<\/span>@<span class=\"hljs-string\">'localhost'<\/span> IDENTIFIED BY <span class=\"hljs-string\">'your_password'<\/span>;\nFLUSH PRIVILEGES;\n<span class=\"hljs-keyword\">EXIT<\/span>;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Step 5: Enable the Icinga Director Module<\/h3>\n\n\n\n<p>Enable the module in Icinga Web 2 by creating the configuration file:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">sudo icingacli <span class=\"hljs-built_in\">module<\/span> enable director\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Step 6: Configure Icinga Director<\/h3>\n\n\n\n<p>Log into your Icinga Web 2 interface. Go to the Configuration tab, then Modules, and select Director. You will need to click on &#8220;Create Schema&#8221; and then add the database resource you created.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 7: Run the Kickstart Wizard<\/h3>\n\n\n\n<p>The Icinga Director provides a Kickstart Wizard to automate the initial setup. Run the Kickstart Wizard from the Icinga Web 2 interface under the Director module settings. You&#8217;ll need to provide the Icinga 2 API credentials and the database details you set up earlier.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 8: Check Icinga Director Functionality<\/h3>\n\n\n\n<p>After completing the setup, navigate through the Director module in Icinga Web 2 to ensure it&#8217;s functioning correctly. Begin configuring hosts, services, and check commands as required.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Configure Director<\/h2>\n\n\n\n<p>Before doing anything lets configure Director, we will need to add the director database as a new resource and run it wizard.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Create a new resource for the Icinga Director&nbsp;database&nbsp;via the&nbsp;<code>Configuration \u2192 Application \u2192 Resources<\/code>&nbsp;menu. Please make sure that you configure&nbsp;<code>utf8<\/code>&nbsp;as encoding.<\/li>\n\n\n\n<li>Select&nbsp;<code>Icinga Director<\/code>&nbsp;directly from the main menu and you will be taken to the kickstart wizard. Follow the instructions and you are done!<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/systemwatchers.com\/wp-content\/uploads\/2023\/09\/Untitled-1-2.png\" alt=\"\" class=\"wp-image-350\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/systemwatchers.com\/wp-content\/uploads\/2023\/09\/image-25.png\" alt=\"\" class=\"wp-image-353\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/systemwatchers.com\/wp-content\/uploads\/2023\/09\/Untitled-1-4-1024x836.png\" alt=\"\" class=\"wp-image-352\"\/><\/figure>\n\n\n\n<p>Now you can enable the Director by choosing this new resource as a target. You will then be asked to create the schema.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/systemwatchers.com\/wp-content\/uploads\/2023\/09\/Untitled-1-5.png.webp\" alt=\"\" class=\"wp-image-354\"\/><\/figure>\n\n\n\n<p>After schema has been created you will find multiple deployments pending that need to be pushed to the database.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/systemwatchers.com\/wp-content\/uploads\/2023\/09\/Untitled-1-7-1024x534.png\" alt=\"\" class=\"wp-image-356\"\/><\/figure>\n\n\n\n<p>Click on Deploy and that\u2019s it! The system is installed and ready for action.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/systemwatchers.com\/wp-content\/uploads\/2023\/09\/image-26-1024x316.png.webp\" alt=\"\" class=\"wp-image-357\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Installing Icinga Director on an Ubuntu system involves several steps, primarily focused on ensuring that your system meets the prerequisites, installing Icinga Director, and integrating it with Icinga 2 and&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[8217],"tags":[],"class_list":["post-46317","post","type-post","status-publish","format-standard","hentry","category-icinga"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/46317","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=46317"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/46317\/revisions"}],"predecessor-version":[{"id":46322,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/46317\/revisions\/46322"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=46317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=46317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=46317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}