summaryrefslogtreecommitdiff
path: root/articles/icinga-director.html
blob: 39939499ac19a3af5d80bebff71a4cb05b0d7666 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html>
<html lang=en>
    <head>
        <title></title>
        <meta charset="utf-8"/>
        <link rel="shortcut icon" href="favicon.ico"/>
        <link rel='stylesheet' href='../style.css'/>
        <meta name="viewport" content="width=device-width, initial-scale=1">
    </head>
<body>
    <header><h1>Icinga Director</h1></header>
    <main>
		<p>Icinga Director is the web-based configuration tool for Icinga2.
		Director provides a simple interface for configuring the various parts
		of your monitoring environment.  Even if you would rather do all of 
		the configuration from a terminal, I still recommend using Director for
		its self-service API which allows new nodes to register with no interaction
		required on the node (i.e. via a script).</p>

		<p>Start by logging into your Icinga instance. If you followed the 
		<a href=icinga2-master.html>master installation guide</a> you should have
		a tab labeled <strong>Icinga Director</strong>. Click on that, and you should
		see something similar to this:</p>
		<img src=../images/director/director.png>

		<h2>Hosts</h2>
		<p>Let's start by looking at the hosts section. Clicking on the hosts
		button from the Director menu will present you with several options.
		Click on host templates, and then click add to define our first host
		template.  Host templates are the building blocks of Icinga, they allow
		for your nodes to be structured however you see fit, and then to have
		monitoring checks automatically applied to them based on that structure.</p>
		<p>I like to structure my host templates by operating system. For example,
		I have a template called <strong>Linux Server</strong>, which is designed
		to encompass all of the Linux servers in my environment. I then get more
		specific, creating templates based on distro. These templates are children
		of the Linux Server template, so they inherit whatever is applied to the
		parent, but then can have distro-specific checks applied to themselves.</p>
		<p>Start by giving your template a name - I will use <strong>Linux Server
		</strong> here. Groups can be left empty for now, but you may want to
		add groups and apply them to templates later. The check command should
		be set to hostalive. Expand <strong>Icinga Agent and zone settings</strong> 
		and set <em>Icinga2 Agent</em>, <em>Establish connection</em>,  
		and <em>Accepts config</em> to Yes. Click store to save the template.
		Your template should look like this:</p>

		<img src=../images/director/hosttemplate.png>

		<h2>Service templates</h2>
		<p>Let's turn to services now. Return to the Director menu and select 
		Services. The services menu is structured similar to hosts, and we will
		start with the service templates section. The idea behind service templates
		is very similar to host templates. Typically, a service template corresponds
		to a single monitoring command.</p>
		<p>As an example, we'll create a service template for a monitoring
		command that checks the status of a web server. Give the template a
		name, set the check command to http, and finally expand <strong>Icinga
		Agent and zone settings</strong> and set <strong>Run on agent
		</strong> to no. We set this to no because we want Icinga to query
		the web server externally instead of from the web server itself.</p>

		<img src=../images/director/service-template.png>

		<h2>Service sets</h2>
		<p>Service sets are simply groups of service templates. They can be
		structured however you see fit. Service sets can then be applied to
		hosts/host templates to have the checks be automatically applied.</p>

		<p>Add a new service set and give it a name. Then click on the services
		tab and add all of the services you want to group into that set.
		Here is an example of a service set <strong>Linux Standard</strong> 
		 that has service checks that should be applied to all Linux servers.</p>

		<img src=../images/director/service-set.png>

		<p>To bring service sets and host templates together, return to your host
		templates, select Linux Server, select the services tab, and then select
		add service set and choose your desired set from the dropdown menu.</p>

		<img src=../images/director/host-services.png>

		<h2>Render your config</h2>
		<p>When you have made all of the changes you need you will need to
		render the Director configuration. Return to the Director menu,
		select Config Deployment, and then select Render config.</p>

		<h2>Self Service API</h2>
		<p>In this last section we will look at what I think is the best feature
		of Director which is the self service API. To enroll a host template
		in the self service API, select the host template, select the agent
		tab, and select generate self service api key.  That's it!
		The string of letters and numbers is the API key associated with this
		host template. Hosts can be enrolled with this API key and Icinga
		will automatically assign the host to this template. With proper
		structuring, you can have hosts be completely provisioned without
		touching Director. In the next article, we will use this to enroll
		a host in Icinga with a shell script.</p>
<p>
<hr>
Consider <a href=../donate.html>donating</a> if this article was useful.
<a class=qr href=../images/bitcoin.png>[BTC]</a>
</p>
    </main>
    <footer>
			<a href=../kb.html>Knowledge Base</a>
			<br>
			<a href=../index.html>www.chudnick.com</a>
	</footer>

</body>
</html>