Die Installation und Konfiguration von Icinga ohne IDOUtils habe ich hier erklärt.
I. Requirements
- Apache
- GCC-Compiler
- C/C++ development libraries
- GD-Development-Libraries für statusmap- und trends-CGIs
- libdbi & libdbi-Treiber
Installation unter Debian 5:
r-o-f:~# aptitude install libjpeg62 libjpeg62-dev libpng12-0 libpng12-0-dev
r-o-f:~# aptitude install mysql-server mysql-client libdbi0 libdbi0-dev libdbd-mysql
II. Pakete herunterladen, validieren und entpacken
Download Icingia Core inkl. MD5 Sums:
r-o-f:~# http://sourceforge.net/projects/icinga/files/icinga/1.0/icinga-1.0.tar.gz.md5/download
validieren:
icinga-1.0.tar.gz: OK
entpacken:
III. Icinga Benutzer und Gruppe anlegen, Passwort definieren
Benutzer anlegen und Passwort definieren:
r-o-f:~# passwd icinga
Geben Sie ein neues UNIX-Passwort ein:
Geben Sie das neue UNIX-Passwort erneut ein:
passwd: Passwort erfolgreich geändert
Gruppe für Webinterface definieren und User hinzufügen:
r-o-f:~# usermod -a -G icinga-cmd icinga
r-o-f:~# usermod -a -G icinga-cmd www-data
IV. Kompilieren und Installieren
r-o-f:~# ./configure --with-command-group=icinga-cmd --enable-idoutils
...
*** Configuration summary for icinga-core 1.0 12-16-2009 ***:
General Options:
-------------------------
Icinga executable: icinga
Icinga user/group: icinga,icinga
Command user/group: icinga,icinga-cmd
Embedded Perl: no
Event Broker: yes
Build IDOUtils: yes
Install ${prefix}: /usr/local/icinga
Lock file: ${prefix}/var/icinga.lock
Check result directory: ${prefix}/var/spool/checkresults
Init directory: /etc/init.d
Apache conf.d directory: /etc/apache2/conf.d
Mail program: /usr/bin/mail
Host OS: linux-gnu
Web Interface Options:
------------------------
HTML URL: http://localhost/icinga/
CGI URL: http://localhost/icinga/cgi-bin/
Traceroute (used by WAP): /usr/sbin/traceroute
Review the options above for accuracy. If they look okay,
type 'make all' to compile the main program and CGIs.
!!! Please take care about the upgrade documentation !!!
...
r-o-f:~# make all
...
r-o-f:~/icinga-1.0# make fullinstall
Mit make fullinstall wird das Hauptprogramm, CGIs, API, HTML Files, Init-Scripte (/etc/init.d/) installiert und die Berechtigungen für das External-Command-Verzeichnis gesetzt.
Unter /usr/local/icinga/etc wird eine Beispielkonfiguration angelegt. Zusätzlich wird unter /etc/apache2/conf.d/icinga.conf die Konfiguration für das Web-Interface plaziert. Danach muss der Webserver neu gestartet werden.
V. User für Web-Interface definieren
New password:
Re-type new password:
Adding password for user root-on-fire
Mit dem -c Parameter legt htpasswd die htpasswd.users Datei neu an bzw. überschreibt ohne Nachfrage das alte File!
Weitere user können ganz einfach mit folgendem Befehl angelegt werden:
VI. Kontakt & Berechtigungen definieren
Icinga regelt die Benutzerberechtigung wie Nagios über die Kontaktgruppen. Der Web-User muss in einer der definierten Kontaktgruppen sein. Sonst kann er sich zwar einloggen, wird aber nichts sehen.
Ein neuer Kontakt kann in der /usr/local/icinga/etc/objects/contacts.cfg definiert werden:
contact_name root-on-fire
use generic-contact
alias ROOT ON FIRE
email icinga@root-on-fire.com
}
....
define contactgroup{
contactgroup_name admins
alias Icinga Administrators
members icingaadmin,root-on-fire
}
Detailierte Web-Berechtigungen werden in der /usr/local//icinga/etc/cgi.cfg definiert.
VII. MySQL Datenbank und IDOUtils konfigurieren
Datenbank, Benutzer und Berechtigungen definieren:
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 33
Server version: 5.0.51a-24+lenny3 (Debian)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> CREATE DATABASE icinga;
Query OK, 1 row affected (0.00 sec)
mysql> GRANT USAGE ON *.* TO 'icinga'@'localhost' IDENTIFIED BY 'icinga' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0;
Query OK, 0 rows affected (0.01 sec)
mysql> GRANT SELECT , INSERT , UPDATE , DELETE ON icinga.* TO 'icinga'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES ;
Query OK, 0 rows affected (0.00 sec)
Datenbankstruktur importieren:
IDOUtils Datenbank definieren:
r-o-f:/usr/local/icinga/etc# cp ido2db.cfg-sample ido2db.cfg
Folgende Optionen müssen in der /usr/local/icinga/etc/ido2db.cfg evtl. angepasst werden:
db_port=3306
db_user=icinga
db_pass=<PASSWORT>
VIII. Nagios Plugins herunterladen, kompilieren und installieren
r-o-f:~# tar xvzf nagios-plugins-1.4.14.tar.gz
r-o-f:~# cd ./nagios-plugins-1.4.14
r-o-f:~/nagios-plugins-1.4.14# ./configure --prefix=/usr/local/icinga --with-nagios-user=icinga
r-o-f:~/nagios-plugins-1.4.14# make
r-o-f:~/nagios-plugins-1.4.14# make install
IX. Icinga & IDOUtils starten
Konfiguration überprüfen:
....
....
Things look okay - No serious problems were detected during the pre-flight check
WICHTIG: IDOUtils muss vor Icinga gestartet werden!
Starting ido2db: done.
...
r-o-f:~# /etc/init.d/icinga start
Starting icinga: done.
X. Firewalleinstellungen
Zugriff auf Web-Interface von außen ermöglichen:
Regel prüfen:
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:www
....
XI. Screenshots
Quellen und weiterführende Links
Icinga Homepage: http://www.icinga.org/
Icinga Dokumentation: http://docs.icinga.org/
Icinga Demo: http://www.icinga.org/
Deutsche Nagios & Icinga Community: http://www.nagios-portal.org
Nagios Homepage: http://nagios.org/
Nagios-Plugins: http://nagios.org/download/plugins


Pingback: Happy Birthday Icinga - One year Icinga | ROOT ON FIRE
Pingback: Server und Dienste mit Icinga überwachen
Gut geschriebene Anleitung.
Ich habe dies hier entsprechen versucht, jedoch funktionierte IDO nicht.
Es fehlten noch 2 Punkte:
umbenenen der idomod.cfg-sample in idomod.cfg
und auskommentieren der Zeile
broker_module=/usr/local/icinga/bin/idomod.o config_file=/usr/local/icinga/etc/idomod.cfg