1 Zusammenfassung Passwörter Icinga 2 & Icinga Web 2 Installation c GeorgeW Februar 2014 1 Zusammenfassung Passwörter BEREICH USER PASSWORT Ubuntu root <pwd> Ubuntu installer system MySQL root icingadb MySQL icinga2-ido-mysql icingadb Icinga 2 ClassicUI icingaadmin icinga Icinga Web root password Apache2 icingaadmin icinga 2 Installation Icinga 2 2.1 Getting Started, Setting up Icinga 2 Online-Dokumentation: http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc 2.1.1 Repository Als Erstes wird das Icinga 2-Repository auf dem Host eingetragen: sudo add - apt - repository ppa : formorer / icinga This PPA provides Icinga 1, Icinga 2 and Icinga web Packages for Ubuntu. They are directly derived from the Debian Packages that I maintain within Debian. More info : https :// launchpad. net /~ formorer /+ archive / ubuntu / icinga sudo apt - get update 2.1.2 Installation Icinga 2 Core-Paket sudo apt - get install icinga2 The following NEW packages will be installed : icinga2 icinga2 - bin icinga2 - common icinga2 - doc libboost - program - options1.54.0 libboost - regex1.54.0 libboost - system1.54.0 libboost - thread1.54.0 libicu52 libyajl2 nagios - plugins - basic nagios - plugins - common Adding system - user for nagios enabling default icinga2 features Enabling feature checker. Make sure to restart Icinga 2 for these changes to take effect. Enabling feature notification. Make sure to restart Icinga 2 for these changes to take effect. Enabling feature mainlog. Make sure to restart Icinga 2 for these changes to take effect. * checking Icinga2 configuration [ OK ] * Starting icinga2 monitoring daemon icinga2 Icinga & Icinga Web 2 1
2 Installation Icinga 2 Bei der Icinga 2-Installation werden per default drei Features gesetzt: sudo icinga2 feature list Disabled features : api command compatlog debuglog gelf graphite icingastatus livestatus perfdata statusdata syslog Enabled features : checker mainlog notification 2.1.3 DB IDO provider module for MySQL Icinga 2 kann mit verschiedenen Datenbanken betrieben werden Sprung zur entsprechenden Stelle in der Dokumentation: http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/getting-started#conguring-db-ido Installation des MySQL-Datenbank-Servers sudo apt - get install mysql - server mysql - client The following NEW packages will be installed : libaio1 libdbd - mysql - perl libdbi - perl libhtml - template - perl libmysqlclient18 libterm - readkey - perl mysql - client mysql - client -5.5 mysql - client - core -5.5 mysql - common mysql - server mysql - server -5.5 mysql - server - core -5.5 Während der Installation wird das root-passwort der MySQL-Datenbank abgefragt. 2.1.4 Konguration der MySQL-IDO-Datenbank Punkt in der Online-Documentation: Conguring DB IDO MySQL sudo apt - get install icinga2 - ido - mysql The following NEW packages will be installed : dbconfig - common icinga2 - ido - mysql Das Icinga 2-ido-mysql-Feature wird aktiviert. Im nächsten Dialogfeld wird darauf verwiesen, dass das Icinga 2-ido-mysql-Paket eine kongurierte Datenbank benötigt. Es besteht die Möglichkeit, die Datenbank mit dbcong-common zu kongurieren, diese Option wird mit <YES> ausgewählt. Es wird das Passwort für den administrativen User (root) der MySQL-Datenbank abgefragt. Danach wird das Passwort für die Datenbank icinga2-ido-mysql festgelegt. 2.1.5 Setup der MySQL-Datenbank Punkt in der Online-Documentation: Setting up the MySQL database sudo mysql -u root -p mysql > CREATE DATABASE icinga ; GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga.* TO ' icinga '@ ' localhost ' IDENTIFIED BY ' icinga '; quit Anschlieÿend wird das Icinga 2-IDO-Datenbank-Schema importiert: sudo mysql -u root -p icinga < / usr / share / icinga2 -ido - mysql / schema / mysql. sql 2.1.6 Upgrade der MySQL-Datenbank Icinga hat die Version 2.2.4 (07.02.2015), keine Upgrades nötig! Icinga & Icinga Web 2 2
3 Installation der User-Interfaces 2.1.7 Installation des IDO-MySQL-Moduls Punkt in der Online-Documentation: Installing the IDO MySQL module In einem ersten Schritt sind in der Datei ido-mysql.conf die Rechte richtig zu setzen. Die Kontrolle hat aber gezeigt, dass das Passwort bereits richtig gesetzt ist. Der User icinga2-ido-mysql wird aber in die Passwort-Übersicht übernommen. Aktivieren des IDO-MySQL-Moduls: sudo icinga2 feature enable ido - mysql Enabling feature ido - mysql. Make sure to restart Icinga 2 for these changes to take effect. sudo service icinga2 restart sudo icinga2 feature list Disabled features : api command compatlog debuglog gelf graphite icingastatus livestatus perfdata statusdata syslog Enabled features : checker ido - mysql mainlog notification 3 Installation der User-Interfaces Nachdem die IDO-Datenbank eingerichtet wurde, wird in der Dokumentation wieder nach oben gesprungen, um den nächsten Installationspunkt zu nden. Icinga 2 kann mit verschiedenen User-Interfaces betrieben werden: Icinga Classic UI 1.x, Icinga Web 1.x und Icinga Web 2.x. Siehe auch den Punkt in der Online-Documentation: Setting up Icinga 2 User Interfaces: http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/getting-started#setting-up-icinga2-userinterfaces In der Dokumentation werden für die drei User-Interfaces folgende Voraussetzungen gefordert: Webserver, User Credentials und geöneter Firewallport (TCP/80). Der letzt genannte Punkt ist in einem oenen lokalen Netz nicht relevant und kann als gegeben betrachtet werden. 3.1 Installation Webserver Als Webserver wird Apache 2 eingesetzt. Auf der Wiki-Seite von Thomas Krenn (http://www.thomas-krenn.com/de/wiki/installation_von_icinga2_unter_ubuntu_server_14.04) wird ausgeführt, dass vier Pakete hierfür benötigt werden, diese werden im nächsten Schritt installiert: sudo apt - get install apache2 apache2 - utils libapache2 - mod - php5 The following NEW packages will be installed : apache2 apache2 - bin apache2 - data apache2 - utils libapache2 - mod - php5 libapr1 libaprutil1 libaprutil1 - dbd - sqlite3 libaprutil1 - ldap php5 - cli php5 - common php5 - json php5 - readline ssl - cert Icinga & Icinga Web 2 3
3 Installation der User-Interfaces Bei der Konguration von Icinga 1 wurden noch weitere Apache-Module benötigt, diese werden deshalb an dieser Stelle mit installiert: sudo service apache2 restart 3.2 Icinga 2 Classic UI 1.x Die klassische Icinga 2-Oberäche wird über das Paket icinga2-classicui installiert, danach kann sofort darauf zugegrien werden. Bei der Installation wird das Passwort für den administrativen Benutzer icingaadmin festgelegt. sudo apt - get install icinga2 - classicui Am Ende der Installation werden drei weitere Icinga 2-Features aktiviert: compatlog, statusdata und command. Aufruf der Icinga 2 Classic UI: http :// icinga2 / icinga2 - classicui / FUNKTIONIERT!!! 3.3 Icinga Web 1.x Auch dieses User-Interface wird nach der Beschreibung von TK installiert: http :// www. thomas - krenn. com / de / wiki / Installation \ _von \ _Icinga2 \ _unter \ _Ubuntu \ _Server \ _14.04 Unterpunkt Icinga Web Hinzufügen eines weiteren Repositories: sudo add -apt - repository ppa : formorer / icinga - web sudo apt - get update Installation von Icinga Web: Da für Icinga 1 Web der MySQL-Server und eine IDO-Datenbank benötigt wird, ist zu prüfen, ob die zwei Pakete mysql-server und icinga2-ido-mysql installiert sind, ansonsten sind diese noch zu installieren. Gleichzeitig muss das Feature ido-mysql aktiviert sein. (Pakete und Feature sind vorhanden, noch prüfen, wann diese installiert wurden!!!) sudo apt - get install -- no - install - recommends icinga - web The following NEW packages will be installed : icinga - web libxslt1.1 php5 php5 - gd php5 - mysql php5 - xsl Bei der Installation dieser Pakete wird nach der Datenbank-Konguration mit dbcong-common gefragt, dies mit NO beantworten, da die Datenbank nachfolgend manuell angelegt werden soll. Anschlieÿend wird die Datenbank manuell angelegt: sudo mysql -u root -p mysql > CREATE DATABASE icinga_ web ; mysql > GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga_ web.* TO ' icinga_web '@ ' localhost ' IDENTIFIED BY ' icinga_web '; mysql > quit Anschlieÿend wird das Datenbankschema eingespielt: sudo mysql -u root -p icinga_ web < / usr / share / dbconfig - common / data / icinga - web / install / mysql Icinga & Icinga Web 2 4
3 Installation der User-Interfaces Es sind keine Upgrades in /usr/share/dbcong-common/data/icinga-web/upgrade/mysql vorhanden! Datenbankberechtigungen für User icinga: sudo mysql -u root -p mysql > GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga2idomysql.* TO ' icinga '@ ' localhost ' IDENTIFIED BY 'icinga '; mysql > quit Zugri auf MySQL-Datenbank aktivieren: sudo vim / etc / icinga - web / conf.d/ databases. xml In Zeilen 24, 47, 59 und 79 den Kommentar löschen!!! Mysql-Datenbank ändern (Zeile 61): sudo vim / etc / icinga - web / conf.d/ databases. xml <ae : parameter name =" dsn "> mysql :// icinga : icinga@ localhost :3306/ icinga2idomysql </ ae : parameter > Command Pipe ändern (Zeile 34): sudo vim / etc / icinga - web / conf.d/ access. xml < resource name =" icinga_pipe " >/ var / run / icinga2 / cmd / icinga2.cmd </ resource > Cache leeren: sudo / usr / lib / icinga - web / bin / clearcache. sh Dienste neu starten: sudo service mysql restart \&\& sudo service icinga2 restart \&\& sudo service apache2 restart Reinstall der Datenbank für Icinga Web mit YES beantworten: sudo dpkg - reconfigure icinga - web Since you are reconfiguring icinga - web, you may also want to reinstall the database which it uses. If you wish to reinstall the database for icinga - web, you should select this option. If you do not wish to do so ( if you are reconfiguring the package for unrelated reasons ), you should not select this option. Reinstall database for icinga - web? <Yes > The icinga - web package can be configured to use one of several database types. Below, you will be presented with the available choices. Database type to be used by icinga - web : <mysql > By default, icinga - web will be configured to use a MySQL server through a local unix socket ( this provides the best performance ). However, if you would like to connect with a different method, or to a different server entirely, select an option from the choices below. Connection method for MySQL database of icinga - web : < unix socket > Please provide the name of the account with which this package should perform administrative actions. This user is the one which is able to create new database users. Icinga & Icinga Web 2 5
3 Installation der User-Interfaces For MySQL, this is almost always " root ". Note that this is NOT the same as the UNIX login " root ". Name of the database ' s administrative user : <root > Please provide the password for the administrative account with which this package should create its MySQL database and user. Password of the database 's administrative user : ******** ( icingadb ) Please provide a username for icinga - web to register with the database server. A user is not necessarily the same as a system login, especially if the database is on a remote server. This is the user which will own the database, tables and other objects to be created by this installation. This user will have complete freedom to insert, change or delete data in the database. username for icinga - web : <icinga -web > Please provide a password for icinga - web to register with the database server. If left blank, a random password will be generated. MySQL application password for icinga - web : ******** ( icingadb ) Password confirmation : ******** ( icingadb ) Please provide a name for the database to be used by icinga - web. database name for icinga - web : < icinga_web > Please provide the password for the user " root " in Icinga ' s web interface. This is the password you need to access the web interface with the default administrative user. After login, you will be able to create new users and set their permissions. Icinga new web administrative password : ******** ( password ) Please enter the same root password again to verify that you have typed it correctly. Re - enter password to verify : ******** ( password ) An error occurred while installing the database : mysql said : ERROR 1050 (42 S01 ) at line 8: Table ' cronk ' already exists Next step for database installation : abort retry retry ( skip questions ) XXX ignore XXX Ignore gewählt!!! Icinga Web kann aufgerufen werden: http://icinga2/icinga-web FUNKTIONIERT!!! Icinga & Icinga Web 2 6
4 Icinga Web 2.x 4 Icinga Web 2.x Google: icinga web 2 ubuntu http://www.monitoring-portal.org/wbb/index.php?page=thread&threadid=31274 https://github.com/icinga/icingaweb2 https://github.com/icinga/icingaweb2/blob/master/doc/installation.md Nach erneuter Durchsicht der Links soll die Installation mit den Hinweisen aus diesem Link fortgesetzt werden: https://github.com/icinga/icingaweb2/blob/master/doc/installation.md Punkt Installing Requirements > OK! Punkt Installing Icinga Web 2 from Package > noch nicht verfügbar Punkt Installing Icinga Web 2 from Source 4.1 Installation von Icinga CLI und git sudo apt - get update sudo apt - get install icli Installation von git und Clonen der Source von Icinga Web 2: sudo apt - get install git sudo git clone git :// git. icinga. org / icingaweb2. git Die Source wurde nach icingaweb2 geclont, genauer nach /home/installer/icingaweb2. Anschlieÿend wird das komplette Icinga Web 2-Verzeichnis nach /usr/share/icingaweb verschoben: cd / home / installer sudo mv icingaweb2 / usr / share / icingaweb2 cd / usr / share / icingaweb2./ bin / icingacli setup config webserver apache -- document - root \ / usr / share / icingaweb2 / public Alias / icingaweb2 "/ usr / share / icingaweb2 / public " < Directory "/ usr / share / icingaweb2 / public "> Options SymLinksIfOwnerMatch AllowOverride None < IfModule mod_ authz_ core.c > # Apache 2.4 < RequireAll > Require all granted </ RequireAll > </ IfModule > < IfModule! mod_authz_core.c > # Apache 2.2 Order allow, deny Allow from all </ IfModule > SetEnv ICINGAWEB_ CONFIGDIR "/ etc / icingaweb2 " EnableSendfile Off < IfModule mod_ rewrite.c > RewriteEngine on RewriteBase / icingaweb2 / Icinga & Icinga Web 2 7
4 Icinga Web 2.x RewriteCond %{ REQUEST_ FILENAME } -s [ OR ] RewriteCond %{ REQUEST_ FILENAME } -l [ OR ] RewriteCond %{ REQUEST_ FILENAME } -d RewriteRule ^.* $ - [NC,L] RewriteRule ^.* $ index. php [NC,L] </ IfModule > < IfModule! mod_rewrite.c > DirectoryIndex error_ norewrite. html ErrorDocument 404 / error_ norewrite. html </ IfModule > </ Directory > Diese Ausgabe ist in eine Konguationsdatei /etc/apache2/sites-available/icingaweb2.conf zu speichern. Der Dateiname ist dabei frei wählbar. Anschlieÿend ist die Website noch zu aktivieren. sudo vim / etc / apache2 / sites - available / icingaweb2. conf sudo a2ensite icingaweb2 sudo service apache2 reload Aufruf von Icinga Web 2 über http://icinga2/icingaweb2 Die Startseite wird angezeigt, zusammen mit einer Login-Fehlermeldung: It appears that you did not congure Icinga Web 2 yet so it's not possible to log in without any dened authentication method. Please dene a authentication method by following the instructions in the documentation or by using our web-based setup-wizard. Abbildung 1: Icinga Web2 - Initialbildschirm Vor dem Aufruf des Setup-Wizards muss in die MySQL-Datenbank noch das Schema für Icinga Web 2 eingespielt werden. Die Schemata benden sich in /usr/share/icingaweb2/etc/schema/. ll / usr / share / icingaweb2 / etc / schema / -rw -r --r -- 1 root root 1626 Feb 2 22:12 mysql. schema. sql -rw -r --r -- 1 root root 2223 Feb 2 22:12 pgsql. schema. sql sudo mysql -u root -p icinga_web < / usr / share / icingaweb2 / etc / schema / mysql. schema. sql Icinga & Icinga Web 2 8
4 Icinga Web 2.x sudo service mysql restart \&\& sudo service icinga2 restart \ \&\& sudo service apache2 restart 4.2 Aufruf des webbasierten Icinga Web 2 Wizards In der angezeigten Fehlermeldung führt ein Link zum Icinga Web 2 Setup-Wizard: http://icinga2/icingaweb2/setup 4.2.1 Seite: Welcome to the conguration of Icinga Web 2! Um den Wizard ausführen zu können, ist ein Token einzugeben. Dieser ist zum jetzigen Zeitpunkt nicht verfügbar, auf der Seite wird aber eine Vorgehensweise angegeben, verwendet wird hier die Variante IcingaCLI installed: sudo / usr / share / icingaweb2 / bin / icingacli setup config directory -- group www - data ; Successfully created configuration directory / etc / icingaweb2 sudo / usr / share / icingaweb2 / bin / icingacli setup token create ; The newly generated setup token is : b3b340fb541570c0 Mit dem so generierten Token erfolgt die Anmeldung am Icinga Web 2 Wizard. Auf der nächsten Übersichtsseite (nach der Modulauswahl) wird die Verfügbarkeit von Komponenten und Modulen angezeigt: Zum jetzigen Zeitpunkt fehlen noch: Default Timezone PHP-Module: LDAP PHP-Module: INTL PHP-Module: Imagick PHP-Module: PDO-PostgreSQL Da eine MySQL-Datenbank verwendet wird, wird das Module PDO-PostgreSQL nicht weiter behandelt. 4.2.2 Fehler: Default Timezone sudo vim /etc/php5/apache2/php.ini Setzen der Zeitzone in Zeile 879: date.timezone = Europe/Berlin sudo service apache2 restart Nach einem Refresh des Webservers und der Webseite ändert sich der Status von Default Timezone in Grün. 4.2.3 Fehler: PHP Module: LDAP, INTL, Imagick sudo apt - get install php5 - ldap php5 - intl php5 - imagick sudo service apache2 restart Nach einem Refresh des Webservers und der Webseite ändert sich der Status in Grün. Fehler: PHP Module: PDO-PostgreSQL: Dieser Fehler wird nicht weiter bearbeitet, da auf dem Server eine MySQL-Datenbank im Einsatz ist. 4.2.4 Icinga Web 2 Wizard - Seite 2/3 Authentizierung: Database Voreinstellungen: Database Icinga & Icinga Web 2 9
4 Icinga Web 2.x 4.2.5 Icinga Web 2 Wizard Seite Parameter Wert Vorgabewert Datenbank-Ressourcen Ressourcen-Name icingaweb_db x Datenbank-Typ MySQL x Host localhost x Port 3306 x Datenbank-Name icinga_web Benutzername root Passwort icingadb Authentication Backend Backendname icingaweb2 Administration Administrativer Account für Icinga Web 2 Benutzername icingaadmin2 Passwort icinga2 Applikationskonguration Logging-Type Syslog x Logging-Level Error x Applikations-Präx icingaweb2 x Zusammenfassung x Nachfolgend wird das Monitoring-Modul von Icinga Web 2 im Setup-Wizard konguriert. Seite Parameter Wert Vorgabewert Monitoring Backend Backend-Name icinga x Backend-Type IDO x Monitoring IDO Ressource Ressourcen-Name icinga_ido x Datenbank-Typ MySQL x Host localhost x Port 3306 x Datenbank-Name icinga Benutzer-Name root Passwort icingadb Monitoring Instanz Instanz-Name icinga x Instanz-Type Local Command File x Command File /var/run/icinga2/cmd/icinga2.cmd x Monitoring Sicherheit Protected Custom Variables *pw*,*pass*,community x Zusammenfassung x Der Setup-Wizard ist damit abgeschlossen, es wird eine Zusammenfassung der eingerichteten Kongurationsdateien angezeigt. Von hier aus führt ein Link zum Login für Icinga Web 2 und zur Homepage. Aufruf von Icinga Web 2 über http://icinga2/icingaweb2 UND HIER IST DAS PROBLEM!!! Anmeldung möglich, aber die Weboberäche zeigt keine Daten an!!! Icinga & Icinga Web 2 10