This repository has been archived by the owner on Jan 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
quickstart-idoutils.xml
961 lines (703 loc) · 40.9 KB
/
quickstart-idoutils.xml
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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE section [
<!ENTITY % all.entities SYSTEM "all-entities.ent">
%all.entities;
]>
<section version="5.0" xml:id="quickstart-idoutils" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:svg="http://www.w3.org/2000/svg" xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:html="http://www.w3.org/1999/xhtml" xmlns:db="http://docbook.org/ns/docbook">
<title>&name-icinga; with &name-idoutils; Quickstart</title>
<section xml:id="introduction">
<title>Introduction</title>
<note>
<para>Instead of installing &name-icinga; from scratch you may want to use a package which might be available for your OS. Please take
a look at the <link xlink:href="https://www.icinga.org/download/packages">table of packages</link>.</para>
<para>Please keep in mind that the upstream packages might be outdated so using backport packages is a way to get a recent version.
Please take a look at wiki articles for detailed descriptions:</para>
<itemizedlist>
<listitem>
<para><link xlink:href="https://wiki.icinga.org/display/howtos/Setting+up+Icinga+with+IDOUtils+on+Debian">Debian</link></para>
</listitem>
<listitem>
<para><link xlink:href="https://wiki.icinga.org/display/howtos/Setting+up+Icinga+with+IDOUtils+on+Ubuntu">Ubuntu</link></para>
</listitem>
<listitem>
<para><link xlink:href="https://wiki.icinga.org/display/howtos/Setting+up+Icinga+with+IDOUtils+on+RHEL">RHEL/CentOS</link></para>
</listitem>
</itemizedlist>
<para>If you are planning to install from source then please use the official release tarball.</para>
</note>
<important>
<para>Please don't use git snapshots unless you have an issue which might be solved in the current developer version.</para>
</important>
<para>This guide is intended to provide you with simple instructions on how to install &name-icinga; from source (code) and have it
monitoring your local machine within 30 minutes.</para>
<para>No advanced installation options are discussed here - just the basics that will work for most of the users who want to get
started.</para>
<para>This guide will give you examples for currently three different Linux distributions: <link
xlink:href="http://fedoraproject.org/">&name-fedora;</link>, <link xlink:href="http://www.ubuntu.com/">&name-ubuntu;</link> and <link
xlink:href="http://www.opensuse.org/">&name-opensuse;</link>. Similar distributions may work as well. That should include <link
xlink:href="http://www.redhat.com/">&name-redhat;</link>, <link xlink:href="http://www.centos.org/">&name-centos;</link>, <link
xlink:href="http://www.debian.org/">&name-debian;</link> and <link
xlink:href="http://www.novell.com/products/server/">&name-sles;</link>.</para>
<para>Other distributions may inherit from these examples.</para>
<important>
<para>If you are planning to use &name-icinga; without &name-idoutils; please read <xref linkend="quickstart-icinga"/> instead!</para>
</important>
<para><emphasis role="bold">What You'll End Up With</emphasis></para>
<para>If you follow these instructions, here's what you'll end up with:</para>
<itemizedlist>
<listitem>
<para>&name-icinga; and the plugins will be installed underneath &url-icinga-base;</para>
</listitem>
<listitem>
<para>&name-icinga; will be configured to monitor a few aspects of your local system (CPU load, disk usage, etc.)</para>
</listitem>
<listitem>
<para>The &name-icinga; classic web interface will be accessible at http://localhost/icinga/ or http://yourdomain.com/icinga</para>
</listitem>
<listitem>
<para>A database which is filled by &name-icinga; using &name-idoutils;</para>
</listitem>
</itemizedlist>
</section>
<section xml:id="prerequisites">
<title>Prerequisites</title>
<para>During portions of the installation you'll need to have <emphasis role="bold">root</emphasis> access to your machine.</para>
<para>Make sure you've installed the following packages on your system before continuing. &name-idoutils; use the <link
xlink:href="http://libdbi.sourceforge.net">libdbi</link> and the libdbi-drivers for several databases. The development libraries are
also required. The following examples will show how to install the &name-idoutils; with the libdbi using &name-mysql; or
&name-postgres;.</para>
<itemizedlist>
<listitem>
<para>Apache</para>
</listitem>
<listitem>
<para>GCC compiler</para>
</listitem>
<listitem>
<para>C/C++ development libraries</para>
</listitem>
<listitem>
<para><link xlink:href="http://www.boutell.com/gd/">GD</link> development libraries</para>
</listitem>
<listitem>
<para>libdbi/libdbi-drivers, database like &name-mysql; or &name-postgres;</para>
<note>
<para>&name-postgres;: Due to changes on insert statements PostgreSQL 8.1 does no longer work (and is already <link
xlink:href="http://wiki.postgresql.org/wiki/PostgreSQL_Release_Support_Policy">end-of-life</link> since November 2010) so please
use 8.2 or even better 8.4. String escaping in &name-postgres; 9.x is still in an experimental state (refer to <link
xlink:href="https://dev.icinga.org/issues/1974">issue #1974</link>).</para>
</note>
</listitem>
</itemizedlist>
<para><emphasis role="bold">Optional</emphasis></para>
<para>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.</para>
</section>
<section xml:id="newfeatures">
<title>New features for the &name-idoutils;:</title>
<itemizedlist>
<listitem>
<para><emphasis role="bold">SSL-Encryption between idomod and ido2db</emphasis></para>
<para>If you want to use SSL-encryption you'll need openssl and openssl-devel/libssl-dev (Ubuntu) to be installed!</para>
<para><note>
<para>SSL has to be enabled on all idomod client, otherwise you will lose data!!!</para>
</note></para>
</listitem>
<listitem>
<para><emphasis role="bold">&name-oracle; Database Support</emphasis></para>
<para>If you want &name-oracle; as RDBMS you'll need to install ocilib instead of libdbi.</para>
<note>
<para>Using &name-idoutils; 1.5.0 with &name-oracle; requires at least OCILIB 3.9.2 - don't install 3.9.0 or 3.9.1 as they remain
buggy.</para>
</note>
<note>
<para>More detailed instructions using &name-idoutils; with &name-oracle; you can find in our wiki howto series about <link
xlink:href="https://wiki.icinga.org/display/howtos/Icinga+and+Oracle">&name-oracle;</link>.</para>
</note>
<itemizedlist>
<listitem>
<para>&name-oracle; libraries and SDK (e.g. Instant Client)</para>
<para>If you install from package, make sure the libraries are within PATH. Otherwise you need to set the Oracle libs during
Icinga IDOUtils install using e.g. --with-oracle-lib=/path/to/instantclient</para>
</listitem>
<listitem>
<para>ocilib instead of libdbi</para>
</listitem>
</itemizedlist>
<para>Get it from &url-orclib; and point configure to your Oracle libraries and header files e.g. from the Oracle instant
client:</para>
<para><screen> #> ./configure --with-oracle-headers-path=/path/to/instantclient/sdk/include \
--with-oracle-lib-path=/path/to/instantclient/
#> make
#> make install</screen></para>
<itemizedlist>
<listitem>
<para><emphasis>&name-icinga; 1.4</emphasis></para>
<para>As of &name-icinga; 1.4 the minimum expected &name-oracle; version is &name-oracle; 10gR2. Older versions may work, but
are not supported. &name-oracle; scripts are designed to split data, index and lobs into different tablespaces. For this reason
there is a new prerequisite to define the tablespace names you want to use. If you are working in a small environment, you can
set all defines to the same real tablespace. You will find a new script <filename>icinga_defines.sql</filename> which you have
to adapt for your needs before applying <filename>oracle.sql</filename>. For your convenience there is a new script
<filename>create_oracle_sys.sql</filename> included, which should help you to create the necessary tablespaces and an
&name-icinga; application user and must run as SYS. It will make use of <filename>icinga_defines.sql</filename> as well. Object
creation has been moved from <filename>oracle.sql</filename> to the script
<filename>create_icinga_objects_oracle.sql</filename>.</para>
<para>The former <filename>oracle.sql</filename> has been redesigned as a master script to record all other scripts as includes
and expects these includes within the current directory. For this reason you should start <filename>sqlplus</filename> executing
<filename>oracle.sql</filename> within this directory. This way the creation of user and tablespaces and the creation of
&name-icinga; tables runs in one step. As an all-in-one sample you will find a new script
<filename>db/scripts/create_oracledb.sh</filename>. Edit variables to suit your needs and enjoy. If you prefer to do SYS steps
for yourself, please uncomment <filename>create_oracle_sys.sql</filename> and make sure that your database &name-icinga; user
and tables exist and are defined with the same (or more) rights and that the correct settings have been applied to
<filename>icinga_defines.sql</filename>.</para>
</listitem>
<listitem>
<para><anchor xml:id="q_id-timezone_support"/><emphasis role="bold">Timezone support</emphasis></para>
<para>Starting with &name-icinga; 1.6 all dates are stored as local timestamps in the database. Before that there was a
different behaviour storing and retrieving dates for each database system which was difficult to handle for frontend apps.
Therefore datatypes have been changed for &name-mysql; from DATETIME to TIMESTAMP and for &name-oracle; from DATE to LOCAL
TIMESTAMP (0). &name-postgres; was already using TIMESTAMP but has been changed to TIMESTAMP WITH TIME ZONE. IDO2DB will set
session timezone to UTC and store all unix timestamps (which are UTC per definition) as UTC based values. Please make sure your
system returns unix timestamps as real UTC based values (like "date -u '+%s'").</para>
<note>
<para>Make sure your database session runs in the same timezone in which the existing dates have been stored (check your local
timezone e.g. &name-oracle;:"select sessiontimezone from dual;") if you are running the upgrade script. Additionally for your
convenience in &name-oracle; you should set your session timestamp format to the value you want, e.g "alter session set
nls_timestamp_format='YYYY-MM-DD HH24:MI:SS';" or similar. Now you can view entries from different &name-icinga; installations
in different time zones which are stored in the same database and regardless from where you accessing it, all entries are
returned in your local time zone.</para>
</note>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</section>
<section xml:id="installpackages">
<title>Install Packages</title>
<para>You can install your packages by running the following commands (as root or sudo).</para>
<note>
<para>Unfortunately sometimes the names of packages change between different releases of the same distribution so if you get a message
that one of the packages cannot be found then please use the search option of your package manager to get the new name: <itemizedlist>
<listitem>
<para><code>yum search <package name></code> ( <emphasis>&name-fedora;/&name-rhel;/&name-centos;</emphasis> )</para>
</listitem>
<listitem>
<para><code>apt-cache search <package name></code> ( <emphasis>&name-debian;/&name-ubuntu;</emphasis> )</para>
</listitem>
<listitem>
<para><code>zypper search <package name></code> ( <emphasis>&name-opensuse;/&name-sles;</emphasis> )</para>
</listitem>
</itemizedlist></para>
</note>
<itemizedlist>
<listitem>
<para><emphasis role="bold">&name-fedora;/&name-rhel;/&name-centos;:</emphasis></para>
<screen> #> yum install httpd gcc glibc glibc-common gd gd-devel
#> yum install libjpeg libjpeg-devel libpng libpng-devel</screen>
<note>
<para>You may have to use libjpeg-turbo and libjpeg-turbo-devel instead</para>
</note>
<itemizedlist>
<listitem>
<para><emphasis role="bold">&name-mysql;:</emphasis></para>
<screen> #> yum install mysql mysql-server \
libdbi libdbi-devel libdbi-drivers libdbi-dbd-mysql</screen>
</listitem>
<listitem>
<para><emphasis role="bold">&name-postgres;:</emphasis></para>
<screen> #> yum install postgresql postgresql-server \
libdbi libdbi-devel libdbi-drivers libdbi-dbd-pgsql</screen>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para><emphasis role="bold">&name-debian;/&name-ubuntu;:</emphasis></para>
<screen> #> apt-get install apache2 build-essential libgd2-xpm-dev
#> apt-get install libjpeg62 libjpeg62-dev libpng12 libpng12-dev</screen>
<note>
<para>The numbers <62/12> might differ, depending on your distribution</para>
</note>
<note>
<para>Starting with &name-debian; 6.0 / &name-ubuntu; 10.10 the packages are called libpng12-0 and libdbi0, as well as Debian 6.0
uses libdbi0-dev while Debian 7.0 will use libdbi-dev.</para>
</note>
<itemizedlist>
<listitem>
<para><emphasis role="bold">&name-mysql;:</emphasis></para>
<screen> #> apt-get install mysql-server mysql-client libdbi1 libdbi-dev libdbd-mysql</screen>
</listitem>
<listitem>
<para><emphasis role="bold">&name-postgres;:</emphasis></para>
<screen> #> apt-get install postgresql libdbi1 libdbi-dev libdbd-pgsql libpq-dev</screen>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para><emphasis role="bold">&name-opensuse;:</emphasis></para>
<para>Please use YaST to install at least the packages gd, gd-devel, libjpeg, libjpeg-devel, libpng, libpng-devel and, optionally,
net-snmp, net-snmp-devel and perl-Net-SNMP.</para>
<para>Using zypper should work as well:</para>
<screen> #> zypper install gd gd-devel libjpeg libjpeg-devel libpng libpng-devel
#> zypper install net-snmp net-snmp-devel perl-Net-SNMP</screen>
<note>
<para>The devel packages might be placed on the SDK DVDs.</para>
</note>
<itemizedlist>
<listitem>
<para><emphasis role="bold">&name-mysql;:</emphasis></para>
<para>Use YaST to install the packages for the RDBMS you want to use, i.e. "mysql", "mysql-devel", "mysql-client" and the libdbi
packages "libdbi", "libdbi-devel", "libdbi-drivers" and "libdbi-dbd-mysql", or alternatively <filename>zypper</filename>.</para>
<screen> #> zypper install mysql mysql-devel mysql-client \
libdbi libdbi-devel libdbi-drivers libdbi-dbd-mysql</screen>
<note>
<para>In OpenSuSE 11 (SLES 11) the name of the package was changed from "mysql-devel" to "libmysqlclient-devel".</para>
</note>
</listitem>
<listitem>
<para><emphasis role="bold">&name-postgres;:</emphasis></para>
<para>Use YaST to install the packages for the RDBMS you want to use, i.e. "postgresql", "postgresql-devel", "postgresql-server"
and the libdbi packages "libdbi", "libdbi-devel" and "libdbi-drivers", or alternatively <filename>zypper</filename>.</para>
<screen> #> zypper install postgresql postgresql-devel postgresql-server
#> zypper install libdbi libdbi-devel libdbi-drivers</screen>
</listitem>
</itemizedlist>
<para>Using old OpenSuSE (SLES) versions including version 10 it is most likely that there aren't any libdbi packages so you have to
download and compile the sources. Replace <rdbm> with your desired RDBM like mysql or pgsql. Remember that the Oracle driver
is not yet working and read the appropriate section with ocilib instead of libdbi.</para>
<orderedlist>
<listitem>
<para>Download and extract the tar.gz files</para>
<para><link xlink:href="http://libdbi.sourceforge.net/download.html">http://libdbi.sourceforge.net/download.html</link></para>
<para><link
xlink:href="http://libdbi-drivers.sourceforge.net/download.html">http://libdbi-drivers.sourceforge.net/download.html</link></para>
<para><screen> #> tar xvzf libdbi-0.8.3.tar.gz
#> tar xvzf libdbi-drivers-0.8.3-1.tar.gz</screen></para>
</listitem>
<listitem>
<para>Install libdbi. Maybe you have to specify additional options with configure (set --prefix=/usr ... )</para>
<para><screen> #> cd libdbi-0.8.3
#> ./configure --disable-docs
#> make
#> make install</screen></para>
</listitem>
<listitem>
<para>Install libdbi-drivers</para>
<para><screen> #> cd libdbi-drivers-0.8.3-1
#> ./configure --with-<rdbm> --disable-docs
#> make
#> make install</screen><note>
<para>Using the 64-bit-versions you have to specify the paths to the include- and lib-dir explicitly:</para>
<para><screen> #> ./configure --with-<rdbm> \
--with-<rdbm>-incdir=/usr/include/<rdbm>/ \
--with-<rdbm>-libdir=/usr/lib64/ --disable-docs</screen></para>
</note></para>
</listitem>
</orderedlist>
</listitem>
</itemizedlist>
</section>
<section xml:id="createaccount">
<title>Create Account Information</title>
<para>Become the root user.</para>
<screen> $> su -l</screen>
<para>Create a new <emphasis>&name-icinga;</emphasis> user account and give it a password.</para>
<screen> #> /usr/sbin/useradd -m icinga
#> passwd icinga </screen>
<para>On some distributions you'll need to add the group in a single step:</para>
<screen> #> /usr/sbin/groupadd icinga</screen>
<para>For sending commands from the classic web interface to &name-icinga;, you'll need to create a new group icinga-cmd. Add the
webuser and the &name-icinga;user to this group:</para>
<screen> #> /usr/sbin/groupadd icinga-cmd
#> /usr/sbin/usermod -a -G icinga-cmd icinga
#> /usr/sbin/usermod -a -G icinga-cmd www-data</screen>
<para>(or www, wwwrun, apache depending on the distribution)</para>
<note>
<para>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.</para>
</note>
<important>
<para>Solaris only supports groupnames with max. 8 characters, please use icingcmd instead of icinga-cmd.</para>
</important>
</section>
<section xml:id="downloadicingaandplugins">
<title>Download &name-icinga; and the Plugins</title>
<para>Change to your local source directory i.e. /usr/src</para>
<screen> #> cd /usr/src</screen>
<para>Get the current source from the <link xlink:href="http://www.icinga.org/">&name-icinga; Website</link>. Don't forget to download
the <link xlink:href="http://www.monitoring-plugins.org/">&name-monitoringplug;</link></para>
</section>
<section xml:id="compileinstallidoutils">
<title>Compile and Install &name-icinga; with &name-idoutils;</title>
<para>Extract the &name-icinga; source code tarball</para>
<screen xml:space="preserve"> #> cd /usr/src/
#> tar xvzf icinga-&ver-icinga;.tar.gz
#> cd icinga-&ver-icinga;</screen>
<note>
<para>This absolute path is meant when we refer to '/path/to/icinga-src/' in the following text.</para>
</note>
<para>Run the &name-icinga; configure script and enable &name-idoutils;. You will get help by using the --help flag:</para>
<note>
<para>Starting with &name-icinga; 1.9 the default has changed so the &name-idoutils; will be compiled automatically unless disabled
explicitly.</para>
</note>
<screen> #> ./configure --with-command-group=icinga-cmd</screen>
<note>
<para>Starting with Apache 2.4 the web configuration folder changed from <filename>/etc/apache2/conf.d</filename> to
<filename>/etc/apache2/conf-available</filename> so depending on your distribution (testing versions of &name-debian; / &name-ubuntu;
) you might have to add this option to the call of configure <screen>#> ./configure --with-httpd-conf=/etc/apache2/conf-available</screen></para>
</note>
<para>Also with &name-postgres; you should not use the argument --enable-pgsq because it is not supported yet.</para>
<important>
<para>Compiling on Solaris might fail upon unresolved library dependencies on gethostbyname. In that case run this before running
configure:</para>
<screen> #> export LIBS=-lsocket -lnsl</screen>
</important>
<itemizedlist>
<listitem>
<para><emphasis role="bold">With SSL-Encryption:</emphasis></para>
<screen> #> ./configure --with-command-group=icinga-cmd --enable-idoutils --enable-ssl</screen>
</listitem>
<listitem>
<para><emphasis role="bold">With Oracle Database Support:</emphasis></para>
<para><screen> #> ./configure --with-command-group=icinga-cmd --enable-idoutils --enable-oracle </screen> If you didn't install
Oracle libraries to PATH, you can point configure there:</para>
<screen> #> ./configure --with-command-group=icinga-cmd \
--enable-idoutils --enable-oracle \
--with-oracle-lib=/path/to/instantclient</screen>
<para>If you didn't install ocilib to the default path (/usr/local) you can point configure to the lib/inc directories:</para>
<para><screen> #> ./configure --with-command-group=icinga-cmd \
--enable-idoutils --enable-oracle \
--with-ocilib-lib=/path/to/ocilib/lib \
--with-ocilib-inc=/path/to/ocilib/include</screen><note>
<para>If you want to change RDBM from Oracle to others, you need to recompile and reinstall &name-idoutils;!</para>
</note><screen> #> make distclean
#> ./configure --enable-idoutils</screen></para>
</listitem>
</itemizedlist>
</section>
<section xml:id="compileinstall">
<title>Compile and Install</title>
<para>Compile the &name-icinga; source code. There is also an extra option for &name-idoutils; (<emphasis>make idoutils</emphasis>) if
you need to recompile only this module. To see available options, only use "make".</para>
<screen> #> make all</screen>
<para>Install binaries, init script, sample config files, some eventhandlers, and set permissions on the external command directory.
<screen> #> make install
#> make install-init
#> make install-config
#> make install-eventhandlers
#> make install-commandmode
#> make install-idoutils </screen> or shorter <screen> #> make fullinstall
#> make install-config</screen></para>
<note>
<para>Starting with &name-icinga; 1.5.0 <literal>make install-config</literal> is NOT included in <literal>make fullinstall
</literal>anymore to avoid accidently overwriting of your config files.</para>
</note>
<note>
<para>Starting with &name-icinga; 1.7.0 <literal>make install-eventhandlers</literal> will install some event handler routines. To
prevent undesired behaviour it is only included when you use <literal>make fullinstall</literal>.</para>
</note>
<note>
<para>Install IDOUtils and applicable event broker modules only using the primary "make install" target. Do not manually copy and
overwrite the existing module as this will result in a segfault on icinga core which is using <filename>idomod.so</filename> directly
preventing usage of a temporary copy explicitly. This is useful for <link xlink:href="http://omdistro.org/">OMD.</link></para>
</note>
<note>
<para>The &name-icinga;-API served as a database abstraction layer written in PHP. Starting with &name-icinga; 1.5 it is replaced by
an internal database abstraction layer so &name-icinga;-API doesn't have to be installed anymore.</para>
</note>
<para>Don't start &name-icinga; yet - there's still more that needs to be done...</para>
</section>
<section xml:id="customiseconfig">
<title>Customise Configuration</title>
<para>Sample configuration files have been installed by using "make install-config" into <filename>&url-icinga-base;/etc/</filename>.
You'll need to make just one change before you proceed...</para>
<para>Edit the <emphasis>&url-icinga-base;/etc/objects/contacts.cfg</emphasis> config file with your favourite editor and change the
email address associated with the <emphasis>icingaadmin</emphasis> contact definition to the address you'd like to use for receiving
alerts.</para>
<screen> #> vi &url-icinga-base;/etc/objects/contacts.cfg</screen>
<screen> #> cd &url-icinga-base;/etc/
#> mv idomod.cfg-sample idomod.cfg
#> mv ido2db.cfg-sample ido2db.cfg</screen>
<para>If you want to enable SSL-encryption and you configured the &name-idoutils; with ./configure --enable-ssl, you have to change
idomod.cfg as follows:</para>
<programlisting> use_ssl=1
output_type=tcpsocket
output=127.0.0.1</programlisting>
<para>(don't forget to adjust the ip-address if your database isn't located on localhost) and ido2db.cfg in the following way:</para>
<programlisting> use_ssl=1
socket_type=tcp </programlisting>
<note>
<para>If SSL is enabled in ido2db but not in the different idomod clients - data from those instances will be lost - that's
guaranteed! SSL configuration has to be the same on all nodes!!!</para>
</note>
</section>
<section xml:id="enableidomod">
<title>Enable the idomod event broker module</title>
<important>
<para>Under normal circumstances the following module definition is already present in the <filename>modules</filename> subdirectory
so there is no need to edit the main config file <programlisting> define module{
module_name ido_mod
path &url-icinga-base;/lib/idomod.so
module_type neb
args config_file=&url-icinga-base;/etc/idomod.cfg
}</programlisting> This also means that a broker_module entry must not be enabled!</para>
</important>
</section>
<section xml:id="createidoutilsdatabase">
<title>Creation of Database and &name-idoutils;</title>
<note>
<para>If you just installed a new database system then you have to start the database server before you can create a database. In case
of MySQL you might use <code>/etc/init.d/mysqld start</code> (or <code>/etc/init.d/mysql</code>, depending on your
distribution).</para>
</note>
<itemizedlist>
<listitem>
<para><emphasis role="bold">&name-mysql;:</emphasis></para>
<para>Create Database, User, Grants:</para>
<screen> #> mysql -u root -p
mysql> CREATE DATABASE icinga;
GRANT USAGE ON icinga.* TO 'icinga'@'localhost'
IDENTIFIED BY 'icinga'
WITH MAX_QUERIES_PER_HOUR 0
MAX_CONNECTIONS_PER_HOUR 0
MAX_UPDATES_PER_HOUR 0;
GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE
ON icinga.* TO 'icinga'@'localhost';
FLUSH PRIVILEGES;
quit</screen>
<note>
<para>Starting with &name-icinga; 1.8 the icinga user additionally needs EXECUTE privileges.</para>
</note>
<para>Import database scheme for &name-mysql;:</para>
<screen> #> cd /path/to/icinga-src/module/idoutils/db/mysql
#> mysql -u root -p icinga < mysql.sql</screen>
<para>Edit the DB config file to customize &name-idoutils;</para>
<!-- <link xlink:href="http://www.phpmyadmin.net">phpMyAdmin</link> -->
<screen> #> vi &url-icinga-base;/etc/ido2db.cfg</screen>
<programlisting> db_servertype=mysql
db_port=3306
db_user=icinga
db_pass=icinga</programlisting>
</listitem>
<listitem>
<para><emphasis role="bold">&name-postgres;:</emphasis></para>
<para>Create database and User:</para>
<screen> #> su - postgres
$ psql
postgres=# CREATE USER icinga;
postgres=# ALTER USER icinga WITH PASSWORD 'icinga';
postgres=# CREATE DATABASE icinga;
postgres=# \q
$ createlang plpgsql icinga;</screen>
<para>Starting with &name-postgres; 9.1 "createlang ..." is obsolete.</para>
<itemizedlist>
<listitem>
<para><emphasis role="bold">&name-debian;:</emphasis></para>
<screen> #> vi /etc/postgresql/8.x/main/pg_hba.conf</screen>
</listitem>
<listitem>
<para><emphasis role="bold">&name-fedora;/&name-rhel;/&name-centos;:</emphasis></para>
<screen> #> vi /var/lib/pgsql/data/pg_hba.conf</screen>
</listitem>
</itemizedlist>
<para>Edit the config e.g. like this (local user must be trusted)</para>
<programlisting> # database administrative login by UNIX sockets
local all postgres ident
# TYPE DATABASE USER CIDR-ADDRESS METHOD
#icinga
local icinga icinga trust
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections
host all all 127.0.0.1/32 trust
# IPV6 local connections
host all all ::1/128 trust</programlisting>
<para>Reload and configure database scheme.</para>
<screen> #> /etc/init.d/postgresql-8.x reload</screen>
<screen> #> cd /path/to/icinga-src/module/idoutils/db/pgsql
#> psql -U icinga -d icinga < pgsql.sql</screen>
<para>Edit the DB config file to customize &name-idoutils;</para>
<screen> #> vi /usr/local/icinga/etc/ido2db.cfg</screen>
<programlisting> db_servertype=pgsql
db_port=5432
db_user=icinga
db_pass=icinga</programlisting>
</listitem>
<listitem>
<para><emphasis role="bold">Oracle:</emphasis></para>
<para>Create a database schema and username/password (refer to the &name-oracle; documentation at &url-oracle; or consult your DBA).
Import the database scheme with sqlplus (or your preferred method). Copy <filename>module/idoutils/db/oracle/*</filename> to
$ORACLE_HOME and edit <filename>icinga_defines.sql</filename> to match tablespace and user credential information.</para>
<screen> #> su - oracle
$> sqlplus dbuser/dbpass
SQL> @oracle.sql</screen>
<para>Edit the DB config file to customize IDOUtils. Remember that Oracle ignores the db host, instead point db_name to
//DBSERVER/DBNAME</para>
<screen> #> vi /usr/local/icinga/etc/ido2db.cfg</screen>
<programlisting> db_servertype=oracle
db_port=1521
db_user=icinga
db_pass=icinga</programlisting>
</listitem>
</itemizedlist>
</section>
<section xml:id="configclassicui">
<title>Configure the Classic Web Interface</title>
<para>&name-icinga; ships with the classic web interface ("the CGIs") which can be installed via</para>
<screen> #> make cgis
#> make install-cgis
#> make install-html</screen>
<para>If you are interested in the new &name-icinga; Web, please refer to <link linkend="icinga-web-scratch">Install &name-icinga; Web
Interface</link>.</para>
<para>Install the &name-icinga; classic web config file in the Apache conf.d directory.</para>
<screen> #> make install-webconf</screen>
<note>
<para>Starting with &name-icinga; 1.9 the command 'make install-webconf-auth' additionally installs the file
<filename>htpasswd.users</filename> which contains credentials for the user <emphasis>icingaadmin</emphasis> so you can skip the
following step. The password is <emphasis>icingaadmin</emphasis>.</para>
</note>
<note>
<para>Starting with Apache 2.4 (testing versions of &name-debian; / &name-ubuntu;) you have to enable the configuration <screen>#> a2enconf icinga</screen></para>
</note>
<para>Create an <emphasis>icingaadmin</emphasis> account for logging into the &name-icinga; classic web interface. Remember the password
you assign to this account - you'll need it later.</para>
<screen> #> htpasswd -c &url-icinga-base;/etc/htpasswd.users icingaadmin</screen>
<para>To change the password of an existing user or to add a new user, take this command:</para>
<screen> #> htpasswd &url-icinga-base;/etc/htpasswd.users <USERNAME></screen>
<note>
<para>Depending on your distribution/Apache-version you may have to use <emphasis>htpasswd2</emphasis> instead.</para>
</note>
<para>Reload/Restart Apache to make the new settings take effect.</para>
<itemizedlist>
<listitem>
<para><emphasis role="bold">&name-fedora;/&name-rhel;/&name-centos;:</emphasis></para>
<screen> #> service httpd restart</screen>
</listitem>
<listitem>
<para><emphasis role="bold">&name-ubuntu;/&name-opensuse;:</emphasis></para>
<screen> #> service apache2 restart</screen>
</listitem>
<listitem>
<para><emphasis role="bold">&name-debian;:</emphasis></para>
<screen> #> /etc/init.d/apache2 reload</screen>
</listitem>
</itemizedlist>
</section>
<section xml:id="compileinstallplugins">
<title>Compile and Install the &name-monitoringplug;</title>
<para>Extract the Nagios plugins source code tarball.</para>
<screen> #> cd /usr/src
#> tar xvzf nagios-plugins-&ver-nagiosplug;.tar.gz
#> cd nagios-plugins-&ver-nagiosplug; </screen>
<para>Compile and install the plugins by changing install directory to <filename>&url-icinga-base;</filename></para>
<screen> #> ./configure --prefix=&url-icinga-base; \
--with-cgiurl=/icinga/cgi-bin \
--with-nagios-user=icinga --with-nagios-group=icinga
#> make
#> make install </screen>
</section>
<section xml:id="selinuxsettings">
<title>Adjusting the SE&name-linux; settings</title>
<para>&name-rhel; and derived distributions like &name-fedora; and &name-centos; are shipped with activated SE&name-linux; (Security
Enhanced &name-linux;) running in "enforcing" mode. This may lead to "Internal Server Error" messages when you try to invoke the
&name-icinga;-CGIs.</para>
<para>Check if SE&name-linux; runs in enforcing mode</para>
<screen> #> getenforce</screen>
<para>Set SE&name-linux; in "permissive" mode</para>
<screen> #> setenforce 0</screen>
<para>To make this change permanent you have to adjust this setting in <emphasis>/etc/selinux/config</emphasis> and restart the
system.</para>
<para>Instead of deactivating SE&name-linux; or setting it into permissive mode you can use the following commands to run the CGIs in
enforcing/targeted mode:</para>
<screen> #> chcon -R -t httpd_sys_script_exec_t &url-icinga-base;/sbin/
#> chcon -R -t httpd_sys_content_t &url-icinga-base;/share/
#> chcon -t httpd_sys_script_rw_t &url-icinga-base;/var/rw/icinga.cmd</screen>
<para>Alternatively you may want to take a look at <link
xlink:href="http://www.linuxquestions.org/questions/blog/sag47-492023/selinux-and-icinga-34926/">http://www.linuxquestions.org/questions/blog/sag47-492023/selinux-and-icinga-34926/</link>.</para>
</section>
<section xml:id="startiido2dbandicinga">
<title>Start &name-idoutils; and &name-icinga;</title>
<para>&name-idoutils; must be started and running <emphasis>before</emphasis> &name-icinga; is started.</para>
<para><emphasis>Start &name-idoutils;:</emphasis></para>
<itemizedlist>
<listitem>
<para><emphasis role="bold"> &name-fedora;/&name-rhel;/&name-centos;/&name-ubuntu;/&name-opensuse;:</emphasis></para>
<screen> #> service ido2db start</screen>
</listitem>
<listitem>
<para><emphasis role="bold">&name-debian;:</emphasis></para>
<screen> #> /etc/init.d/ido2db start</screen>
</listitem>
</itemizedlist>
<para><emphasis>Stop &name-idoutils;:</emphasis></para>
<itemizedlist>
<listitem>
<para><emphasis role="bold"> &name-fedora;/&name-rhel;/&name-centos;/&name-ubuntu;/&name-opensuse;:</emphasis></para>
<screen> #> service ido2db stop</screen>
</listitem>
<listitem>
<para><emphasis role="bold">&name-debian;:</emphasis></para>
<screen> #> /etc/init.d/ido2db stop</screen>
</listitem>
</itemizedlist>
<para>Verify the sample &name-icinga; configuration files.</para>
<screen> #> &url-icinga-bin; -v &url-icinga-cfg; </screen>
<para>If there are no errors, start &name-icinga;.</para>
<itemizedlist>
<listitem>
<para><emphasis role="bold"> &name-fedora;/&name-rhel;/&name-centos;/&name-ubuntu;/&name-opensuse;:</emphasis></para>
<screen> #> service icinga start</screen>
</listitem>
<listitem>
<para><emphasis role="bold">&name-debian;:</emphasis></para>
<screen> #> /etc/init.d/icinga start</screen>
</listitem>
</itemizedlist>
</section>
<section xml:id="configstartup">
<title>Configure &name-icinga; Startup</title>
<para>Add &name-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).</para>
<itemizedlist>
<listitem>
<para><emphasis role="bold">&name-fedora;/&name-rhel;/&name-centos;/&name-opensuse;:</emphasis></para>
<screen> #> chkconfig --add icinga chkconfig icinga on</screen>
</listitem>
<listitem>
<para><emphasis role="bold">&name-debian;/&name-ubuntu;:</emphasis></para>
<screen> #> update-rc.d icinga defaults</screen>
</listitem>
</itemizedlist>
</section>
<section xml:id="loginclassicui">
<title>Login to the Classic Web Interface</title>
<para>You should now be able to access the &name-icinga; classic web interface at the URL below. You'll be prompted for the username (
<emphasis>icingaadmin</emphasis> ) and password you specified earlier. <screen> http://localhost/icinga/</screen> or <screen> http://yourdomain.com/icinga/ </screen></para>
<para>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 &name-icinga; to check all the services associated with your machine.</para>
</section>
<section xml:id="othermods">
<title>Other Modifications</title>
<para>Make sure your system's firewall rules are configured to allow access to the web server if you want to access the &name-icinga;
classic interface remotely.</para>
<screen> #> iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT</screen>
<para>Setting up your mail transfer agent (MTA) like exim, sendmail or postfix to allow &name-icinga; sending notification emails won't
be explained here. Please refer to the <link xlink:href="http://www.nagioswiki.org/">&name-nagioswiki;</link> for more resources.</para>
<para>There are several tweaks for the &name-idoutils; (former NDOUtils of &name-nagios;) available.</para>
</section>
<section xml:id="done">
<title><anchor xml:id="q_id-done"/>You're Done</title>
<para>Congratulations! You successfully installed &name-icinga; with &name-idoutils;. Your journey into monitoring has just begun.
You'll no doubt want to monitor more than just your local machine, so check out the chapter on <link linkend="ch02">"Getting
Started"</link> about "Monitoring ..."</para>
<indexterm zone="quickstart-idoutils">
<primary>Quickstart</primary>
<secondary>&name-icinga; with &name-idoutils;</secondary>
</indexterm>
<indexterm zone="q_id-timezone_support">
<primary>&name-idoutils; / timezone support</primary>
</indexterm>
</section>
</section>