Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| computer:icinga:icinga_mit_oracle_10g_xe [2011/03/09 19:14] – [Kompilierung] christian | computer:icinga:icinga_mit_oracle_10g_xe [2012/06/17 22:51] (aktuell) – gelöscht christian | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | Icinga kann dank einer Erweiterung namens **IDOutils** auf vielen verschiedenen Datenbanksystemen betrieben werden. Neben MySQL und PostgreSQL kann es auch auf Oracle verwendet werden - besonders interessant ist dies für Firmen, die aus supportechnischen Gründen auf Oracle setzen. | ||
| - | ======Szenario====== | ||
| - | Dieses Tutorial widmet sich der Installation eines Oracle 10g Database Express- und Icinga-Monitoringsystems. Als Betriebssystem wird CentOS 5.5 verwendet, welches binärkompatibel zu RedHat Enterprise Linux ist. Folglich dürfte dieser Leitfaden auch beim Nachbau auf Produktivsystemen mit RHEL und Oracle Database Standard unterstützen. | ||
| - | |||
| - | =====Voraussetzungen===== | ||
| - | Für dieses Szenario wird benötigt: | ||
| - | * Ein- oder Mehrkern-Coprozessor | ||
| - | * Host oder virtuelle Maschine mit 2 GB Arbeitsspeicher | ||
| - | * Mindestens 1 GB Swap | ||
| - | * Mindestens 20 GB Speicherplatz | ||
| - | * CentOS 5.5-Abbild oder -Medium | ||
| - | * Oracle Database 10g Database Express Edition Installationspakete | ||
| - | * Oracle InstantClient und Linux SDK | ||
| - | ======Datenbank====== | ||
| - | Zuerst wird die Oracle 10g Database Express Edition Software installiert - diese Version ist gegenüber der Standard-Version von Oracle Database abgespeckt und für Evaluationen, | ||
| - | |||
| - | Ich setze vorraus, dass CentOS 5.5 bereits installiert wurde. Benötigt wird das Paket **oracle-xe-univ-10.2*.i386.rpm** von der Oracle-Webseite. | ||
| - | |||
| - | <note tip> | ||
| - | |||
| - | Nachdem das Paket heruntergeladen wurde, kann es mittels **yum** installiert werden - danach wird die Datenbank konfiguriert: | ||
| - | < | ||
| - | ... | ||
| - | Is this ok [y/N]: y | ||
| - | ... | ||
| - | Complete! | ||
| - | |||
| - | # / | ||
| - | |||
| - | Oracle Database 10g Express Edition Configuration | ||
| - | ------------------------------------------------- | ||
| - | This will configure on-boot properties of Oracle Database 10g Express | ||
| - | Edition. | ||
| - | be starting upon system boot, the ports it will use, and the passwords that | ||
| - | will be used for database accounts. | ||
| - | Ctrl-C will abort. | ||
| - | |||
| - | Specify the HTTP port that will be used for Oracle Application Express [8080]: | ||
| - | |||
| - | Specify a port that will be used for the database listener [1521]: | ||
| - | |||
| - | Specify a password to be used for database accounts. | ||
| - | password will be used for SYS and SYSTEM. | ||
| - | different passwords for each database account. | ||
| - | initial configuration: | ||
| - | Confirm the password: | ||
| - | |||
| - | Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]: | ||
| - | |||
| - | Starting Oracle Net Listener...Done | ||
| - | Configuring Database...Done | ||
| - | Starting Oracle Database 10g Express Edition Instance...Done | ||
| - | Installation Completed Successfully. | ||
| - | To access the Database Home Page go to " | ||
| - | </ | ||
| - | |||
| - | < | ||
| - | |||
| - | < | ||
| - | # source / | ||
| - | # sqlplus | ||
| - | |||
| - | SQL*Plus: Release 10.2.0.1.0 - Production on Mi Dez 29 15:12:48 2010 | ||
| - | |||
| - | Copyright (c) 1982, 2005, Oracle. | ||
| - | |||
| - | Benutzernamen eingeben: system | ||
| - | Kennwort eingeben: | ||
| - | |||
| - | Verbunden mit: | ||
| - | Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production | ||
| - | |||
| - | SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE); | ||
| - | |||
| - | PL/ | ||
| - | |||
| - | SQL> exit | ||
| - | Verbindung zu Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production beendet | ||
| - | </ | ||
| - | |||
| - | Die Firewall, falls verwendet, muss angepasst werden, damit Zugriff auf TCP-Port 8080 möglich ist: | ||
| - | < | ||
| - | # iptables -A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT | ||
| - | # service iptables save | ||
| - | # service iptables restart | ||
| - | </ | ||
| - | |||
| - | Nach einem Neustart des Dienstes steht der externe Zugriff zur Verfügung: | ||
| - | < | ||
| - | </ | ||
| - | ======Icinga====== | ||
| - | |||
| - | =====Vorbereitungen===== | ||
| - | Bevor Icinga kompiliert wird, bedarf es noch einiger Vorbereitungen: | ||
| - | ====Pakete und Abhängigkeiten==== | ||
| - | Es müssen noch einige Bibliotheken installiert werden, die bei der Kompilierung benötigt werden: | ||
| - | |||
| - | < | ||
| - | # yum install gcc gcc-c++ httpd gd gd-devel glibc glibc-common libjpeg libjpeg-devel libpng libpng-devel openldap-devel php net-snmp net-snmp-devel net-snmp-utils openssl openssl-devel | ||
| - | </ | ||
| - | |||
| - | <note tip>Die Pakete **net-snmp-devel** und **net-snmp-utils** werden benötigt, falls Icinga NMNP-Dienste verwenden können soll. Icinga kann Informationen verschlüsselt übertragen - hierfür werden die Pakete **openssl** und **openssl-devel** benötigt.</ | ||
| - | ====SELinux==== | ||
| - | SELinux behindert Icinga in seiner Funktionsweise, | ||
| - | |||
| - | < | ||
| - | # setenforce 0 | ||
| - | # nano / | ||
| - | ... | ||
| - | SELINUX=disabled | ||
| - | </ | ||
| - | |||
| - | < | ||
| - | |||
| - | ====Oracle-Bibliothek==== | ||
| - | Damit Icinga auf der Oracle-Datenbank agieren kann, wird eine Bibliothek namens **ocilib** benötigt. Der Quellcode dieser Bibliothek kann kostenfrei auf der [[http:// | ||
| - | |||
| - | ===Instant-Client und SDK=== | ||
| - | Damit die benötigte Oracle-Bibliothek kompiliert werden kann, werden der Oracle Instant Client und das Linux SDK benötigt. Beides erhält man ebenfalls kostenfrei [[http:// | ||
| - | |||
| - | < | ||
| - | ~# yum localinstall --nogpgcheck oracle-instantclient11*basic*.rpm | ||
| - | ~# yum localinstall --nogpgcheck oracle-instantclient11.2-devel*.rpm | ||
| - | ~# yum localinstall --nogpgcheck oracle-instantclient11.2-sqlplus*.rpm | ||
| - | ~# yum localinstall --nogpgcheck oracle-instantclient11.2-tools*.rpm | ||
| - | ~# unzip instantclient-sdk-linux32*.zip | ||
| - | </ | ||
| - | |||
| - | <note tip>Je nach verwendeten Architektur muss der Dateiname des SDK-Archivs ggf. angepasst werden</ | ||
| - | |||
| - | ===Kompilierung=== | ||
| - | Wenn der Oracle Instantclient installiert und das SDK entpackt wurden, kann das muntere Kompilieren beginnen: | ||
| - | |||
| - | < | ||
| - | ~# tar xvfz ocilib-3.8.1-gnu.tar.gz | ||
| - | ~# cd ocilib-3.8.1 | ||
| - | ~# export LD_LIBRARY_PATH="/ | ||
| - | ~# source / | ||
| - | ocilib-3.8.1# | ||
| - | ocilib-3.8.1# | ||
| - | ocilib-3.8.1# | ||
| - | </ | ||
| - | |||
| - | <note important> | ||
| - | |||
| - | Im Archiv befindet sich auch ein Beispielprogramm, | ||
| - | |||
| - | < | ||
| - | ocilib-3.8.1# | ||
| - | demo# make -f Makefile_demo demo | ||
| - | gcc -I/ | ||
| - | gcc -L/ | ||
| - | demo# ./demo xe system < | ||
| - | ... | ||
| - | 0 errors | ||
| - | |||
| - | 0 warnings | ||
| - | |||
| - | |||
| - | press any key to exit... | ||
| - | </ | ||
| - | |||
| - | =====Kompilierung===== | ||
| - | Zunächst werden eine Benutzerkonto und eine zugehörige Gruppe für den Icinga-Daemon erstellt - für die Bedienung des Dienstes über die Weboberfläche wird eine dedizierte Gruppe erstellt - dieser Gruppe wird das Apache-Benutzerkonto hinzugefügt. | ||
| - | |||
| - | < | ||
| - | # useradd -m icinga | ||
| - | # passwd icinga | ||
| - | ... | ||
| - | # groupadd icinga | ||
| - | # groupadd icinga-cmd | ||
| - | # usermod -a -G icinga-cmd icinga | ||
| - | # usermod -a -G icinga-cmd apache | ||
| - | </ | ||
| - | |||
| - | < | ||
| - | # ln -s / | ||
| - | # ldd / | ||
| - | linux-gate.so.1 => (0x00e17000) | ||
| - | libclntsh.so.11.1 => / | ||
| - | libc.so.6 => / | ||
| - | libnnz11.so => not found | ||
| - | libdl.so.2 => / | ||
| - | libm.so.6 => / | ||
| - | libpthread.so.0 => / | ||
| - | libnsl.so.1 => / | ||
| - | libaio.so.1 => / | ||
| - | / | ||
| - | | ||
| - | | ||
| - | TODO: LINK ENTFERNEN | ||
| - | | ||
| - | # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/ | ||
| - | #export LD_LIBRARY_PATH="/ | ||
| - | |||
| - | cd demo | ||
| - | make -f Makefile_demo demo | ||
| - | gcc -L/ | ||
| - | |||
| - | ./demo | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | *** Configuration summary for icinga-core 1.3.0 02-16-2011 ***: | ||
| - | |||
| - | | ||
| - | | ||
| - | Icinga executable: | ||
| - | Icinga user/ | ||
| - | | ||
| - | Embedded Perl: no | ||
| - | Event Broker: | ||
| - | Build IDOUtils: | ||
| - | Install ${prefix}: | ||
| - | Lock file: ${prefix}/ | ||
| - | Check result directory: | ||
| - | Init directory: | ||
| - | Apache conf.d directory: | ||
| - | Mail program: | ||
| - | Host OS: linux-gnu | ||
| - | |||
| - | Web Interface Options: | ||
| - | | ||
| - | HTML URL: http:// | ||
| - | CGI URL: http:// | ||
| - | | ||
| - | |||
| - | |||
| - | Review the options above for accuracy. | ||
| - | type 'make all' to compile the main program and CGIs. | ||
| - | |||
| - | |||
| - | !!! Please take care about the upgrade documentation !!! | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | | ||
| - | </ | ||
| - | |||
| - | GIT | ||
| - | < | ||
| - | # cd /usr/src | ||
| - | # w3m http:// | ||
| - | # tar xvfz icinga-1.3.0.tar.gz | ||
| - | ... | ||
| - | # cd icinga-1.3.0 | ||
| - | # ./configure --with-command-group=icinga-cmd --enable-idoutils --enable-ssl --enable-oracle --with-ocilib-inc=/ | ||
| - | ==> INSERT | ||
| - | </ | ||
| - | |||
| - | |||
| - | < | ||
| - | icinga-1.3.0 # make | ||
| - | ... | ||
| - | icinga-1.3.0 # make fullinstall | ||
| - | ... | ||
| - | icinga-1.3.0 # make install-config | ||
| - | ... | ||
| - | icinga-1.3.0 # cp module/ | ||
| - | </ | ||
| - | |||
| - | =====Konfiguration===== | ||
| - | < | ||
| - | icinga-1.3.0 # cd / | ||
| - | etc # nano objects/ | ||
| - | |||
| - | etc # mv idomod.cfg-sample idomod.cfg | ||
| - | etc # mv ido2db.cfg-sample ido2db.cfg | ||
| - | etc # nano idomod.cfg | ||
| - | ... | ||
| - | use_ssl=1 | ||
| - | output_type=tcpsocket | ||
| - | output=127.0.0.1 | ||
| - | ... | ||
| - | etc # nano ido2db.cfg | ||
| - | ... | ||
| - | use_ssl=1 | ||
| - | socket_type=tcp | ||
| - | ... | ||
| - | db_servertype=oracle | ||
| - | db_port=1521 | ||
| - | db_user=icinga | ||
| - | db_pass=test123 | ||
| - | ... | ||
| - | etc # nano / | ||
| - | ... | ||
| - | broker_module=/ | ||
| - | ... | ||
| - | etc # su - oracle | ||
| - | su - oracle | ||
| - | -bash-3.2$ cd $ORACLE_HOME | ||
| - | -bash-3.2$ source / | ||
| - | -bash-3.2$ sqlplus Benutzer/ | ||
| - | SQL> @oracle.sql | ||
| - | ... | ||
| - | SQL> quit | ||
| - | -bash-3.2$ exit | ||
| - | |||
| - | etc # cd / | ||
| - | icinga-1.3.0 # make cgis | ||
| - | icinga-1.3.0 # make install-cgis | ||
| - | icinga-1.3.0 # make install-html | ||
| - | icinga-1.3.0 # make install-webconf | ||
| - | icinga-1.3.0 # htpasswd -c / | ||
| - | New password: | ||
| - | Re-type new password: | ||
| - | Adding password for user icingaadmin | ||
| - | icinga-1.3.0 # service httpd restart | ||
| - | </ | ||
| - | |||
| - | < | ||
| - | |||
| - | < | ||
| - | # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT | ||
| - | # service iptables save | ||
| - | # service iptables restart | ||
| - | </ | ||
| - | |||
| - | |||
| - | < | ||
| - | # cd /usr/src | ||
| - | src # links http:// | ||
| - | src # tar xvfz nagios-plugins-1.4.15.tar.gz | ||
| - | src # cd nagios-plugins-1.4.15 | ||
| - | nagios-plugins-1.4.15 # ./configure --prefix=/ | ||
| - | ... | ||
| - | nagios-plugins-1.4.15 # make | ||
| - | ... | ||
| - | nagios-plugins-1.4.15 # make install | ||
| - | ... | ||
| - | </ | ||
| - | |||
| - | < | ||
| - | # ln -s / | ||
| - | # service ido2db start | ||
| - | ido2db PID not running. Removing lockfile. | ||
| - | Starting ido2db: done. | ||
| - | # chkconfig --add ido2db | ||
| - | # chkconfig ido2db on | ||
| - | # / | ||
| - | ... | ||
| - | Things look okay - No serious problems were detected during the pre-flight check | ||
| - | # service icinga start | ||
| - | # chkconfig --add icinga | ||
| - | # chkconfig icinga on | ||
| - | </ | ||
| - | |||
| - | |||
| - | |||
| - | ======Internetverweise====== | ||
| - | * Icinga-Projektseite: | ||
| - | * Icinga-Handbuch (//Version 1.3.0//): http:// | ||
| - | * Oracle Database 10g Express Edition: http:// | ||
| - | * orclib/ | ||
| - | * Oracle Instant Client und SDK: http:// | ||