diff options
Diffstat (limited to 'articles/icinga-director.html')
| -rw-r--r-- | articles/icinga-director.html | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/articles/icinga-director.html b/articles/icinga-director.html new file mode 100644 index 0000000..3993949 --- /dev/null +++ b/articles/icinga-director.html | |||
| @@ -0,0 +1,112 @@ | |||
| 1 | <!DOCTYPE html> | ||
| 2 | <html lang=en> | ||
| 3 | <head> | ||
| 4 | <title></title> | ||
| 5 | <meta charset="utf-8"/> | ||
| 6 | <link rel="shortcut icon" href="favicon.ico"/> | ||
| 7 | <link rel='stylesheet' href='../style.css'/> | ||
| 8 | <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| 9 | </head> | ||
| 10 | <body> | ||
| 11 | <header><h1>Icinga Director</h1></header> | ||
| 12 | <main> | ||
| 13 | <p>Icinga Director is the web-based configuration tool for Icinga2. | ||
| 14 | Director provides a simple interface for configuring the various parts | ||
| 15 | of your monitoring environment. Even if you would rather do all of | ||
| 16 | the configuration from a terminal, I still recommend using Director for | ||
| 17 | its self-service API which allows new nodes to register with no interaction | ||
| 18 | required on the node (i.e. via a script).</p> | ||
| 19 | |||
| 20 | <p>Start by logging into your Icinga instance. If you followed the | ||
| 21 | <a href=icinga2-master.html>master installation guide</a> you should have | ||
| 22 | a tab labeled <strong>Icinga Director</strong>. Click on that, and you should | ||
| 23 | see something similar to this:</p> | ||
| 24 | <img src=../images/director/director.png> | ||
| 25 | |||
| 26 | <h2>Hosts</h2> | ||
| 27 | <p>Let's start by looking at the hosts section. Clicking on the hosts | ||
| 28 | button from the Director menu will present you with several options. | ||
| 29 | Click on host templates, and then click add to define our first host | ||
| 30 | template. Host templates are the building blocks of Icinga, they allow | ||
| 31 | for your nodes to be structured however you see fit, and then to have | ||
| 32 | monitoring checks automatically applied to them based on that structure.</p> | ||
| 33 | <p>I like to structure my host templates by operating system. For example, | ||
| 34 | I have a template called <strong>Linux Server</strong>, which is designed | ||
| 35 | to encompass all of the Linux servers in my environment. I then get more | ||
| 36 | specific, creating templates based on distro. These templates are children | ||
| 37 | of the Linux Server template, so they inherit whatever is applied to the | ||
| 38 | parent, but then can have distro-specific checks applied to themselves.</p> | ||
| 39 | <p>Start by giving your template a name - I will use <strong>Linux Server | ||
| 40 | </strong> here. Groups can be left empty for now, but you may want to | ||
| 41 | add groups and apply them to templates later. The check command should | ||
| 42 | be set to hostalive. Expand <strong>Icinga Agent and zone settings</strong> | ||
| 43 | and set <em>Icinga2 Agent</em>, <em>Establish connection</em>, | ||
| 44 | and <em>Accepts config</em> to Yes. Click store to save the template. | ||
| 45 | Your template should look like this:</p> | ||
| 46 | |||
| 47 | <img src=../images/director/hosttemplate.png> | ||
| 48 | |||
| 49 | <h2>Service templates</h2> | ||
| 50 | <p>Let's turn to services now. Return to the Director menu and select | ||
| 51 | Services. The services menu is structured similar to hosts, and we will | ||
| 52 | start with the service templates section. The idea behind service templates | ||
| 53 | is very similar to host templates. Typically, a service template corresponds | ||
| 54 | to a single monitoring command.</p> | ||
| 55 | <p>As an example, we'll create a service template for a monitoring | ||
| 56 | command that checks the status of a web server. Give the template a | ||
| 57 | name, set the check command to http, and finally expand <strong>Icinga | ||
| 58 | Agent and zone settings</strong> and set <strong>Run on agent | ||
| 59 | </strong> to no. We set this to no because we want Icinga to query | ||
| 60 | the web server externally instead of from the web server itself.</p> | ||
| 61 | |||
| 62 | <img src=../images/director/service-template.png> | ||
| 63 | |||
| 64 | <h2>Service sets</h2> | ||
| 65 | <p>Service sets are simply groups of service templates. They can be | ||
| 66 | structured however you see fit. Service sets can then be applied to | ||
| 67 | hosts/host templates to have the checks be automatically applied.</p> | ||
| 68 | |||
| 69 | <p>Add a new service set and give it a name. Then click on the services | ||
| 70 | tab and add all of the services you want to group into that set. | ||
| 71 | Here is an example of a service set <strong>Linux Standard</strong> | ||
| 72 | that has service checks that should be applied to all Linux servers.</p> | ||
| 73 | |||
| 74 | <img src=../images/director/service-set.png> | ||
| 75 | |||
| 76 | <p>To bring service sets and host templates together, return to your host | ||
| 77 | templates, select Linux Server, select the services tab, and then select | ||
| 78 | add service set and choose your desired set from the dropdown menu.</p> | ||
| 79 | |||
| 80 | <img src=../images/director/host-services.png> | ||
| 81 | |||
| 82 | <h2>Render your config</h2> | ||
| 83 | <p>When you have made all of the changes you need you will need to | ||
| 84 | render the Director configuration. Return to the Director menu, | ||
| 85 | select Config Deployment, and then select Render config.</p> | ||
| 86 | |||
| 87 | <h2>Self Service API</h2> | ||
| 88 | <p>In this last section we will look at what I think is the best feature | ||
| 89 | of Director which is the self service API. To enroll a host template | ||
| 90 | in the self service API, select the host template, select the agent | ||
| 91 | tab, and select generate self service api key. That's it! | ||
| 92 | The string of letters and numbers is the API key associated with this | ||
| 93 | host template. Hosts can be enrolled with this API key and Icinga | ||
| 94 | will automatically assign the host to this template. With proper | ||
| 95 | structuring, you can have hosts be completely provisioned without | ||
| 96 | touching Director. In the next article, we will use this to enroll | ||
| 97 | a host in Icinga with a shell script.</p> | ||
| 98 | <p> | ||
| 99 | <hr> | ||
| 100 | Consider <a href=../donate.html>donating</a> if this article was useful. | ||
| 101 | <a class=qr href=../images/bitcoin.png>[BTC]</a> | ||
| 102 | </p> | ||
| 103 | </main> | ||
| 104 | <footer> | ||
| 105 | <a href=../kb.html>Knowledge Base</a> | ||
| 106 | <br> | ||
| 107 | <a href=../index.html>www.chudnick.com</a> | ||
| 108 | </footer> | ||
| 109 | |||
| 110 | </body> | ||
| 111 | </html> | ||
| 112 | |||
