
nagios-php: Alternative Nagios Interface written in PHP

Requirements:

	PEAR Auth (http://pear.php.net/package/Auth) * (See comment below)
		Known to work with version 1.2.3
	PEAR Files_Passwd (this is the currently used method, but can be changed by tweaking PEAR Auth
		Known to work with version 1.1.0
	and installing the required PEAR package - see http://pear.php.net/package/Auth/)
	Smarty (http://smarty.php.net/)
	Nagios 1.x 


1. Install

Using the supplied perl script, it should be easy enough to install.

Two other steps to follow are: (see config below)
	1. Create a user/password using htpasswd.
	2. Updating permissions for the respective user.


2. Manifest

There are 4 directories to this tarball:

php/html
php/inc
config
smarty

php/html:
	Contains all the .html, .php and image files to be places on the
	(typically) /Nagios/ directory on the webserver.

	put style/* into the /style directory on your webserver.

php/inc:
	Contains two inc.php files -

	nagios.php.inc:
		Nagios PHP class and shared functions

	blacksmith.php.inc:
		Blacksmith framework. a wrapper around smarty and auth.

	I put these in a directory out of the webserver, but in PHP's include path.
	you can, however, put this in the same dir as php/html.

config:
	* blacksmith.cfg is this is the configuration file for the Blacksmith framework.
	change $blacksmith_config in blacksmith.php.inc to point to blacksmith.cfg.

	currently (see below for notice) blacksmith only uses file based authentication,
	the passwd variable configures its location:

		passwd=/home/httpd/var/blacksmith/passwd

	autherization done in blacksmith:

	currently, only URL based autherization is performed.

	by default, any user is autherized for anything that uses blacksmith.php.inc.
	you can limit a certain user by putting a userperm_<username> variable and specifying
	a regex.

	for example, to limit user noc only for /Nagios-NOC/ use:
		userperm_noc=/^\/Nagios-NOC\//

	* nagios-php.cfg is the nagios PHP configuration file.
	change $nagios_php_config_file in nagios.php.inc to point to this file.

smarty:
	contains *.tpl files for smarty.
	if you haven't set up smarty applications before, here's a kickstart:

		create a directory for smarty. I use /home/httpd/smarty.
		create a directory for blacksmith as a smarty app, I use /home/httpd/smarty/blacksmith
		edit blacksmith.cfg's basedir to point to this:
			basedir=/home/httpd/smarty/blacksmith/
	
		now create 4 smarty directories inside it:
			cache
			configs
			templates
			templates_c

		note: cache and templates_c are needed to be in the webserver group, and written by it.

3. About PEAR Auth in this release:
	I've hardcoded Auth to use File authentication method. (manipulated using htpasswd)
	You can change this very easily, since Auth supports many methods.
	




-- Eldad Zack <eldadzack@gmail.com>