Dies ist eine alte Version des Dokuments!
Icinga Web 2 - Einbinden von NagVis zur graphischen Visualisierung - Installation und Konfiguration unter CentOS 7.x
Mit NagVis steht ein sehr mächtiges Werkzeug zur Verfügung, wenn es darum geht IT-Landschaften in Übersichtsgraphiken mit Echtzeitdaten zur Verfügung zu stellen.
Aber werfen für die genauere Beschreibung einfach einen Blick in die sehr gute deutsche NagVis-Dokumentation.
… NagVis kann benutzt werden, um Nagios-Daten zu visualisieren, d.h. IT-Prozesse wie ein Mail-System oder eine Netzwerkinfrastruktur darzustellen. Durch die Benutzung von Daten, die von einem Backend zur Verfügung gestellt werden, kann NagVis die Objekte auf den Maps in regelmäßigen Intervallen aktualisieren. Diese Maps ermöglichen es, die Objekte auf verschiedene Arten zu arrangieren:
- physikalisch (z.B. alle Hosts in einem Rack/Raum/Bereich)
- logisch (z.B. alle Applikations-Server)
- geographisch (z.B. alle Hosts in einem Land)
- Geschäftsprozesse (z.B. alle Hosts/Services, die in einen Prozess involviert sind)
…
Installations-/Konfigurationsvorbereitungen
Vor der Installation und Konfiguration von NagVis und Icinga Web 2 bereiten wir unseren Icinga2-Monitoring-Server vor. Als erstes installieren wir noch benötigte RPM-Pakete, die zur Installation und Betrieb von NagVis benötigt werden.
# yum install rsync php-mbstring graphviz graphviz-php graphviz-gd
Damit später NagVis aktuelle Daten von unserem Icinga 2-Daemon anzeigen kann, muss NagVis auf aktuelle Daten von Icinga 2 zugreifen können. Hierzu nutzen wir das Icinga2-Feature livestatus. Mit dem folgenden Befehlsaufruf können wir überprüfen, ob die Funktion bereits aktiviert wurde.
# icinga2 feature list
Disabled features: compatlog debuglog gelf icingastatus opentsdb perfdata statusdata syslog Enabled features: api checker command graphite ido-mysql livestatus mainlog notification
Ist die Funktion livestatus noch nicht aktiviert, holen wir dies noch nach.
# icinga2 feature enable livestatus
Enabling feature livestatus. Make sure to restart Icinga 2 for these changes to take effect.
Zur Aktivierung führen wir nun noch einen Restart des Icinga 2 Daemon durch.
# systemctl restart icinga2
Installation
NagVis
Im ersten Schritt werden wir NagVis installieren. Haben wir schon eine bestehende NagVis-Installation können wir den Schritt überspringen und gleich mit der Konfiguration von NagVis beginnen.
Als erstes werden wir die RPM-Pakete installieren, die für den Betrieb von NagVis benötigt werden.
# yum install rsync php-mbstring graphviz graphviz-php graphviz-gd
Nun holen wir uns das aktuelle tar.gz-Paket von der Nagvis-Homepage auf unseren Monitoring-Server.
# wget http://www.nagvis.org/share/nagvis-1.8.2.tar.gz
Anschließend entpacken wir das Archiv zur weiteren Installation.
# tar -zxf nagvis-1.8.2.tar.gz -C /usr/local/src
Im erstelten Verzeichnis finden wir eine Datei mit weiteren Installations-Informationen.
# less /usr/local/src/nagvis-1.8.2/INSTALL
============================================================================== NagVis 1.8 Quick Installation Instructions ============================================================================== Author: Andreas Husch, Lars Michelsen Document Version: 0.8 Date: 2013-07-20 Applies to: NagVis 1.4 - 1.8 ============================================================================== 1. Download NagVis -------------------- Get NagVis. The latest release can be found at www.nagvis.org. 2. Unpack NagVis -------------------- Unpack the archive to a temporary place (for example /tmp). And change to that directory > tar xvzf nagvis-1.*.tar.gz /tmp > cd /tmp/nagvis-1.* 3. Make installer executable -------------------- The installer is located in the root directory of the NagVis package. The installer has to be made executable before you can use it. > chmod +x install.sh 4. Run installer -------------------- Now you can run the installer. > ./install.sh Following the instructions of the installer should lead you to a working installation of NagVis. If you experience any problems please let us know. 5. Cleanup -------------------- You can remove the sources after installation. > rm -rf /tmp/nagvis-1.* 6. Additional information -------------------- 6.1 Command line parameters ------------------ For details about the command line parameters call the installer with the "-h" option. ============================================================================== Have fun using NagVis and please report bugs! ==============================================================================
Icinga Web 2 Modul
# wget https://github.com/divetoh/icingaweb2-module-nagvis/archive/master.zip
# unzip master.zip -d /usr/share/icingaweb2/modules
# mv /usr/share/icingaweb2/modules/icingaweb2-module-nagvis-master/ /usr/share/icingaweb2/modules/nagvis
NagVis 1.8 Installation
# /usr/local/src/nagvis-1.8.2/install.sh -s icinga
+------------------------------------------------------------------------------+ | Welcome to NagVis Installer 1.8.2 | +------------------------------------------------------------------------------+ | This script is built to facilitate the NagVis installation and update | | procedure for you. The installer has been tested on the following systems: | | - Debian, since Etch (4.0) | | - Ubuntu, since Hardy (8.04) | | - SuSE Linux Enterprise Server 10 and 11 | | | | Similar distributions to the ones mentioned above should work as well. | | That (hopefully) includes RedHat, Fedora, CentOS, OpenSuSE | | | | If you experience any problems using these or other distributions, please | | report that to the NagVis team. | +------------------------------------------------------------------------------+ | Do you want to proceed? [y]: y +------------------------------------------------------------------------------+ | Starting installation of NagVis 1.8.2 | +------------------------------------------------------------------------------+ | | +--- Checking for tools -------------------------------------------------------+ | Using packet manager /bin/rpm found | | | +--- Checking paths -----------------------------------------------------------+ | Please enter the path to the icinga base directory [/usr/sbin/icinga2]: /usr/share/icinga2 | icinga path /usr/share/icinga2 found | | Please enter the path to NagVis base [/usr/sbin/icinga2/nagvis]: /usr/share/icinga2/nagvis | | +--- Checking prerequisites ---------------------------------------------------+ | PHP 5.4 found | | PHP Module: gd php found | | PHP Module: mbstring php found | | PHP Module: gettext compiled_in found | | PHP Module: session compiled_in found | | PHP Module: xml php found | | PHP Module: pdo php found | | Apache mod_php found | | Checking Backends. (Available: mklivestatus,ndo2db,ido2db) | | Do you want to use backend mklivestatus? [y]: y | Do you want to use backend ndo2db? [n]: n | Do you want to use backend ido2db? [n]: n | Livestatus Socket (/var/run/icinga2/cmd/livestatus) found | | PHP Module: sockets compiled_in found | | Graphviz 2.30 found | | Graphviz Module dot 2.30.1 found | | Graphviz Module neato 2.30.1 found | | Graphviz Module twopi 2.30.1 found | | Graphviz Module circo 2.30.1 found | | Graphviz Module fdp 2.30.1 found | | SQLite 3.7 found | | | +--- Trying to detect Apache settings -----------------------------------------+ | Please enter the web path to NagVis [/nagvis]: | Please enter the name of the web-server user [apache]: | Please enter the name of the web-server group [apache]: | create Apache config file [y]: y | | +--- Checking for existing NagVis ---------------------------------------------+ | | +------------------------------------------------------------------------------+ | Summary | +------------------------------------------------------------------------------+ | NagVis home will be: /usr/share/icinga2/nagvis | | Owner of NagVis files will be: apache | | Group of NagVis files will be: apache | | Path to Apache config dir is: /etc/httpd/conf.d | | Apache config will be created: yes | | | | Installation mode: install | | | | Do you really want to continue? [y]: y +------------------------------------------------------------------------------+ | Starting installation | +------------------------------------------------------------------------------+ | Creating directory /usr/share/icinga2/nagvis... done | | Creating directory /usr/share/icinga2/nagvis/var... done | | Creating directory /usr/share/icinga2/nagvis/var/tmpl/cache... done | | Creating directory /usr/share/icinga2/nagvis/var/tmpl/compile... done | | Creating directory /usr/share/icinga2/nagvis/share/var... done | | Copying files to /usr/share/icinga2/nagvis... done | | Creating directory /usr/share/icinga2/nagvis/etc/profiles... done | | Creating main configuration file... done | | adding base="/usr/share/icinga2/nagvis" done | | adding htmlcgi=/icinga/cgi-bin done | | adding dbname=icinga done | | adding dbprefix=icinga_ done | | Adding MKLivestatus Backend... done | | Adding webserver group to file_group... done | | Creating web configuration file... done | | Setting permissions for web configuration file... done | | | | | | | +--- Setting permissions... ---------------------------------------------------+ | /usr/share/icinga2/nagvis/etc/nagvis.ini.php-sample done | | /usr/share/icinga2/nagvis/etc done | | /usr/share/icinga2/nagvis/etc/maps done | | /usr/share/icinga2/nagvis/etc/maps/* done | | /usr/share/icinga2/nagvis/etc/geomap done | | /usr/share/icinga2/nagvis/etc/geomap/* done | | /usr/share/icinga2/nagvis/etc/profiles done | | /usr/share/icinga2/nagvis/share/userfiles/images/maps done | | /usr/share/icinga2/nagvis/share/userfiles/images/maps/* done | | /usr/share/icinga2/nagvis/share/userfiles/images/shapes done | | /usr/share/icinga2/nagvis/share/userfiles/images/shapes/* done | | /usr/share/icinga2/nagvis/var done | | /usr/share/icinga2/nagvis/var/* done | | /usr/share/icinga2/nagvis/var/tmpl done | | /usr/share/icinga2/nagvis/var/tmpl/cache done | | /usr/share/icinga2/nagvis/var/tmpl/compile done | | /usr/share/icinga2/nagvis/share/var done | | | +------------------------------------------------------------------------------+ | Installation complete | | | | You can safely remove this source directory. | | | | For later update/upgrade you may use this command to have a faster update: | | /usr/local/src/nagvis-1.8.2/install.sh -n /usr/share/icinga2 -p /usr/share/icinga2/nagvis -l "unix:/var/run/icinga2/cmd/livestatus" -b mklivestatus -u apache -g apache -w /etc/httpd/conf.d -a y | | | What to do next? | | - Read the documentation | | - Maybe you want to edit the main configuration file? | | Its location is: /usr/share/icinga2/nagvis/etc/nagvis.ini.php | | - Configure NagVis via browser | | <http://localhost/nagvis/config.php> | | - Initial admin credentials: | | Username: admin | | Password: admin | +------------------------------------------------------------------------------+
# ./install.sh -n /usr/share/icinga2 -p /usr/share/icinga2/nagvis -l "unix:/var/run/icinga2/cmd/livestatus" -b mklivestatus -u apache -g apache -w /etc/httpd/conf.d -a y
+------------------------------------------------------------------------------+ | Welcome to NagVis Installer 1.8.2 | +------------------------------------------------------------------------------+ | This script is built to facilitate the NagVis installation and update | | procedure for you. The installer has been tested on the following systems: | | - Debian, since Etch (4.0) | | - Ubuntu, since Hardy (8.04) | | - SuSE Linux Enterprise Server 10 and 11 | | | | Similar distributions to the ones mentioned above should work as well. | | That (hopefully) includes RedHat, Fedora, CentOS, OpenSuSE | | | | If you experience any problems using these or other distributions, please | | report that to the NagVis team. | +------------------------------------------------------------------------------+ | Do you want to proceed? [y]: y +------------------------------------------------------------------------------+ | Starting installation of NagVis 1.8.2 | +------------------------------------------------------------------------------+ | | +--- Checking for tools -------------------------------------------------------+ | Using packet manager /bin/rpm found | | | +--- Checking paths -----------------------------------------------------------+ | Please enter the path to the nagios base directory [/usr/share/icinga2]: | nagios path /usr/share/icinga2 found | | Please enter the path to NagVis base [/usr/share/icinga2/nagvis]: /usr/share/nagvis | | +--- Checking prerequisites ---------------------------------------------------+ | PHP 5.4 found | | PHP Module: gd php found | | PHP Module: mbstring php found | | PHP Module: gettext compiled_in found | | PHP Module: session compiled_in found | | PHP Module: xml php found | | PHP Module: pdo php found | | Apache mod_php found | | Do you want to update the backend configuration? [n]: y | Checking Backends. (Available: mklivestatus,ndo2db,ido2db) | | Do you want to use backend mklivestatus? [y]: y | Do you want to use backend ndo2db? [n]: n | Do you want to use backend ido2db? [n]: n | Livestatus Socket (/var/run/icinga2/cmd/livestatus) found | | PHP Module: sockets compiled_in found | | Graphviz 2.30 found | | Graphviz Module dot 2.30.1 found | | Graphviz Module neato 2.30.1 found | | Graphviz Module twopi 2.30.1 found | | Graphviz Module circo 2.30.1 found | | Graphviz Module fdp 2.30.1 found | | SQLite 3.7 found | | | +--- Trying to detect Apache settings -----------------------------------------+ | Please enter the web path to NagVis [/nagvis]: | Please enter the name of the web-server user [apache]: | Please enter the name of the web-server group [apache]: | create Apache config file [y]: n | | +--- Checking for existing NagVis ---------------------------------------------+ | NagVis 1.8.2 found | | Do you want the installer to update your config files when possible? [y]: y | Remove backup directory after successful installation? [n]: n | | +------------------------------------------------------------------------------+ | Summary | +------------------------------------------------------------------------------+ | NagVis home will be: /usr/share/nagvis | | Owner of NagVis files will be: apache | | Group of NagVis files will be: apache | | Path to Apache config dir is: /etc/httpd/conf.d | | Apache config will be created: NO | | | | Installation mode: update | | Old version: 1.8.2 | | New version: 1.8.2 | | Backup directory: /usr/share/nagvis.old-2015-04-20_10:09:12 | | | | Note: The current NagVis directory will be moved to the backup directory. | | The backup directory will be NOT removed after successful installation | | Your configuration files will be copied. | | The configuration files will be updated if possible. | | | | Do you really want to continue? [y]: y +------------------------------------------------------------------------------+ | Starting installation | +------------------------------------------------------------------------------+ | Moving old NagVis to /usr/share/nagvis.old-2015-04-20_10:09:12.. done | | Creating directory /usr/share/nagvis... done | | Creating directory /usr/share/nagvis/var... done | | Creating directory /usr/share/nagvis/var/tmpl/cache... done | | Creating directory /usr/share/nagvis/var/tmpl/compile... done | | Creating directory /usr/share/nagvis/share/var... done | | Copying files to /usr/share/nagvis... done | | Creating directory /usr/share/nagvis/etc/profiles... done | | Creating main configuration file... done | | adding base="/usr/share/nagvis" done | | Adding MKLivestatus Backend... done | | Adding webserver group to file_group... done | | *** creation of /etc/httpd/conf.d/nagvis.conf will be SKIPPED ! | | | | Restoring main configuration file(s)... done | | Restoring custom map configuration files... done | | Restoring custom geomap source files... done | | Restoring user configuration files... done | | Restoring conf.d/ configuration files... done | | Restoring custom map images... done | | Restoring custom gadget images... done | | Restoring custom iconsets... done | | Restoring custom shapes... done | | Restoring custom templates... done | | Restoring custom template images... done | | Restoring custom gadgets... done | | Restoring custom scripts... done | | Restoring auth database file... done | | Restoring custom stylesheets... done | | | +------------------------------------------------------------------------------+ | Handling changed/removed options | +------------------------------------------------------------------------------+ | Removing allowedforconfig option from main config... done | | Removing autoupdatefreq option from main config... done | | Removing htmlwuijs option from main config... done | | Removing wuijs option from main config... done | | Removing showautomaps option from main config... done | | Removing usegdlibs option from main config... done | | Removing displayheader option from main config... done | | Removing hovertimeout option from main config... done | | Removing allowed_for_config option from map configs... done | | Removing allowed_user from map configs... done | | Removing hover_timeout from map configs... done | | Removing usegdlibs from map configs... done | +------------------------------------------------------------------------------+ | HINT: Please check the changelog or the documentation for changes which | | affect your configuration files | | | +--- Setting permissions... ---------------------------------------------------+ | /usr/share/nagvis/etc/nagvis.ini.php-sample done | | /usr/share/nagvis/etc done | | /usr/share/nagvis/etc/maps done | | /usr/share/nagvis/etc/maps/* done | | /usr/share/nagvis/etc/geomap done | | /usr/share/nagvis/etc/geomap/* done | | /usr/share/nagvis/etc/profiles done | | /usr/share/nagvis/etc/profiles/* done | | /usr/share/nagvis/share/userfiles/images/maps done | | /usr/share/nagvis/share/userfiles/images/maps/* done | | /usr/share/nagvis/share/userfiles/images/shapes done | | /usr/share/nagvis/share/userfiles/images/shapes/* done | | /usr/share/nagvis/var done | | /usr/share/nagvis/var/* done | | /usr/share/nagvis/var/tmpl done | | /usr/share/nagvis/var/tmpl/cache done | | /usr/share/nagvis/var/tmpl/compile done | | /usr/share/nagvis/share/var done | | | +------------------------------------------------------------------------------+ | Installation complete | | | | You can safely remove this source directory. | | | | For later update/upgrade you may use this command to have a faster update: | | ./install.sh -n /usr/share/icinga2 -p /usr/share/nagvis -l "unix:/var/run/icinga2/cmd/livestatus" -b mklivestatus -u apache -g apache -w /etc/httpd/conf.d -a n | | | What to do next? | | - Read the documentation | | - Maybe you want to edit the main configuration file? | | Its location is: /usr/share/nagvis/etc/nagvis.ini.php | | - Configure NagVis via browser | | <http://localhost/nagvis/config.php> | | - Initial admin credentials: | | Username: admin | | Password: admin | +------------------------------------------------------------------------------+
# ./install.sh -n /usr/share/icinga2 -p /usr/share/nagvis -l "unix:/var/run/icinga2/cmd/livestatus" -b mklivestatus -u apache -g apache -w /etc/httpd/conf.d -a n
+------------------------------------------------------------------------------+ | Welcome to NagVis Installer 1.8.2 | +------------------------------------------------------------------------------+ | This script is built to facilitate the NagVis installation and update | | procedure for you. The installer has been tested on the following systems: | | - Debian, since Etch (4.0) | | - Ubuntu, since Hardy (8.04) | | - SuSE Linux Enterprise Server 10 and 11 | | | | Similar distributions to the ones mentioned above should work as well. | | That (hopefully) includes RedHat, Fedora, CentOS, OpenSuSE | | | | If you experience any problems using these or other distributions, please | | report that to the NagVis team. | +------------------------------------------------------------------------------+ | Do you want to proceed? [y]: y +------------------------------------------------------------------------------+ | Starting installation of NagVis 1.8.2 | +------------------------------------------------------------------------------+ | | +--- Checking for tools -------------------------------------------------------+ | Using packet manager /bin/rpm found | | | +--- Checking paths -----------------------------------------------------------+ | Please enter the path to the nagios base directory [/usr/share/icinga2]: | nagios path /usr/share/icinga2 found | | Please enter the path to NagVis base [/usr/share/nagvis]: | | +--- Checking prerequisites ---------------------------------------------------+ | PHP 5.4 found | | PHP Module: gd php found | | PHP Module: mbstring php found | | PHP Module: gettext compiled_in found | | PHP Module: session compiled_in found | | PHP Module: xml php found | | PHP Module: pdo php found | | Apache mod_php found | | Checking Backends. (Available: mklivestatus,ndo2db,ido2db) | | Do you want to use backend mklivestatus? [y]: | Do you want to use backend ndo2db? [n]: | Do you want to use backend ido2db? [n]: | Livestatus Socket (/var/run/icinga2/cmd/livestatus) found | | PHP Module: sockets compiled_in found | | Graphviz 2.30 found | | Graphviz Module dot 2.30.1 found | | Graphviz Module neato 2.30.1 found | | Graphviz Module twopi 2.30.1 found | | Graphviz Module circo 2.30.1 found | | Graphviz Module fdp 2.30.1 found | | SQLite 3.7 found | | | +--- Trying to detect Apache settings -----------------------------------------+ | Please enter the web path to NagVis [/nagvis]: | Please enter the name of the web-server user [apache]: | Please enter the name of the web-server group [apache]: | create Apache config file [n]: | | +--- Checking for existing NagVis ---------------------------------------------+ | | +------------------------------------------------------------------------------+ | Summary | +------------------------------------------------------------------------------+ | NagVis home will be: /usr/share/nagvis | | Owner of NagVis files will be: apache | | Group of NagVis files will be: apache | | Path to Apache config dir is: /etc/httpd/conf.d | | Apache config will be created: NO | | | | Installation mode: install | | | | Do you really want to continue? [y]: +------------------------------------------------------------------------------+ | Starting installation | +------------------------------------------------------------------------------+ | Creating directory /usr/share/nagvis... done | | Creating directory /usr/share/nagvis/var... done | | Creating directory /usr/share/nagvis/var/tmpl/cache... done | | Creating directory /usr/share/nagvis/var/tmpl/compile... done | | Creating directory /usr/share/nagvis/share/var... done | | Copying files to /usr/share/nagvis... done | | Creating directory /usr/share/nagvis/etc/profiles... done | | Creating main configuration file... done | | adding base="/usr/share/nagvis" done | | Adding MKLivestatus Backend... done | | Adding webserver group to file_group... done | | *** creation of /etc/httpd/conf.d/nagvis.conf will be SKIPPED ! | | | | | | | +--- Setting permissions... ---------------------------------------------------+ | /usr/share/nagvis/etc/nagvis.ini.php-sample done | | /usr/share/nagvis/etc done | | /usr/share/nagvis/etc/maps done | | /usr/share/nagvis/etc/maps/* done | | /usr/share/nagvis/etc/geomap done | | /usr/share/nagvis/etc/geomap/* done | | /usr/share/nagvis/etc/profiles done | | /usr/share/nagvis/share/userfiles/images/maps done | | /usr/share/nagvis/share/userfiles/images/maps/* done | | /usr/share/nagvis/share/userfiles/images/shapes done | | /usr/share/nagvis/share/userfiles/images/shapes/* done | | /usr/share/nagvis/var done | | /usr/share/nagvis/var/* done | | /usr/share/nagvis/var/tmpl done | | /usr/share/nagvis/var/tmpl/cache done | | /usr/share/nagvis/var/tmpl/compile done | | /usr/share/nagvis/share/var done | | | +------------------------------------------------------------------------------+ | Installation complete | | | | You can safely remove this source directory. | | | | For later update/upgrade you may use this command to have a faster update: | | ./install.sh -n /usr/share/icinga2 -p /usr/share/nagvis -l "unix:/var/run/icinga2/cmd/livestatus" -b mklivestatus -u apache -g apache -w /etc/httpd/conf.d -a n | | | What to do next? | | - Read the documentation | | - Maybe you want to edit the main configuration file? | | Its location is: /usr/share/nagvis/etc/nagvis.ini.php | | - Configure NagVis via browser | | <http://localhost/nagvis/config.php> | | - Initial admin credentials: | | Username: admin | | Password: admin | +------------------------------------------------------------------------------+
; Options for the Automap [automap] ; Default URL parameters for links to the automap defaultparams=„&childLayers=2“ ; Default root host (NagVis uses this if it can't detect it via backend) ; You can configure a hostname here or use „«<monitoring»>“ as „virtual“ ; node which shows the parent tree and all hosts which have no parents ; defined below the is node. ;defaultroot=„«<monitoring»>“ defaultroot=„vml000117.dmz.nausch.org“ ; Path to the graphviz binaries (dot,neato,…); Only needed if not in ENV PATH graphvizpath=„/usr/bin/“
muell
Diese Anweisungen gelten für eine Neuinstallation. Wenn Sie Ihre alte NagVis-Installation aktualisieren, raten wir dringend dazu, ein Backup Ihres NagVis-Verzeichnisses zu machen und die Konfigurationsdateien manuell anzupassen. SCHRITT 0: das System vorbereiten Stellen Sie sicher, dass Ihr System den Systemanforderungen entspricht. SCHRITT 1: NagVis herunterladen Holen Sie sich NagVis, die neueste Version finden Sie unter www.nagvis.org. SCHRITT 2: entpacken Sie NagVis
tar xvzf nagvis-1.8.x.tar.gz
SCHRITT 3: verschieben Sie das entpackte NagVis-Verzeichnis Platzieren Sie den NagVis-Verzeichnisbaum irgendwo in Ihrem System. In den meisten Fällen ist /usr/local/nagvis die beste Wahl.
mv nagvis-1.8.x /usr/local/nagvis
Sie sollten mindestens die folgenden Dateien und Verzeichnisse unter dem nagvis-Verzeichnis sehen
ls -l /usr/local/nagvis
etc LICENSE README share var
Verschieben Sie KEINE Dateien oder Verzeichnisse innerhalb des NagVis-Verzeichnisses (Sie können das tun, aber in diesem Fall müssen Sie einige Parameter und Werte in der Hauptkonfigurationsdatei anpassen/hinzufügen � wenn Sie nichts verändern, sollte es sofort funktionieren) SCHRITT 4: konfigurieren Sie NagVis Wechseln Sie zur neuen Position des NagVis-Verzeichnisses
cd /usr/local/nagvis
Eine Beispiel-Hauptkonfigurationsdatei finden Sie als etc/nagvis.ini.php-sample. Wenn Sie Einstellungen verändern möchten, kopieren Sie dieses Beispiel nach etc/nagvis.ini.php:
cp etc/nagvis.ini.php-sample etc/nagvis.ini.php
Nun können Sie dieses Datei mit Ihrem bevorzugten Texteditor ändern � ich benutze vi:
vi etc/nagvis.ini.php
Die meisten Zeilen in der frisch kopierten nagvis.ini.php sind auskommentiert (beginnen mit einem Semikolon). Wenn Sie verschiedene Einstellungen setzen möchten, dann entfernen Sie das Kommentarzeichen und ändern Sie den Wert. Informationen zu allen möglichen Werten finden Sie in der Formatbeschreibung der Hauptkonfigurationsdatei. SCHRITT 5: konfigurieren des Web-Servers
Seit NagVis 1.5 ist es notwendig, den Web-Server zu konfigurieren, um NagVis zu nutzen. Sie finden eine Beispiel-Konfigurationsdatei in etc/apache2-nagvis.conf-sample. Kopieren Sie einfach die Datei in das conf.d-Verzeichnis Ihres Web-Servers. Dies ist z.B. /etc/apache2/conf.d.
cp etc/apache2-nagvis.conf-sample /etc/apache2/conf.d/apache2-nagvis.conf
Nun müssen Sie die Datei öffnen und auf Ihre Anforderungen anpassen. Es ist wichtig, die Makros @NAGVIS_WEB@ und @NAGVIS_PATH@ durch die korrekten Werte zu ersetzen. In diesem Beispiel müssen Sie @NAGVIS_WEB@ durch /nagvis und @NAGVIS_PATH@ durch /usr/local/nagvis/share ersetzen.
SCHRITT 6: Berechtigungen Dies ist sehr wichtig für eine funktionierende Installation.
Prüfen Sie zuerst, welcher Unix-Account für Ihren Webserver benutzt wird (in meinem Fall wwwrun). Wenn Sie nicht wissen, mit welchem Benutzer der Webserver läuft, dann werfen Sie einen Blick in die Webserver-Konfiguration. Im Falle von Apache können Sie dies mit dem folgenden Befehl tun:
Ubuntu
grep -e 'USER' /etc/apache2/envvars
SuSE/RedHat/Debian (SLES, OpenSuSE, Fedora)
grep -e '^User' /etc/apache2/*.conf
Wenn Ihre Konfigurationsdatei an anderer Stelle liegt, dann passen Sie den obigen Befehl an. Gewähren Sie nun dem Webserver-Benutzer Berechtigungen für das NagVis-Verzeichnis (in meinem Fall sind die Pfade wie folgt):
chown wwwrun:www /usr/local/nagvis -R
chmod 664 /usr/local/nagvis/etc/nagvis.ini.php chmod 775 /usr/local/nagvis/etc/maps chmod 664 /usr/local/nagvis/etc/maps/* chmod 775 /usr/local/nagvis/etc/automaps chmod 664 /usr/local/nagvis/etc/automaps/* chmod 775 /usr/local/nagvis/share/userfiles/images/maps chmod 664 /usr/local/nagvis/share/userfiles/images/maps/* chmod 775 /usr/local/nagvis/var chmod 664 /usr/local/nagvis/var/* chmod 775 /usr/local/nagvis/var/tmpl/cache chmod 664 /usr/local/nagvis/var/tmpl/cache/*
Es ist möglich, restriktivere Berechtigungen für die Dateien zu setzen, aber für die meisten Setups sollten die Beispiele ausreichen. Verändern Sie die Werte nur dann, wenn Sie wissen, was Sie tun! SCHRITT 7: konfigurieren Sie die Maps
Es gibt zwei Wege, NagVis zu konfigurieren. Der erste ist die web-basierte Konfiguration mit Hilfe des NagVis-Frontends (http:<nagiosserver>/<Pfad-zu-NagVis>/). Schauen Sie sich die Optionen des Header-Menüs an. Zum Editieren von Map-Objekten müssen Sie das Objekt entsperren, das Sie bearbeiten möchten. Beim zweiten Weg bearbeiten Sie direkt die Konfigurationsdateien mit dem Text-Editor Ihrer Wahl. Die Map-Konfigurationsdateien befinden sich in etc/maps/. Gültige Formate und Werte finden Sie unter Map Config Format Description. SCHRITT 8: betrachten Sie die Maps Sie sollten nun in der Lage sein, Ihre definierten Maps in Ihrem Browser anzusehen: http:<nagiosserver>/<Pfad-zu-NagVis>/frontend/nagvis-js/?mod=Map&show=<mapname>
(z.B. http://localhost/frontend/nagvis-js/?mod=Map&show=deutschland)
Viel Spaß und bitte melden Sie Bugs!