|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"><head> |
| 3 | + <meta charset="utf-8"> |
| 4 | + <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1"><!-- Begin Jekyll SEO tag v2.8.0 --> |
| 6 | +<title>Installing Icinga Web 2 on Debian Stretch | Blog?</title> |
| 7 | +<meta name="generator" content="Jekyll v4.4.1" /> |
| 8 | +<meta property="og:title" content="Installing Icinga Web 2 on Debian Stretch" /> |
| 9 | +<meta property="og:locale" content="en_US" /> |
| 10 | +<meta name="description" content="Icinga Web 2 is neat, and it’s in Debian Stretch. It’s not trivial to install like the original Icinga CGI (“Icinga Classic UI”) was. It’s not that hard, but I had to make some notes." /> |
| 11 | +<meta property="og:description" content="Icinga Web 2 is neat, and it’s in Debian Stretch. It’s not trivial to install like the original Icinga CGI (“Icinga Classic UI”) was. It’s not that hard, but I had to make some notes." /> |
| 12 | +<link rel="canonical" href="/2017/06/27/install-icingaweb2.html" /> |
| 13 | +<meta property="og:url" content="/2017/06/27/install-icingaweb2.html" /> |
| 14 | +<meta property="og:site_name" content="Blog?" /> |
| 15 | +<meta property="og:type" content="article" /> |
| 16 | +<meta property="article:published_time" content="2017-06-27T20:25:00+01:00" /> |
| 17 | +<meta name="twitter:card" content="summary" /> |
| 18 | +<meta property="twitter:title" content="Installing Icinga Web 2 on Debian Stretch" /> |
| 19 | +<script type="application/ld+json"> |
| 20 | +{"@context":"https://schema.org","@type":"BlogPosting","dateModified":"2017-06-27T20:25:00+01:00","datePublished":"2017-06-27T20:25:00+01:00","description":"Icinga Web 2 is neat, and it’s in Debian Stretch. It’s not trivial to install like the original Icinga CGI (“Icinga Classic UI”) was. It’s not that hard, but I had to make some notes.","headline":"Installing Icinga Web 2 on Debian Stretch","mainEntityOfPage":{"@type":"WebPage","@id":"/2017/06/27/install-icingaweb2.html"},"url":"/2017/06/27/install-icingaweb2.html"}</script> |
| 21 | +<!-- End Jekyll SEO tag --> |
| 22 | +<link rel="stylesheet" href="/assets/main.css"><link type="application/atom+xml" rel="alternate" href="/feed.xml" title="Blog?" /></head> |
| 23 | +<body><header class="site-header" role="banner"> |
| 24 | + |
| 25 | + <div class="wrapper"><a class="site-title" rel="author" href="/">Blog?</a><nav class="site-nav"> |
| 26 | + <input type="checkbox" id="nav-trigger" class="nav-trigger" /> |
| 27 | + <label for="nav-trigger"> |
| 28 | + <span class="menu-icon"> |
| 29 | + <svg viewBox="0 0 18 15" width="18px" height="15px"> |
| 30 | + <path d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.032C17.335,0,18,0.665,18,1.484L18,1.484z M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.032C17.335,6.031,18,6.696,18,7.516L18,7.516z M18,13.516C18,14.335,17.335,15,16.516,15H1.484 C0.665,15,0,14.335,0,13.516l0,0c0-0.82,0.665-1.483,1.484-1.483h15.032C17.335,12.031,18,12.695,18,13.516L18,13.516z"/> |
| 31 | + </svg> |
| 32 | + </span> |
| 33 | + </label> |
| 34 | + |
| 35 | + <div class="trigger"><a class="page-link" href="/about/">About</a></div> |
| 36 | + </nav></div> |
| 37 | +</header> |
| 38 | +<main class="page-content" aria-label="Content"> |
| 39 | + <div class="wrapper"> |
| 40 | + <article class="post h-entry" itemscope itemtype="http://schema.org/BlogPosting"> |
| 41 | + |
| 42 | + <header class="post-header"> |
| 43 | + <h1 class="post-title p-name" itemprop="name headline">Installing Icinga Web 2 on Debian Stretch</h1> |
| 44 | + <p class="post-meta"> |
| 45 | + <time class="dt-published" datetime="2017-06-27T20:25:00+01:00" itemprop="datePublished">Jun 27, 2017 |
| 46 | + </time></p> |
| 47 | + </header> |
| 48 | + |
| 49 | + <div class="post-content e-content" itemprop="articleBody"> |
| 50 | + <p>Icinga Web 2 is neat, and it’s in Debian Stretch. It’s not trivial to install like the original Icinga CGI (“Icinga Classic UI”) was. It’s not that hard, but I had to make some notes.</p> |
| 51 | + |
| 52 | +<h1 id="install-icinga-2">Install Icinga 2</h1> |
| 53 | + |
| 54 | +<p>Icinga comes ready to run, with an example configuration that monitors services on localhost.</p> |
| 55 | + |
| 56 | +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>apt-get install icinga2 |
| 57 | +</code></pre></div></div> |
| 58 | + |
| 59 | +<p>If you want to trigger re-checks etc., you will need to enable the <code class="language-plaintext highlighter-rouge">command</code> plugin:</p> |
| 60 | + |
| 61 | +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>icinga2 feature enable command |
| 62 | +</code></pre></div></div> |
| 63 | + |
| 64 | +<p>The “checker”, “mainlog”, and “notification” plugins should already be enabled. However, at one point in my testing they were not. So you might want to check that.</p> |
| 65 | + |
| 66 | +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ls -l /etc/icinga2/features-enabled |
| 67 | +</code></pre></div></div> |
| 68 | + |
| 69 | +<h1 id="install-the-web-server">Install the web server</h1> |
| 70 | + |
| 71 | +<p>You will now be running a web server on your network (and you’re about to install a PHP webapp). Better keep up with those security updates!</p> |
| 72 | + |
| 73 | +<p>Also, sending passwords (or commands) unprotected is a security problem. Debian has scripts to help you set up self-signed SSL. I haven’t shown them here, but they can be surprisingly straightforward to use.</p> |
| 74 | + |
| 75 | +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>apt-get install apache2 |
| 76 | +</code></pre></div></div> |
| 77 | + |
| 78 | +<h1 id="install-the-database-server">Install the database server</h1> |
| 79 | + |
| 80 | +<p>The MariaDB package in Debian Stretch does not ask you to make up a password. Instead, the Debian root user (or users of sudo) are simply granted access to mysql root. Not <em>quite</em> as elegant as postgres, but it’s a massive improvement.</p> |
| 81 | + |
| 82 | +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>apt-get install mariadb-server |
| 83 | +</code></pre></div></div> |
| 84 | + |
| 85 | +<h1 id="install-icingas-ido-for-mariadb--mysql">Install Icinga’s IDO for mariadb / mysql.</h1> |
| 86 | + |
| 87 | +<p>The install will prompt to enable IDO, and create a DB. Say yes. |
| 88 | +This might take a minute or so if you’re not using an SSD.</p> |
| 89 | + |
| 90 | +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>apt-get install icinga2-ido-mysql |
| 91 | +</code></pre></div></div> |
| 92 | + |
| 93 | +<p>The install does not actually enable IDO in icinga2, despite what it says. |
| 94 | +<a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=865350">Bug report</a>.</p> |
| 95 | + |
| 96 | +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>icinga2 feature enable ido-mysql |
| 97 | +systemctl restart icinga2 |
| 98 | +</code></pre></div></div> |
| 99 | + |
| 100 | +<h1 id="install-icinga-web-2">Install Icinga Web 2</h1> |
| 101 | + |
| 102 | +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>apt-get install icingaweb2 |
| 103 | +</code></pre></div></div> |
| 104 | + |
| 105 | +<h1 id="prepare-to-run-the-wizard">Prepare to run the wizard</h1> |
| 106 | + |
| 107 | +<p>Edit <code class="language-plaintext highlighter-rouge">/etc/php/7.0/apache2/php.ini</code>. |
| 108 | +Uncomment <code class="language-plaintext highlighter-rouge">date.timezone</code> and set it. |
| 109 | +Your current timezone is shown by <code class="language-plaintext highlighter-rouge">timedatectl</code>. E.g. “Europe/London”.</p> |
| 110 | + |
| 111 | +<p>Create a database to store user passwords and settings. |
| 112 | +If you need to protect against other users with access to the server, |
| 113 | +change the password (IDENTIFIED BY ‘icingaweb2’) to be more secure. |
| 114 | +(One lazy option would be to copy the password from IDO - see below).</p> |
| 115 | + |
| 116 | +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mysql |
| 117 | + |
| 118 | +CREATE DATABASE icingaweb2; |
| 119 | +GRANT ALL PRIVILEGES ON icingaweb2.* |
| 120 | + TO 'icingaweb2'@'localhost' IDENTIFIED BY 'icingaweb2'; |
| 121 | +quit |
| 122 | + |
| 123 | +icingacli setup token create |
| 124 | +</code></pre></div></div> |
| 125 | + |
| 126 | +<h1 id="run-the-wizard">Run the wizard</h1> |
| 127 | + |
| 128 | +<p>Browse to <code class="language-plaintext highlighter-rouge">http://localhost/icingaweb2</code>. |
| 129 | +You should see a red box saying “It appears that you did not configure Icinga Web 2 yet” etc. |
| 130 | +Follow the link which starts the wizard.</p> |
| 131 | + |
| 132 | +<p>I like to enable the “doc” module.</p> |
| 133 | + |
| 134 | +<p>The password, database name etc which Debian generated for IDO, |
| 135 | +can be found in <code class="language-plaintext highlighter-rouge">/etc/icinga2/features-available/ido-mysql.conf</code>.</p> |
| 136 | + |
| 137 | +<h1 id="reduce-database-privileges">Reduce database privileges</h1> |
| 138 | + |
| 139 | +<p>This step is a workaround. The privileges used above are broader than documented. The wizard did not accept a pre-created database like it says it can (and if I ignored the failed validation, it then didn’t create the user that it says it did, so you can’t log in).</p> |
| 140 | + |
| 141 | +<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>mysql |
| 142 | + |
| 143 | +DROP USER 'icingaweb2'@'localhost'; |
| 144 | +GRANT SELECT, INSERT, UPDATE, DELETE, |
| 145 | + DROP, CREATE VIEW, INDEX, EXECUTE ON icingaweb2.* |
| 146 | + TO 'icingaweb2'@'localhost' IDENTIFIED BY 'icingaweb2'; |
| 147 | +quit |
| 148 | +</code></pre></div></div> |
| 149 | + |
| 150 | + |
| 151 | + </div><a class="u-url" href="/2017/06/27/install-icingaweb2.html" hidden></a> |
| 152 | +</article> |
| 153 | + |
| 154 | + </div> |
| 155 | + </main><footer class="site-footer h-card"> |
| 156 | + <data class="u-url" href="/"></data> |
| 157 | + |
| 158 | + <div class="wrapper"> |
| 159 | + |
| 160 | + <h2 class="footer-heading">Blog?</h2> |
| 161 | + |
| 162 | + <div class="footer-col-wrapper"> |
| 163 | + <div class="footer-col footer-col-1"> |
| 164 | + <ul class="contact-list"> |
| 165 | + <li class="p-name">Blog?</li></ul> |
| 166 | + </div> |
| 167 | + |
| 168 | + <div class="footer-col footer-col-2"><ul class="social-media-list"><li><a href="https://github.com/sourcejedi"><svg class="svg-icon"><use xlink:href="/assets/minima-social-icons.svg#github"></use></svg> <span class="username">sourcejedi</span></a></li><li><a href="https://www.twitter.com/sourcejedi"><svg class="svg-icon"><use xlink:href="/assets/minima-social-icons.svg#twitter"></use></svg> <span class="username">sourcejedi</span></a></li></ul> |
| 169 | +</div> |
| 170 | + |
| 171 | + <div class="footer-col footer-col-3"> |
| 172 | + <p></p> |
| 173 | + </div> |
| 174 | + </div> |
| 175 | + |
| 176 | + </div> |
| 177 | + |
| 178 | +</footer> |
| 179 | +</body> |
| 180 | + |
| 181 | +</html> |
0 commit comments