##
## Nag2web is the new modifyed Version of Nagiosweb build 041904 by Josh jkonkol@users.sourceforge.net 
## Make running, modifyed and adjusted 2004-2005 by nag2web http://nag2web.de mail contact@nag2web.de
## Copyright 2004 - 2005 nag2web
##
##  This short script is tested under SuSe 7.2 > and Debian 3.1.
##  Other OS's will follow.
##
##  Installation of nag2web - for more information go to http://nag2web.de

System requirements

	Linux SuSE 7.2 >  or Debian 3.1
	Mysql 3.23 >
	PHP 4.xx
	apache 1.3 >
	running Nagios 2.xx >


First downlaod the package nag2web-xxx.tar.gz from http://sourceforge.net/projects/nag2web

unpack the archive into your nagios-webpath [original path /usr/local/nagios/share] with 
	
	tar -xvzf nag2web-xxx.tar.gz [your nagios webpath]


following folders and files must included:

nag2web >
	images >	< home of logos and images 
	lang >		< home of language files
	testconfig >	< home of nagios configfiles to test your configuration, there are the same files like ../nagios/etc
		
		LICENSE
		checkcommandlist.php
		checkcommands.php
		commandhelp.php
		contactgrouplist.php
		contactgroups.php
		contactlist.php
		contacts.php
		createtesttxt.php
		createtxt.php
		dbconfig.php
		dependencies.php
		edit.php
		editlist.php
		head.php
		hostgrouplist.php
		hostgroups.php
		hostlist.php
		hosts.php
		include.php
		index.php
		main.php
		notifications.php
		notifylist.php
		runscript.php
		servicegrouplist.php
		servicelist.php	
		services.php
		side.php
		style.css
		testscript.php
		timeperiodlist.php
		timeperiods.php
		top.php
		INSTALL
		nag2web-xxx.sql

! NOTE ! the nagios.cfg in testconfig must be the same as in ../nagios/etc,
	 but the path to configfiles must link to ../nag2web/testconfig as shown here:

	/usr/local/nagios/etc/nagios.cfg	eg.	/usr/local/nagios/etc/some.cfg
	/usr/local/nagios/etc/nagios.cfg	eg.	/usr/local/nagios/share/nag2web/testconfig/some.cfg

Things todo to run nag2web after unpacking the archive

1. in php.ini variable register_globals=on must set, thats not fine but we think you work locally with this tool
	
	for debian only you must use

		dpkg-reconfigure php4-mysql to configure PHP MySQL with commandline.


2. create a MySQL database nag2web on console :

mysql -u root -p[passwort]
mysql> create database nag2web
mysql> quit
Bye
#> nag2web <  /[Pfad zu Datei]/nag2web-x.x.x.sql;


3. create a databaseuser .
    the user minimum must have: SELECT INSERT UPDATE DELETE FILE
    the Query to create a user in mysql 4.xx :

mysql> use mysql
mysql> INSERT INTO `user` ( `Host` , `User` , `Password` , `Select_priv` , `Insert_priv` , `Update_priv` , `Delete_priv` , `Create_priv` , `Drop_priv` , `Reload_priv` , `Shutdown_priv` , `Process_priv` , `File_priv` , `Grant_priv` , `References_priv` , `Index_priv` , `Alter_priv` , `Show_db_priv` , `Super_priv` , `Create_tmp_table_priv` , `Lock_tables_priv` , `Execute_priv` , `Repl_slave_priv` , `Repl_client_priv` , `ssl_type` , `ssl_cipher` , `x509_issuer` , `x509_subject` , `max_questions` , `max_updates` , `max_connections` )
VALUES (
'localhost', 'nag2web', PASSWORD( 'nag2web' ) , 'Y', 'Y', 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', '', '', '', '', '0', '0', '0'
);

3.1 User must have rights to query the DB nag2web ( sample mysql 4.xx):

mysql> INSERT INTO `db` ( `Host` , `Db` , `User` , `Select_priv` , `Insert_priv` , `Update_priv` , `Delete_priv` , `Create_priv` , `Drop_priv` , `Grant_priv` , `References_priv` , `Index_priv` , `Alter_priv` , `Create_tmp_table_priv` , `Lock_tables_priv` )
VALUES (
'localhost', 'nag2web', 'nag2web', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N'
);


now you try to restart mysql:
   
rcmysql restart or /etc/init.d/mysql restart ect.

you can create the user with Tools as phpMyAdmin , ore get other Querys you now to do this.


4. Setup variables in dbconfig.php of directory nag2web as follow:
		
	// Web link of your system
		$WEBLINK='http://localhost';

	// Database name
		$DATABASE='nag2web';

	// Database hostname
		$DBHOST='localhost';

	// Database user
		$DBUSER='nag2web';

	// Database user password
		$DBPASS='nag2web';

	// Install directory name
		$INSTDIR='nag2web';

	// $prefix is the path to where nagios is installed
		$prefix='/usr/local/nagios';
		$etcprefix = $prefix . '/etc';

	// Path to htdocs directory
		$htdocsdir='/usr/local/nagios/share';

	// Path to languagefile
		$lang='/usr/local/nagios/share/nag2web/lang/lang-en.inc.php';

	// Full path to php binary, include php
		$phppath='/usr/bin/php';


5.  Setup rights for webserver:
	
	make sure the webserver has rigths to execute the binary-files in 
	
	/usr/local/nagios/bin
	/usr/local/nagios/var/rw
	
	and have rights to write the config-files in
	
	/usr/local/nagios/etc

Next step :

	Create alias in apache config /etc/apache2/sites-available/default:
	    Alias /nag2web/ "/usr/local/nagios/share/nag2web/"
	    <Directory "/usr/local/nagios/share/nag2web/">
	     Options Indexes MultiViews FollowSymLinks
	     AllowOverride AuthConfig
	     Order deny,allow
	     Deny from all
	     Allow from all
	     # Allow from 127.0.0.0/255.0.0.0 ::1/128
	    </Directory>

	Optional you can use a .htaccess file for different authentication.

Thats is, have fun and enjoy -- your Nag2Web Team

