File: quickstart-icinga.html

package info (click to toggle)
icinga 1.0.2-2%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 33,952 kB
  • ctags: 13,294
  • sloc: xml: 154,821; ansic: 99,198; sh: 14,585; sql: 5,852; php: 5,126; perl: 2,838; makefile: 1,268
file content (345 lines) | stat: -rw-r--r-- 15,663 bytes parent folder | download | duplicates (2)
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Icinga Quickstart</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
<meta name="keywords" content="Supervision, Icinga, Nagios, Linux">
<link rel="home" href="index.html" title="Icinga Version 1.0.2 Documentation">
<link rel="up" href="ch02.html" title="Chapter 2. Getting Started">
<link rel="prev" href="quickstart.html" title="Quickstart Installation Guides">
<link rel="next" href="quickstart-icinga-freebsd.html" title="Icinga Quickstart FreeBSD">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<CENTER><IMG src="../images/logofullsize.png" border="0" alt="Icinga" title="Icinga"></CENTER>
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">Icinga Quickstart</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="quickstart.html">Prev</a> </td>
<th width="60%" align="center">Chapter 2. Getting Started</th>
<td width="20%" align="right"> <a accesskey="n" href="quickstart-icinga-freebsd.html">Next</a>
</td>
</tr>
</table>
<hr>
</div>
<div class="section" title="Icinga Quickstart">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="quickstart-icinga"></a>Icinga Quickstart</h2></div></div></div>
  

  <p><span class="bold"><strong><a name="introduction_icinga"></a>Introduction</strong></span></p>

  <p>This guide is intended to provide you with simple instructions on how to install Icinga from source (code) and have it
  monitoring your local machine within 20 minutes.</p>

  <p>No advanced installation options are discussed here - just the basics that will work for most of the users who want to get
  started.</p>

  <p>This guide will give you examples for currently three different Linux distributions: <a class="link" href="http://fedoraproject.org/" target="_top">Fedora</a>, <a class="link" href="http://www.ubuntu.com/" target="_top">Ubuntu</a> and <a class="link" href="http://www.opensuse.org/" target="_top">openSuSE</a>. Similar distributions may work as well. That should include <a class="link" href="http://www.redhat.com/" target="_top">RedHat</a>, <a class="link" href="http://www.centos.org/" target="_top">CentOS</a>, <a class="link" href="http://www.debian.org/" target="_top">Debian</a> and <a class="link" href="http://www.novell.com/products/server/" target="_top">SLES</a>.</p>

  <p>For instructions on how to install Icinga on FreeBSD please read <a class="link" href="quickstart-icinga-freebsd.html" title="Icinga Quickstart FreeBSD">Icinga on FreeBSD</a> instead.</p>

  <p>Other distributions may inherit from these examples.</p>

  <p><span class="bold"><strong>If you are planning to use a database with IDOUtils please read <a class="link" href="quickstart-idoutils.html" title="Icinga with IDOUtils Quickstart">Icinga with IDOUtils</a> instead!</strong></span></p>

  <p><span class="bold"><strong>What You'll End Up With</strong></span></p>

  <p>If you follow these instructions, here's what you'll end up with:</p>

  <div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
      <p>Icinga and the plugins will be installed underneath /usr/local/icinga</p>
    </li>
<li class="listitem">
      <p>Icinga will be configured to monitor a few aspects of your local system (CPU load, disk usage, etc.)</p>
    </li>
<li class="listitem">
      <p>The Icinga classic web interface will be accessible at <code class="uri">http://localhost/icinga/</code> or
      <code class="uri">http://yourdomain.com/icinga</code></p>
    </li>
</ul></div>

  <p><span class="bold"><strong>Prerequisites</strong></span></p>

  <p>During portions of the installation you'll need to have <span class="bold"><strong>root</strong></span> access to your machine.</p>

  <p>Make sure you've installed the following packages on your system before continuing.</p>

  <div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
      <p><a class="link" href="http://www.apache.org" target="_top">Apache</a></p>
    </li>
<li class="listitem">
      <p>GCC compiler</p>
    </li>
<li class="listitem">
      <p>C/C++ development libraries</p>
    </li>
<li class="listitem">
      <p><a class="link" href="http://www.boutell.com/gd/" target="_top">GD</a> development libraries</p>
    </li>
</ul></div>

  <p><span class="bold"><strong>Optional</strong></span></p>

  <p>At one time or another you may need to use SNMP-based checks so it is a good idea to install the required packages now. Otherwise
  some plugins are not compiled i.e. not available when you need them and it would require a recompile of the plugins.</p>

  <p><span class="bold"><strong>Install packages</strong></span></p>

  <p>You can install these packages by running the following commands (as root or sudo):</p>

  <p><span class="emphasis"><em>Fedora/RHEL/CentOS</em></span></p>

  <pre class="programlisting"> #&gt; yum install httpd gcc glibc glibc-common gd gd-devel
 #&gt; yum install libjpeg libjpeg-devel libpng libpng-devel
 #&gt; yum install net-snmp net-snmp-devel</pre>

  <p><span class="emphasis"><em>Debian/Ubuntu</em></span></p>

  <pre class="programlisting"> #&gt; apt-get install apache2 build-essential libgd2-xpm-dev
 #&gt; apt-get install libjpeg62 libjpeg62-dev libpng12 libpng12-dev
 #&gt; apt-get install snmp libsnmp5-dev</pre>

  <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top">
    <p>The numbers &lt;62/12&gt; might differ, depending on your distribution</p>
  </td></tr>
</table></div>

  <p><span class="emphasis"><em>openSuSE</em></span></p>

  <p>Please use yast to install the packages</p>

  <p><span class="bold"><strong>Create Account Information</strong></span></p>

  <p>Become the root user.</p>

  <pre class="programlisting"> $&gt; su -l</pre>

  <p>Create a new <span class="emphasis"><em>icinga</em></span> user account and give it a password:</p>

  <pre class="programlisting"> #&gt; /usr/sbin/useradd -m icinga 
 #&gt; passwd icinga  </pre>

  <p>On some distributions you'll need to add the group in a single step:</p>

  <pre class="programlisting"> #&gt; /usr/sbin/groupadd icinga</pre>

  <p>For sending commands from the classic web interface to Icinga, you'll need to create a new group icinga-cmd. Add the webuser
  and the Icingauser to this group:</p>

  <pre class="programlisting"> #&gt; /usr/sbin/groupadd icinga-cmd
 #&gt; /usr/sbin/usermod -a -G icinga-cmd icinga
 #&gt; /usr/sbin/usermod -a -G icinga-cmd www-data (or www, wwwrun, apache depending on the distribution)</pre>

  <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top">
    <p>Some usermod-versions (e.g. in OpenSuSE 11 and SLES 11, resp.) are lacking the option -a. In this case please omit the option
    -a.</p>
  </td></tr>
</table></div>

  <p><span class="bold"><strong>Download Icinga and the Plugins</strong></span></p>

  <p>Change to your local source directory i.e. /usr/src</p>

  <pre class="programlisting"> #&gt; cd /usr/src</pre>

  <p>Either fetch the current icinga-core snapshot from Icinga GIT </p>
<pre class="programlisting"> #&gt; git clone git://git.icinga.org/icinga-core.git</pre>
<p>
  or from the <a class="link" href="http://www.icinga.org/" target="_top">Icinga Website</a> .</p>

  <p>Don't forget to download the <a class="link" href="http://www.nagiosplugins.org/" target="_top">Nagios Plugins</a> .</p>

  <p><span class="bold"><strong>Compile and install Icinga</strong></span></p>

  <p>Extract the Icinga source code tarball (or change directory to the GIT snapshot)</p>

  <pre class="programlisting"> #&gt; cd /usr/src/ 
 #&gt; tar xvzf icinga-1.0.2.tar.gz 
 #&gt; cd icinga-1.0.2</pre>

  <p>Run the Icinga configure script. You will get help by using the --help flag.</p>

  <pre class="programlisting"> #&gt; ./configure --with-command-group=icinga-cmd</pre>

  <p>Compile the Icinga source code. To see available options, only use "make".</p>

  <pre class="programlisting"> #&gt; make all</pre>

  <p>Install binaries, init script, sample config files and set permissions on the external command directory. </p>
<pre class="programlisting"> #&gt; make install 
 #&gt; make install-init 
 #&gt; make install-config 
 #&gt; make install-commandmode </pre>
<p> or shorter </p>
<pre class="programlisting"> #&gt; make fullinstall</pre>

  <p>Don't start Icinga yet - there's still more that needs to be done...</p>

  <p><span class="bold"><strong>Customise Configuration</strong></span></p>

  <p>Sample configuration files have been installed by using </p>
<pre class="programlisting"> #&gt; make install-config</pre>
<p> into
  /usr/local/icinga/etc/. You'll need to make just one change before you proceed...</p>

  <p>Edit the <span class="emphasis"><em>/usr/local/icinga/etc/objects/contacts.cfg</em></span> config file with your favourite editor and change the email
  address associated with the <span class="emphasis"><em>icingaadmin</em></span> contact definition to the address you'd like to use for receiving
  alerts.</p>

  <pre class="programlisting"> #&gt; vi /usr/local/icinga/etc/objects/contacts.cfg</pre>

  <p><span class="bold"><strong>Configure the Classic Web Interface</strong></span></p>

  <p>Icinga ships with the Classic Web Interface ("the CGIs") which can be installed via</p>

  <pre class="programlisting"> #&gt; make cgis
 #&gt; make install-cgis</pre>

  <p>If you are interested in the new Icinga Web, please refer to <a class="link" href="icinga-web-scratch.html" title="Installation of the Icinga Web Frontend">Install Icinga Web
  Interface</a>.</p>

  <p>Install the Icinga Classic web config file in the Apache conf.d directory.</p>

  <pre class="programlisting"> #&gt; make install-webconf</pre>

  <p>Create an <span class="emphasis"><em>icingaadmin</em></span> account for logging into the Icinga classic web interface. If you want to change it
  later, use the same command. Remember the password you assign to this account - you'll need it later.</p>

  <pre class="programlisting"> #&gt; htpasswd -c /usr/local/icinga/etc/htpasswd.users icingaadmin</pre>

  <p>If you want to change it later or want to add another user, use the following command:</p>

  <pre class="programlisting"> #&gt; htpasswd /usr/local/icinga/etc/htpasswd.users &lt;USERNAME&gt;</pre>

  <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top">
    <p>Depending on your distribution/Apache-version you may have to use <span class="emphasis"><em>htpasswd2</em></span> instead.</p>
  </td></tr>
</table></div>

  <p>Reload/Restart Apache to make the new settings take effect.</p>

  <p><span class="emphasis"><em>Fedora/RHEL/CentOS</em></span></p>

  <pre class="programlisting"> #&gt; service httpd restart</pre>

  <p><span class="emphasis"><em>Debian/Ubuntu/openSuSE</em></span></p>

  <pre class="programlisting"> #&gt; /etc/init.d/apache2 reload</pre>

  <p><span class="bold"><strong>Compile and Install the Nagios Plugins</strong></span></p>

  <p>Extract the Nagios plugins source code tarball.</p>

  <pre class="programlisting"> #&gt; cd /usr/src 
 #&gt; tar xvzf nagios-plugins-1.4.14.tar.gz
 #&gt; cd nagios-plugins-1.4.14 </pre>

  <p>Compile and install the plugins by changing install directory to /usr/local/icinga</p>

  <pre class="programlisting"> #&gt; ./configure --prefix=/usr/local/icinga --with-nagios-user=icinga 
 #&gt; make 
 #&gt; make install </pre>

  <p><span class="bold"><strong>Start Icinga</strong></span></p>

  <p>Add Icinga to the list of system services and have it automatically start when the system boots (make sure you have installed
  the init script before).</p>

  <p><span class="emphasis"><em>Fedora/RHEL/CentOS/openSuSE</em></span></p>

  <pre class="programlisting"> #&gt; chkconfig --add icinga 
 #&gt; chkconfig icinga on </pre>

  <p><span class="emphasis"><em>Debian/Ubuntu</em></span></p>

  <pre class="programlisting"> #&gt; update-rc.d icinga defaults</pre>

  <p>Verify the sample Icinga configuration files.</p>

  <pre class="programlisting"> #&gt; /usr/local/icinga/bin/icinga -v /usr/local/icinga/etc/icinga.cfg</pre>

  <p>If there are no errors, start Icinga.</p>

  <p><span class="emphasis"><em>Fedora/RHEL/CentOS/Ubuntu</em></span></p>

  <pre class="programlisting"> #&gt; service icinga start</pre>

  <p><span class="emphasis"><em>Debian/openSuSE</em></span></p>

  <pre class="programlisting"> #&gt; /etc/init.d/icinga start</pre>

  <p><span class="bold"><strong>Login to the Classic Web Interface</strong></span></p>

  <p>You should now be able to access the Icinga classic web interface at the URL below. You'll be prompted for the username (
  <span class="emphasis"><em>icingaadmin</em></span>) and password you specified earlier.</p>

  <pre class="programlisting"> http://localhost/icinga/</pre>

  <p>or</p>

  <pre class="programlisting"> http://yourdomain.com/icinga/</pre>

  <p>Click on the "Service Detail" navbar link to see details of what's being monitored on your local machine. It will take a few minutes
  for Icinga to check all the services associated with your machine.</p>

  <p><span class="bold"><strong>Other Modifications</strong></span></p>

  <p>Make sure your system's firewall rules are configured to allow access to the web server if you want to access the Icinga
  classic interface remotely.</p>

  <pre class="programlisting"> #&gt; iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT</pre>

  <p>Setting up your mail transfer agent (MTA) like exim, sendmail or postfix to allow Icinga sending notification emails won't be
  explained here.</p>

  <p>Please refer to the <a class="link" href="http://www.nagioswiki.org/" target="_top">Nagios Wiki</a> for more resources.</p>

  <p><span class="bold"><strong>You're Done</strong></span></p>

  <p>Congratulations! You successfully installed Icinga. Your journey into monitoring has just begun.</p>

  <p>You'll no doubt want to monitor more than just your local machine, so check out the chapter on <a class="link" href="ch02.html" title="Chapter 2. Getting Started">"Getting
  Started"</a> about "Monitoring ..."</p>

  <a class="indexterm" name="id1918213"></a>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="quickstart.html">Prev</a> </td>
<td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td>
<td width="40%" align="right"> <a accesskey="n" href="quickstart-icinga-freebsd.html">Next</a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Quickstart Installation Guides </td>
<td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td>
<td width="40%" align="right" valign="top"> Icinga Quickstart FreeBSD</td>
</tr>
</table>
</div>
<P class="copyright">© 2009-2010 Icinga Development Team, http://www.icinga.org</P>
</body>
</html>