Icinga

Installation des Icinga Webfrontends

Da noch kein Installer verfügbar ist, ist die Installation des Webinterfaces zugegebener Maßen noch etwas mühsam.

Hier findest Du eine Beispielkonfiguration, wenn Du andere Pfade und Verzeichnisse verwendest mußt Du den Code anpassen. Los geht's:

  1. Clone von git://git.icinga.org/icinga-web.git/ und verschiebe den git clone nach /var/www/icinga-web (in diesem Beispiel). Denk daran, dass der Pfad zu Deinem Webverzeichnis von Deiner Distribution abhängt:

     # mv icinga-web /var/www
  2. Clone auch die Icinga API und verschiebe sie nach /var/www/lib/icinga-api:

     # git clone git://git.icinga.org/icinga-api.git/
     # mv icinga-api /var/www/icinga-web/lib/
  3. Ändere den Besitzer des Web-Verzeichnisses auf den http-Benutzer:

    Fedora / RedHat / CentOS

     # chown -R apache:apache /var/www/icinga-web

    Ubuntu / Debian / openSuSE

     # chown -R www-data:www-data /var/www/icinga-web
  4. Anlegen der Datenbank und Setzen der Berechtigungen:

     # mysql -u root -p
     mysql> CREATE DATABASE icinga_web;
     mysql> GRANT ALL ON 'icinga_web.*' TO 'icinga_web'@'localhost' IDENTIFIED BY 'icinga_web';
     mysql> FLUSH PRIVILEGES;
     quit
  5. Importieren der Datenbank über folgende Dateien:

     # mysql -u root -p icinga_web < /var/www/icinga-web/etc/database/rescue_schema.sql
     # mysql -u root -p icinga_web < /var/www/icinga-web/etc/database/rescue_data.sql
  6. Editiere /var/www/icinga-web/app/config/databases.xml und setzte Deine Werte (ab Zeile 7):

        <database name="appkit_default" class="AgaviDoctrineDatabase">
           <ae:parameter name="dsn">mysql://icinga_web:icinga_web@127.0.0.1:3306/icinga_web</ae:parameter>
           <ae:parameter name="username">icinga_web</ae:parameter>
           <ae:parameter name="password">icinga_web</ae:parameter>
           <ae:parameter name="charset">utf8</ae:parameter>
           <ae:parameter name="manager_attributes">
                
              <ae:parameter name="MODEL_LOADING">CONSERVATIVE</ae:parameter>
           </ae:parameter>
           <ae:parameter name="load_models">%de.icinga.appkit.doctrine_model_path%</ae:parameter>
        </database>
  7. Editiere /var/www/icinga-web/app/config/icinga.xml und setze die Berechtigungen für den Zugriff auf die ido-Datenbank (ab Zeile 163):

     <parameter name="IcingaData">
         <parameter name="class">IcingaData</parameter>
         <parameter name="api_file">%core.root_dir%/lib/icinga-api/IcingaApi.php</parameter>
         <parameter name="api_type">IcingaApi::CONNECTION_IDO</parameter>
         <parameter name="config_type">mysql</parameter>
         <parameter name="config_host">127.0.0.1</parameter>
    
         <parameter name="config_port">3306</parameter>
         <parameter name="config_database">icinga</parameter>
    
         <parameter name="config_user">icinga</parameter>
         <parameter name="config_password">icinga</parameter>
               
         <parameter name="config_table_prefix">icinga_</parameter>
     </parameter>
    [Anmerkung] Anmerkung
    Vorher solltest Du die IDOUtils installiert und konfiguriert haben, (wie hier beschrieben:„Icinga-Schnellstart mit IDOUtils“ ) !
  8. Erstelle einen virtuellen Host:

     <VirtualHost *:80>
    
        ServerName icinga-web
    
        DocumentRoot /var/www/icinga-web/pub/
    
        DirectoryIndex index.php
    
        <Directory /var/www/icinga-web/pub/>
           Options -MultiViews -Indexes +FollowSymLinks
           AllowOverride none
           Order allow,deny
           Allow from all
    
           <IfModule mod_rewrite.c>
              RewriteEngine On
              RewriteBase /
    
              # If the requested URL does not exist (it's likely an agavi route),
              # pass it as path info to index.php, the Agavi dispatch script.
              RewriteRule ^$ index.php?/ [QSA,L]
              RewriteCond %{REQUEST_FILENAME} !-f
              RewriteCond %{REQUEST_FILENAME} !-d
              RewriteRule (.*) index.php?/$1 [QSA,L]
           </IfModule>
    
        </Directory>
    
        # deny something!
        <Location />
           Options -MultiViews -Indexes +FollowSymLinks
           Order allow,deny
           Allow from all
        </Location>
    
        # JS frameworks
        Alias /js/yui               /var/www/icinga-web/lib/yui
        Alias /js/swfobject         /var/www/icinga-web/lib/swfobject
        Alias /js/mootools          /var/www/icinga-web/lib/mootools
        Alias /js/jquery            /var/www/icinga-web/lib/jquery
        Alias /js/appkit            /var/www/icinga-web/lib/appkit/js
        Alias /js/gc-prettify       /var/www/icinga-web/lib/gc-prettify
        Alias /js/firebug           /var/www/icinga-web/lib/firebug
        Alias /js/ext3              /var/www/icinga-web/lib/ext3
    
        # Flash frameworks
        Alias /flash/flexchart      /var/www/icinga-web/lib/flexchart
    
        <IfDefine APACHE2>
           AcceptPathInfo On
        </IfDefine>
    
     </VirtualHost>
  9. Leere den Cache:

     # rm /var/www/icinga-web/app/cache/config/*.php
  10. Lade die Konfiguration des Webservers neu:

    Fedora/RedHat/CentOS

     # service httpd reload

    Ubuntu / openSuSE

     # /etc/init.d/apache2 reload

Viel Spaß und bitte gib uns Dein Feedback!! http://localhost/icinga-web