Für den Download von Centreon gibt es zwei Möglichkeiten. Die gebräuchlichere besteht darin, das Archiv von der Centreon-Site zu laden. Alternativ kann man die neueste Version aus dem SVN erstellen.
Download des Archivs# cd /usr/local/src/ # wget http://download.centreon.com/index.php?id=103
Archiv entpacken und wechseln des Verzeichnisses:
# tar -xzf centreon-2.0.1.tar.gz # cd centreon-2.0.1
oder
Erstellung aus dem SVN# svn co http://svn.centreon.com/trunk/tools # cd tools # dos2unix makePackage.sh # chmod +x makePackage.sh
vor der Ausführung sollte die Shell im Script gegen #! /bin/bash ausgetauscht werden.
# ./makePackage.sh # cd centreon-2.0-SVN
Bevor es weitergeht, ein kleiner Trick, um unterschiedliche Wege auf benutzte Binaries wie z.B. nagios, ndomod zu vermeiden
# export PATH="$PATH:/usr/local/nagios/bin/"
Nun wird das Installationsscript aufgerufen. In diesem Script wird eine Reihe von Fragen gestellt, die den Umfang der Installation, verschiedene Abhängigkeiten usw. betreffen… Zwischendurch gibt es einige Kommentare zu verschiedenen Fragen, die im Verlauf gestellt werden.
# ./install.sh -i
Erster Schritt : prüfen von Voraussetzungen
###############################################################################
# #
# Centreon (www.centreon.com) #
# Thanks for using Centreon #
# #
# v2.0.1 #
# #
# infos@oreon-project.org #
# #
# Make sure you have installed and configured #
# sudo - sed - php - apache - rrdtool - mysql #
# #
###############################################################################
------------------------------------------------------------------------
Checking all needed binaries
------------------------------------------------------------------------
rm OK
cp OK
mv OK
/bin/chmod OK
/bin/chown OK
echo OK
more OK
mkdir OK
find OK
/bin/grep OK
/bin/cat OK
/bin/sed OK
Nun wird die Centreon Lizenz (GPL2) angezeigt. Wenn Sie diese nicht akzeptieren, wird das Setup beendet.
. . . . Do you accept GPL license ? [y/n], default to [n]: > y
Nun folgen Fragen nach den zu installierenden Modulen : Centreon Web interface, centcore (distributing module), Centreon-Plugins und Centreon Trap-Handler.
WARNUNG : bei Centreon 2.0 beta 1 können centcore und Centreon Trap-Handler nicht installiert werden selbst wenn die Frage mit „y“ beantwortet wird.
------------------------------------------------------------------------ Please choose what you want to install ------------------------------------------------------------------------ Do you want to install : Centreon Web Front [y/n], default to [n]: > y Do you want to install : Centreon CentCore [y/n], default to [n]: > y Do you want to install : Centreon Nagios Plugins [y/n], default to [n]: > y Do you want to install : Centreon Snmp Traps process [y/n], default to [n]: > y
Nun beginnt die Installation der verschiedenen Module, als Erstes Centreon Web, das Centreon-Interface.
------------------------------------------------------------------------
Start CentWeb Installation
------------------------------------------------------------------------
Where is your Centreon directory?
default to [/usr/local/centreon]
>
Wohin soll Centreon installiert werden? <Enter> übernimmt den angegebenen Default-Wert. Ansonsten können Sie einen anderen Pfad angeben. Wenn das Verzeichnis nicht existiert, folgt eine Abfrage, ob es angelegt werden soll, wie z.B.:
Do you want me to create this directory ? [/usr/local/centreon] [y/n], default to [n]: > y Path /usr/local/centreon OK
Nun folgt die Abfrage, wo die Journale/Logs von Centreon abgelegt werden sollen.
Where is your Centreon log directory default to [/usr/local/centreon/log/] > Do you want me to create this directory ? [/usr/local/centreon/log/] [y/n], default to [n]: > y Path /usr/local/centreon/log/ OK
Sehr wichtig: die Position der Konfigurationsdatei von Centreon.
ACHTUNG: Sie sollten den Pfad nur ändern, wenn Sie etwaige Probleme selbst finden können.
Where is your Centreon etc directory default to [/etc/centreon] > Do you want me to create this directory ? [/etc/centreon] [y/n], default to [n]: > y Path /etc/centreon OK Where is your Centreon generation_files directory? default to [/usr/local/centreon/] > Path /usr/local/centreon/ OK
Hier der Pfad zu RRDs.pm für centstorage und die Centreon-Plugins.
Where is installed RRD perl modules [RRDs.pm] default to [/usr/lib/perl5/RRDs.pm] > Path /usr/lib/perl5 OK /usr/bin/rrdtool OK /usr/bin/mail OK
Position von PEAR.php.
Where is PEAR [PEAR.php] default to [/usr/share/php/PEAR.php] >/usr/share/pear/PEAR.php Path /usr/share/php OK
Nun folgt eine Reihe von Fragen zu Nagios, die es erlauben, die einzelnen Teile von Nagios zu lokalisieren.
Where is installed Nagios ? default to [/usr/local/nagios/] > Path /usr/local/nagios/ OK Where is your nagios config file default to [/usr/local/nagios/etc//nagios.cfg] > Path /usr/local/nagios/etc OK Where is your Nagios var directory ? default to [/usr/local/nagios/var/] > Path /usr/local/nagios/var/ OK Where is your Nagios plugins (libexec) directory ? default to [/usr/local/nagios/libexec/] > Path /usr/local/nagios/libexec/ OK Where is your Nagios image directory ? default to [/usr/local/nagios/share/images/logos/] > Path /usr/local/nagios/share/images/logos/ OK /usr/local/nagios/bin/nagiostats OK p1_file : /usr/local/nagios/bin/p1.pl OK /usr/bin/php OK /usr/bin/perl OK Where is your CentPlugins Traps binary default to [/usr/local/centreon/bin] > Do you want me to create this directory ? [/usr/local/centreon/bin] [y/n], default to [n]: > y Path /usr/local/centreon/bin OK Finding Apache group : www-data Finding Apache user : www-data Finding Nagios user : nagios Finding Nagios group : nagios /usr/local/nagios/bin//ndomod-2x.o OK
Das ist verkehrt, denn für Nagios 3 wird ndomod-3x.o benötigt! Achtung: Benutzer und Gruppe des Web-Server-Users sind abhängig von der verwendeten Distribution!
Hier wird sudo konfiguriert, um Centreon die Rechte für bestimmte Änderungen zu geben (u.a. Neustart von Nagios)
------------------------------------------------------------------------
Configure Sudo
------------------------------------------------------------------------
Where is sudo configuration file
default to [/etc/sudoers]
>
/etc/sudoers OK
Nagios init script OK
Your sudo is not configure
Do you want I configure your sudo ? (WARNING)
[y/n], default to [n]:
> y
Configuring Sudo OK
Nun kommen einige Fragen, die die Konfiguration des Apache-Web-Servers betreffen.
------------------------------------------------------------------------ Configure Apache server ------------------------------------------------------------------------ Do you want to add Centreon Apache sub configuration file ? [y/n], default to [n]: > y Create '/etc/apache2/conf.d/centreon.conf' OK Configuring Apache OK Do you want to reload your Apache ? [y/n], default to [n]: > y Reloading Apache service OK
Weiter geht es mit verschiedenen Dingen
Preparing Centreon temporary files) Change right on /usr/local/centreon/log OK Change right on /etc/centreon OK Change right on /usr/local/nagios/share/images/logos OK Install nagios documentation OK In process Change macros for insertBaseConf.sql OK Change macros for php files OK Change right on /usr/local/nagios/etc OK Copy CentWeb in system directory Install CentWeb (web front of centreon) OK Install libraries OK Change macros for centreon.cron OK Install Centreon cron.d file OK Change macros for archiveDayLog OK Change macros for centAcl.php OK Install cron directory OK
Die Dokumentation bezieht sich leider immer noch auf Nagios 3.0.2 (und enthält damit nicht die Änderungen bzgl. der CGI-Sicherheitsüberlegungen, die im November 2008 hinzugekommen sind…).
Nun erfolgt die Prüfung und ggf. Installation von PEAR-Bibliotheken: eine ganze Reihe von Bibliotheken sind noch nicht vorhanden, werden aber automatisch nachinstalliert bzw. aktualisiert (wenn eine Internet-Verbindung vorhanden ist!). Andernfalls müssen Sie evtl. Pakete manuell installieren
.
Pear Modules Check PEAR modules PEAR 1.5.0 1.6.1 OK DB 1.7.6 NOK DB_DataObject 1.8.4 NOK DB_DataObject_FormBuilder 1.0.0RC4 NOK MDB2 2.0.0 NOK Date 1.4.6 NOK HTML_Common 1.2.2 NOK HTML_QuickForm 3.2.5 NOK HTML_QuickForm_advmultiselect 1.1.0 NOK HTML_Table 1.6.1 NOK Archive_Tar 1.1 1.3.2 OK Auth_SASL 1.0.1 NOK Console_Getopt 1.2 1.2.3 OK Image_GraphViz 1.1.0 NOK Net_SMTP 1.2.8 NOK Net_Socket 1.0.1 NOK Net_Traceroute 0.21 NOK Net_Ping 2.4.1 NOK Validate 0.6.2 NOK XML_RPC 1.4.5 NOK SOAP 0.10.1 NOK Log 1.9.11 NOK
Nach der Anzeige des aktuellen Versionsstandes kommt ggf. die Aufforderung, veraltete Libraries automatisch zu aktualisieren.
Do you want me to install/upgrade your PEAR modules [y/n], default to [y]: > Upgrading PEAR modules Installing PEAR modules DB 1.7.6 1.7.13 OK DB_DataObject 1.8.4 1.8.10 OK DB_DataObject_FormBuilder 1.0.0RC4 1.0.0RC7 OK MDB2 2.0.0 2.4.1 OK HTML_QuickForm_advmultiselect 1.1.0 1.5.1 OK HTML_Table 1.6.1 1.8.2 OK Auth_SASL 1.0.1 1.0.2 OK Image_GraphViz 1.1.0 1.2.1 OK Net_SMTP 1.2.8 1.3.2 OK Net_Traceroute 0.21 0.21.1 OK Net_Ping 2.4.1 2.4.4 OK Validate 0.6.2 0.8.2 OK XML_RPC 1.4.5 1.5.1 OK SOAP 0.10.1 0.12.0 OK Log 1.9.11 1.11.4 OK Check PEAR modules PEAR 1.5.0 1.6.1 OK DB 1.7.6 1.7.13 OK DB_DataObject 1.8.4 1.8.10 OK DB_DataObject_FormBuilder 1.0.0RC4 1.0.0RC7 OK MDB2 2.0.0 2.4.1 OK Date 1.4.6 1.4.7 OK HTML_Common 1.2.2 1.2.5 OK HTML_QuickForm 3.2.5 3.2.11 OK HTML_QuickForm_advmultiselect 1.1.0 1.5.1 OK HTML_Table 1.6.1 1.8.2 OK Archive_Tar 1.1 1.3.2 OK Auth_SASL 1.0.1 1.0.2 OK Console_Getopt 1.2 1.2.3 OK Image_GraphViz 1.1.0 1.2.1 OK Net_SMTP 1.2.8 1.3.2 OK Net_Socket 1.0.1 1.0.9 OK Net_Traceroute 0.21 0.21.1 OK Net_Ping 2.4.1 2.4.4 OK Validate 0.6.2 0.8.2 OK XML_RPC 1.4.5 1.5.1 OK SOAP 0.10.1 0.12.0 OK Log 1.9.11 1.11.4 OK All PEAR modules OK
Das Script kann fortfahren.
------------------------------------------------------------------------
Centreon Post Install
------------------------------------------------------------------------
Create /usr/local/centreon/www/install/install.conf.php OK
Create /etc/centreon/instCentWeb.conf OK
Wir kommen nun zur Installation von CentStorage, auch ODS genannt (Oreon Data Storage). Dieses Centreon-Modul erlaubt im Moment die Historisierung auf der Basis von RRD und MySQL. Außerdem erlaubt CentStorage die Erstellung von Graphen zur besseren Verfolgung der verschiedenen Überwachungsmetriken.
------------------------------------------------------------------------
Start CentStorage Installation
------------------------------------------------------------------------
Where is your Centreon Run Dir directory?
default to [/var/run/centreon]
>
Do you want me to create this directory ? [/var/run/centreon]
[y/n], default to [n]:
> y
Path /var/run/centreon OK
Where is your CentStorage binary directory
default to [/usr/local/centreon/bin]
>
Do you want me to create this directory ? [/usr/local/centreon/bin]
[y/n], default to [n]:
> y
Path /usr/local/centreon/bin OK
Where is your CentStorage RRD directory
default to [/var/lib/centreon]
>
Achtung: das Centron-lib-Verzeichnis sollte sich auf einer ständig verfügbaren Partition befinden, um keine Probleme zu riskieren. In diesem Verzeichnis befinden sich die RRDTools. Denken Sie außerdem daran, die MySQL-Daten an einem entsprechend dimensionierten Ort abzulegen. Die Logs und Performance-Daten brauchen ebenfalls viel Plattenplatz.
Do you want me to create this directory ? [/var/lib/centreon] [y/n], default to [n]: > y Path /var/lib/centreon OK Finding Nagios group : nagios Finding Nagios user : nagios Preparing Centreon temporary files) /tmp/centreon-setup exists, it will be moved... install www/install/createTablesCentstorage.sql OK Creating Centreon Directory '/var/lib/centreon/status' OK Creating Centreon Directory '/var/lib/centreon/metrics' OK Change macros for centstorage binary OK Install CentStorage binary OK Install library for centstorage OK Change right : /var/run/centreon OK Change macros for centstorage init script OK Do you want me to install CentStorage init script ? [y/n], default to [n]: > y CentStorage init script installed OK Do you want me to install CentStorage run level ? [y/n], default to [n]: > y Adding system startup for /etc/init.d/centstorage ... /etc/rc0.d/K30centstorage -> ../init.d/centstorage /etc/rc1.d/K30centstorage -> ../init.d/centstorage /etc/rc6.d/K30centstorage -> ../init.d/centstorage /etc/rc2.d/S40centstorage -> ../init.d/centstorage /etc/rc3.d/S40centstorage -> ../init.d/centstorage /etc/rc4.d/S40centstorage -> ../init.d/centstorage /etc/rc5.d/S40centstorage -> ../init.d/centstorage Change macros for logAnalyser OK Install logAnalyser OK Change macros for nagiosPerfTrace OK Install nagiosPerfTrace OK Change macros for centstorage.cron OK Install CentStorage cron OK Create /etc/centreon/instCentStorage.conf OK
Nun ist CentStorage installiert, es folgt CentCore:
------------------------------------------------------------------------ Start CentCore Installation ------------------------------------------------------------------------ Where is your CentCore binary directory default to [/usr/local/centreon/bin] > Path /usr/local/centreon/bin OK /usr/bin/ssh OK /usr/bin/scp OK Finding Nagios group : nagios Finding Nagios user : nagios Preparing Centreon temporary files) /tmp/centreon-setup exists, it will be moved... Change CentCore Macro OK Copy CentCore in binary directory OK Change right : /var/run/centreon OK Change right : /var/lib/centreon OK Replace CentCore init script Macro OK Do you want me to install CentCore init script ? [y/n], default to [n]: > y CentCore init script installed OK Do you want me to install CentCore run level ? [y/n], default to [n]: > y Adding system startup for /etc/init.d/centcore ... /etc/rc0.d/K30centcore -> ../init.d/centcore /etc/rc1.d/K30centcore -> ../init.d/centcore /etc/rc6.d/K30centcore -> ../init.d/centcore /etc/rc2.d/S40centcore -> ../init.d/centcore /etc/rc3.d/S40centcore -> ../init.d/centcore /etc/rc4.d/S40centcore -> ../init.d/centcore /etc/rc5.d/S40centcore -> ../init.d/centcore Create /etc/centreon/instCentCore.conf OK
Centreon bringt eigene Plugins mit:
------------------------------------------------------------------------ Start CentPlugins Installation ------------------------------------------------------------------------ Where is your CentPlugins lib directory default to [/var/lib/centreon/centplugins] > Do you want me to create this directory ? [/var/lib/centreon/centplugins] [y/n], default to [n]: > y Path /var/lib/centreon/centplugins OK Finding Nagios user : nagios Finding Nagios group : nagios Preparing Centreon temporary files) /tmp/centreon-setup exists, it will be moved... Change macros for CentPlugins OK Installing the plugins OK Change right on centreon.conf OK CentPlugins is installed
Es fehlt noch SNMPTT
------------------------------------------------------------------------ Start CentPlugins Traps Installation ------------------------------------------------------------------------ Where is your SNMP configuration directory default to [/etc/snmp] > /etc/snmp OK Where is your SNMPTT binaries directory default to [/usr/local/centreon/bin/] > /usr/local/centreon/bin/ OK Finding Nagios group : nagios Finding Apache user : www-data Preparing Centreon temporary files) /tmp/centreon-setup exists, it will be moved... Change macros for CentPluginsTraps OK Installing the plugins Trap binaries OK Backup all your snmp files OK Change macros for snmptrapd.conf OK Change macros for snmptt.ini OK Install : snmptrapd.conf OK Install : snmp.conf OK Install : snmptt.ini OK Install : snmptt OK Install : snmpttconvertmib OK Create /etc/centreon/instCentPlugins.conf OK
Hiermit ist das Installationsscript beendet. Es folgt die Web-Installation von Centreon.