Benutzer-Werkzeuge

Webseiten-Werkzeuge


tachtler:nagios_-_epel_installation

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
tachtler:nagios_-_epel_installation [2013/07/23 14:05] klaustachtler:nagios_-_epel_installation [2013/07/23 22:52] (aktuell) – [Installation] klaus
Zeile 7102: Zeile 7102:
     * ''cgi.cfg''     * ''cgi.cfg''
     * ''nagios.cmd''     * ''nagios.cmd''
-    * **optional:** ''htpasswd.users'' +    * **optional:** ''htpasswd.users''  
   * Für **größere** [[http://www.nagios.com|Nagios]]-Installation sind evtl. die [[http://www.php.net/|PHP]]-Module erforderlich:   * Für **größere** [[http://www.nagios.com|Nagios]]-Installation sind evtl. die [[http://www.php.net/|PHP]]-Module erforderlich:
     * ''php-apc'' **oder** ''php-pear-apc''     * ''php-apc'' **oder** ''php-pear-apc''
Zeile 7225: Zeile 7225:
 elseif(file_exists('/var/spool/nagios/cmd/nagios.cmd'))  //yum install  elseif(file_exists('/var/spool/nagios/cmd/nagios.cmd'))  //yum install 
 -- --
-        // Tachtler+ // Tachtler
  // default: $cgifile = '/var/nagios/rw/nagios.cmd';  // default: $cgifile = '/var/nagios/rw/nagios.cmd';
  $cgifile = '/var/spool/nagios/cmd/nagios.cmd';  $cgifile = '/var/spool/nagios/cmd/nagios.cmd';
Zeile 7489: Zeile 7489:
 </code> </code>
  
-==== Konfiguration ====+==== Konfiguration: /usr/share/nagios/html/nagiosmobile/include.inc.php ==== 
 + 
 +Nach der erfolgreichen Installation durch die Installationsdatei ''/tmp/nagiosmobile/INSTALL.php'', kann mit nachfolgendem Befehl in des Installationsverzeichnis gewechselt werden 
 +<code> 
 +# cd /usr/share/nagios/html/nagiosmobile 
 +</code> 
 +und der Inhalt des nue entstandenen Verzeichnisses mit nachfolgendem Befehl aufgelistet werden: 
 +<code> 
 +# ls -la /usr/share/nagios/html/nagiosmobile 
 +total 68 
 +drwxr-xr-x  6 root root 4096 Jul 23 14:03 . 
 +drwxrwxr-x 12 root root 4096 Jul 23 14:03 .. 
 +-rwxr-xr-x  1 root root  493 Jul 23 14:03 CHANGES 
 +drwxr-xr-x  2 root root 4096 Jul 23 14:03 class 
 +-rwxr-xr-x  1 root root   68 Jul 23 14:03 footer.inc.php 
 +-rwxr-xr-x  1 root root 4978 Jul 23 14:03 header.inc.php 
 +-rwxr-xr-x  1 root root 4448 Jul 23 14:03 include.inc.php 
 +drwxr-xr-x  2 root root 4096 Jul 23 14:03 includes 
 +-rwxr-xr-x  1 root root 5385 Jul 23 14:03 index.php 
 +drwxr-xr-x  3 root root 4096 Jul 23 14:03 jquery.mobile-1.0 
 +drwxr-xr-x  2 root root 4096 Jul 23 14:03 js 
 +-rwxr-xr-x  1 root root 1423 Jul 23 14:03 nagiosmobile.css 
 +-rwxr-xr-x  1 root root 3631 Jul 23 14:03 nagios.png 
 +-rwxr-xr-x  1 root root 2984 Jul 23 14:03 TODO.txt 
 +</code> 
 + 
 +Hier befindet sich die Konfigurationsdatei 
 +  * **''/usr/share/nagios/html/nagiosmobile/include.inc.php''** 
 + 
 +Hier müssen, leider **nochmals** einige Pfade angepasst werden. 
 + 
 +  * **''$STATUS_FILE''** = ''/var/log/nagios/status.dat'' 
 +  * **''$COMMAND_FILE''** = ''/var/spool/nagios/cmd/nagios.cmd'' 
 +  * **''$CGI_FILE''** = ''/etc/nagios/cgi.cfg'' 
 +  * **''$OBJECTS_FILE''** = ''/var/log/nagios/objects.cache'' 
 + 
 +:!: **HINWEIS** - Nachfolgend sind __NUR__ die relevanten Änderungen aufgelistet: 
 +<code php> 
 +# cat /usr/share/nagios/html/nagiosmobile/include.inc.php | grep -A 2 Tachtler 
 +// Tachtler 
 +// default: $STATUS_FILE  = "/usr/local/nagios/var/status.dat"; 
 +$STATUS_FILE  = "/var/log/nagios/status.dat"; 
 +// Tachtler 
 +// default: $COMMAND_FILE = "/usr/local/nagios/var/rw/nagios.cmd"; 
 +$COMMAND_FILE = "/var/spool/nagios/cmd/nagios.cmd"; 
 +// Tachtler 
 +// default: $CGI_FILE = "/usr/local/nagios/etc/cgi.cfg"; 
 +$CGI_FILE = "/etc/nagios/cgi.cfg"; 
 +// Tachtler 
 +// default: $OBJECTS_FILE = "/usr/local/nagios/var/objects.cache";  
 +$OBJECTS_FILE = "/var/log/nagios/objects.cache"; 
 +</code> 
 + 
 +Nachfolgend die **komplette** Konfigurationsdatei ''/usr/share/nagios/html/nagiosmobile/include.inc.php'': 
 +<code php> 
 +<?php  
 +// include.inc.php  
 +// main include file for all global variables, constants, and script includes 
 +// @author Mike Guthrie 
 +// @author Hirose Masaaki 
 + 
 + 
 +//////////////////FILE LOCATIONS:  EDIT THESE TO MATCH YOUR NAGIOS INSTALLATION////// 
 +//////////////////////////////////////////////////////////////////////////////////// 
 +// Tachtler 
 +// default: $STATUS_FILE  = "/usr/local/nagios/var/status.dat"; 
 +$STATUS_FILE  = "/var/log/nagios/status.dat"; 
 +// Tachtler 
 +// default: $COMMAND_FILE = "/usr/local/nagios/var/rw/nagios.cmd"; 
 +$COMMAND_FILE = "/var/spool/nagios/cmd/nagios.cmd"; 
 +// Tachtler 
 +// default: $CGI_FILE = "/usr/local/nagios/etc/cgi.cfg"; 
 +$CGI_FILE = "/etc/nagios/cgi.cfg"; 
 +// Tachtler 
 +// default: $OBJECTS_FILE = "/usr/local/nagios/var/objects.cache";  
 +$OBJECTS_FILE = "/var/log/nagios/objects.cache";  
 +$BASE_URL = '/nagiosmobile'; 
 +$TTL = 30; //Time to live for cached data parsed from status and objects file  
 +$USER = ''; //you can hard-code the 'nagiosadmin' if you don't want any authentication: NOT RECOMMENDED!!  
 +/////////////////////////////////////////////////////////////////////////////////// 
 +////////////////////DO NOT MAKE CHANGES BELOW THIS LINE///////////////////////////// 
 + 
 + 
 +// Nagios Mobile 1.0 
 +// Copyright (c) 2011 Nagios Enterprises, LLC 
 +// Web: http://www.nagios.com/products/nagiosmobile 
 +// Developed by Mike Guthrie and Wesley Zhao.   
 +// Based on Teeny Nagios by HIROSE Masaaki.  
 + 
 +// LICENSE: 
 +// 
 +// This work is made available to you under the terms of Version 2 of 
 +// the GNU General Public License. A copy of that license should have 
 +// been provided with this software, but in any event can be obtained 
 +// from http://www.fsf.org. 
 +//  
 +// This work is distributed in the hope that it will be useful, but 
 +// WITHOUT ANY WARRANTY; without even the implied warranty of 
 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
 +// General Public License for more details. 
 +//  
 +// You should have received a copy of the GNU General Public License 
 +// along with this program; if not, write to the Free Software 
 +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
 +// 02110-1301 or visit their web page on the internet at 
 +// http://www.fsf.org. 
 +// 
 +// 
 +// CONTRIBUTION POLICY: 
 +// 
 +// (The following paragraph is not intended to limit the rights granted 
 +// to you to modify and distribute this software under the terms of 
 +// licenses that may apply to the software.) 
 +// 
 +// Contributions to this software are subject to your understanding and acceptance of 
 +// the terms and conditions of the Nagios Contributor Agreement, which can be found  
 +// online at: 
 +// 
 +// http://www.nagios.com/legal/contributoragreement/ 
 +// 
 +// 
 +// DISCLAIMER: 
 +// 
 +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
 +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A  
 +// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT  
 +// HOLDERS BE LIABLE FOR ANY CLAIM FOR DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 
 +// OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE  
 +// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR OTHER 
 +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, STRICT LIABILITY, TORT (INCLUDING  
 +// NEGLIGENCE OR OTHERWISE) OR OTHER ACTION, ARISING FROM, OUT OF OR IN CONNECTION  
 +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
 + 
 + 
 +//////////INCLUDES 
 +require_once('includes/functions.inc.php');  
 +require_once('includes/displayfunctions.inc.php'); 
 +require_once('includes/parse_cgi_file.inc.php');  
 +require_once('includes/parse_objects_file.inc.php'); 
 +require_once('includes/parse_status_file.inc.php'); 
 +require_once('class/NagiosUser.php'); 
 +require_once('class/NagiosData.php'); 
 + 
 +///////////CONSTANTS 
 +define("TN_VERSION", "1.03"); 
 +define("HOST_UP",          0); 
 +define("HOST_DOWN",        1); 
 +define("HOST_UNREACHABLE", 2); 
 +define("STATE_OK",       0); 
 +define("STATE_WARNING",  1); 
 +define("STATE_CRITICAL", 2); 
 +define("STATE_UNKNOWN",  3); 
 +define("CHILD_PROBLEM", 99);  
 + 
 +$HOST_STATUS_BY = array( 
 +                        HOST_UP          => "Up", 
 +                        HOST_DOWN        => "Down", 
 +                        HOST_UNREACHABLE => "Unreachable", 
 +                        ); 
 +$SERVICE_STATUS_BY = array( 
 +                           STATE_OK       => "OK", 
 +                           STATE_WARNING  => "Warning", 
 +                           STATE_CRITICAL => "Critical", 
 +                           STATE_UNKNOWN  => "Unknown", 
 +                           ); 
 + 
 +//////APC 
 +//use apc if we've got it  
 +$APC = (function_exists('apc_add') && function_exists('apc_fetch') && function_exists('apc_exists')) ? true : false;  
 +  
 + 
 + 
 +?> 
 +</code> 
 + 
 +==== Konfiguration: /etc/httpd/conf.d/vhost ==== 
 + 
 +:!: **HINWEIS** - Bevor ein erster Start von [[http://www.nagios.com/products/nagiosmobile|Nagios Mobile]] durchgeführt werden kann, soll die Einrichtung des Webservers, hier der [[http://httpd.apache.org/|Apache HTTP Server]], statt finden, da sonst evtl. Konfigurationen nicht im Web-Interface von [[http://www.nagios.com/products/nagiosmobile|Nagios Mobile]] dargestellt werden können! 
 + 
 +Hier soll die Konfiguration eines **virtuellen Host** für den [[http://httpd.apache.org/|Apache HTTP Server]] beschrieben werden. Der Aufruf von [[http://www.nagios.com/products/nagiosmobile|Nagios Mobile]] soll über die URL 
 +  * http://www.nagiosmobile.tachtler.net 
 +ermöglicht werden. 
 + 
 +:!: **HINWEIS** - Falls Sie noch keine Erfahrungen mit **virtuellen Hosts** in Verbindung mit dem [[http://httpd.apache.org/|Apache HTTP Server]] haben sollten, lesen Sie bitte die Dokumentation des //Apache HTTP Server Projektes//, da hier nur die grundlegenden Schritte erläutert werden. 
 + 
 +Falls noch nicht geschehen wird im Verzeichnis ''/etc/httpd/conf.d'' eine Datei mit dem Namen ''vhosts.conf'' erstellt. Der Inhalt dieser Datei sollte minimal für einen **virtuellen Host** für [[http://www.nagios.com/products/nagiosmobile|Nagios Mobile]] wie folgt aussehen: 
 +<code apache> 
 +# This configuration file enables the vhosts to this 
 +# Server 
 +
 + 
 +NameVirtualHost *:80 
 + 
 +
 +# nagiosmobile.tachtler.net (Nagios Monitoring) 
 +
 +<VirtualHost *:80> 
 +        ServerAdmin webmaster@tachtler.net 
 +        ServerName nagiosmobile.tachtler.net 
 +        ServerAlias www.nagiosmobile.tachtler.net 
 +        ServerPath / 
 + 
 +        Alias /nagiosmobile "/usr/share/nagios/html/nagiosmobile" 
 + 
 +        <Directory "/usr/share/nagios/html/nagiosmobile"> 
 +                AllowOverride None 
 +                Order allow,deny 
 +                Allow from all 
 +                # 
 +                # Use the same value as defined in nagios.conf 
 +                # 
 +                AuthName "Nagios Mobile Access" 
 +                AuthType Basic 
 +                AuthUserFile /etc/nagios/passwd 
 +                Require valid-user 
 +        </Directory> 
 + 
 +        DirectoryIndex index.html index.php 
 +        ErrorLog logs/nagiosmobile_error.log 
 +        CustomLog logs/nagiosmobile_access.log combined 
 +</VirtualHost> 
 +</code> 
 + 
 +:!: **WICHTIG** - **//Die mit der Installation mitgelieferte Konfigurationsdatei ''/etc/httpd/conf.d/nagiosmobile.conf'' kann entweder gelöscht, oder besser deren Inhalt "auskommentiert" werden, damit es mit diesem neuen virtuellen Host nicht zu Überschneidungen kommen kann!//** 
 + 
 +Ein erneuter oder erster Start des [[http://httpd.apache.org/|Apache HTTP Server]] mit folgenden Befehl für eine erstmaligen Start 
 +<code> 
 +# service httpd start 
 +</code> 
 +oder einen erneuten Start des [[http://httpd.apache.org/|Apache HTTP Server]] mit folgendem Befehl 
 +<code> 
 +# service httpd restart 
 +</code> 
 +macht die oben beschriebenen Konfigurationen für den [[http://httpd.apache.org/|Apache HTTP Server]] wirksam. 
 + 
 +Nach dem Erfolgreichen Aufruf des Links [[http://www.nagiosmobile.tachtler.net|http://www.nagiosmobile.tachtler.net]] sollte folgende Standard-Startseite erscheinen: 
 + 
 +{{:tachtler:nagios:screenshot_nagiosmobile.png|Nagios Mobile - Bildschirmkopie}}
  
-''/usr/share/nagios/html/nagiosmobile'' 
tachtler/nagios_-_epel_installation.1374581105.txt.gz · Zuletzt geändert: 2013/07/23 14:05 von klaus