Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
installation_nagiosql [2015/07/14 13:01] admin [Anpassung nagios.cfg] |
installation_nagiosql [2015/08/14 09:50] (aktuell) admin |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== Installation NagiosQL ====== | ====== Installation NagiosQL ====== | ||
- | NagiosQL ist eine Konfigurations-Oberfläche für Nagios auf LAMP-Basis. | + | NagiosQL ist eine Konfigurations-Oberfläche für Nagios auf LAMP-Basis. NagiosQL ist Teil der kommerziellen Nagios-Variante "Nagios XI" |
===== Voraussetzungen ===== | ===== Voraussetzungen ===== | ||
Zeile 10: | Zeile 10: | ||
Es werden spezielle PHP Module benötigt: | Es werden spezielle PHP Module benötigt: | ||
- | ‐ session | + | * session |
- | ‐ MySQL (php5‐mysql) | + | * MySQL (php5‐mysql) |
- | ‐ gettext | + | * gettext |
- | ‐ filter | + | * filter |
- | ‐ ftp (optional – für FTP Verbindung zu entfernten Servern) | + | * ftp (optional – für FTP Verbindung zu entfernten Servern) |
- | ‐ SSH (PECL Modul – optional – für SSH/SCP Verbindung zu entfernten Servern) | + | * SSH (PECL Modul – optional – für SSH/SCP Verbindung zu entfernten Servern) |
Welche Module installiert sind, lässt sich mit ''php -m'' anzeigen. Im vorliegenden Fall muss nur SSH nachinstalliert werden | Welche Module installiert sind, lässt sich mit ''php -m'' anzeigen. Im vorliegenden Fall muss nur SSH nachinstalliert werden | ||
<code bash> | <code bash> | ||
- | apt-get install libssh2-php | + | apt-get install libssh2-php php5-curl |
</code> | </code> | ||
Zeile 36: | Zeile 36: | ||
# Berechtigungen: | # Berechtigungen: | ||
- | chown -R www-data.nagcmd /usr/local/nagiosql/etc | + | chown -R www-data.nagios /usr/local/nagiosql/etc |
# Berechtigungen der Nagios-Installation anpassen: | # Berechtigungen der Nagios-Installation anpassen: | ||
- | chown -R www-data.nagcmd /usr/local/nagios/etc/nagios.cfg | + | chown -R www-data.nagios /usr/local/nagios/etc/nagios.cfg |
- | chown -R www-data.nagcmd /usr/local/nagios/etc/cgi.cfg | + | chown -R www-data.nagios /usr/local/nagios/etc/cgi.cfg |
- | #chown -R www-data.nagcmd /usr/local/nagios/etc/resource.cfg | + | chown -R www-data.nagios /usr/local/nagios/etc/resource.cfg |
chown -R www-data.nagcmd /usr/local/nagios/var/rw/nagios.cmd | chown -R www-data.nagcmd /usr/local/nagios/var/rw/nagios.cmd | ||
chmod 640 /usr/local/nagios/etc/nagios.cfg | chmod 640 /usr/local/nagios/etc/nagios.cfg | ||
chmod 640 /usr/local/nagios/etc/cgi.cfg | chmod 640 /usr/local/nagios/etc/cgi.cfg | ||
chmod 660 /usr/local/nagios/var/rw/nagios.cmd | chmod 660 /usr/local/nagios/var/rw/nagios.cmd | ||
+ | chgrp www-data /usr/local/nagios/bin/nagios | ||
+ | chmod g+x /usr/local/nagios/bin/nagios | ||
</code> | </code> | ||
Zeile 64: | Zeile 65: | ||
;;;;;;;;;;;;;;;;;;;;;; | ;;;;;;;;;;;;;;;;;;;;;; | ||
extension = ssh2.so | extension = ssh2.so | ||
+ | extension = curl.so | ||
; ... | ; ... | ||
</code> | </code> | ||
Zeile 76: | Zeile 78: | ||
Order allow,deny | Order allow,deny | ||
Allow from all | Allow from all | ||
+ | Require all granted | ||
# Order deny,allow | # Order deny,allow | ||
# Deny from all | # Deny from all | ||
# Allow from 127.0.0.1 | # Allow from 127.0.0.1 | ||
- | AuthName "Nagios Access" | + | # AuthName "Nagios Access" |
- | AuthType Basic | + | # AuthType Basic |
- | AuthUserFile /usr/local/nagios/etc/htpasswd.users | + | # AuthUserFile /usr/local/nagios/etc/htpasswd.users |
- | Require valid-user | + | # Require valid-user |
</Directory> | </Directory> | ||
</code> | </code> | ||
Zeile 129: | Zeile 132: | ||
cfg_file=/usr/local/nagiosql/etc/hostextinfo.cfg | cfg_file=/usr/local/nagiosql/etc/hostextinfo.cfg | ||
cfg_file=/usr/local/nagiosql/etc/serviceextinfo.cfg | cfg_file=/usr/local/nagiosql/etc/serviceextinfo.cfg | ||
+ | </code> | ||
+ | |||
+ | ===== Weitere Konfiguration ===== | ||
+ | Damit die Installation vollständig die Nagios-Installation findet, müssen im NagiosQL Webinterface unter ''Konfig-Domäne'' noch die Pfade angepasst werden. | ||
+ | |||
+ | <code> | ||
+ | Nagios Command Datei: /usr/local/nagios/var/rw/nagios.cmd | ||
+ | Nagios Binary Datei: /usr/local/nagios/bin/nagios | ||
+ | Nagios Prozess Datei: /usr/local/nagios/var/nagios.lock | ||
+ | </code> | ||
+ | |||
+ | ===== Nagios 4 - Anpassung verify.php ===== | ||
+ | Ab Nagios 4 hat sich der Command zum Restart geändert. dementsprechend muss im NagiosQL in der Datei ''admin/verigy.php'' die Zeile 345 angepasst werden. | ||
+ | <code php> | ||
+ | # vi /usr/local/nagiosql/share/admin/verify.php | ||
+ | # ... | ||
+ | #$strCommandString = "[".mktime()."] RESTART_PROGRAM;".mktime(); # ALT | ||
+ | $strCommandString = "[".mktime()."] RESTART_PROGRAM\n"; # NEU | ||
+ | # ... | ||
+ | </code> | ||
+ | |||
+ | ===== preg_replace depricated - Anpassung IT.php ===== | ||
+ | Da NagiosQL nicht an allen Stellen die neueste PHP-Syntax verwendet, kommt es im Apache2-error.log zu folgender Fehlermeldung. | ||
+ | <code bash> | ||
+ | PHP Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /usr/local/nagiosql/share/libraries/pear/HTML/Template/IT.php on line 1095 | ||
+ | </code> | ||
+ | Wie in der Meldung schon vorgeschlagen, wird in der IT.php das ''preg_replace'' durch ''preg_replace_callback'' ausgetauscht. | ||
+ | <code php> | ||
+ | // vi /usr/local/nagiosql/share/libraries/pear/HTML/Template/IT.php | ||
+ | // ... | ||
+ | /* ALT | ||
+ | return preg_replace( | ||
+ | "#<!-- INCLUDE (.*) -->#ime", | ||
+ | "\$this->getFile('\\1')", | ||
+ | $content | ||
+ | ); | ||
+ | */ | ||
+ | // NEU | ||
+ | return preg_replace_callback( | ||
+ | "#<!-- INCLUDE (.*) -->#im", | ||
+ | array($this, 'getFile'), | ||
+ | $content | ||
+ | ); | ||
+ | |||
+ | // ... | ||
</code> | </code> |