Installing NagisoGrapher
========================

REQUIREMENTS
------------

- Nagios with a working webinterface

- Tobi Oetiker's rrdtool (http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/)
  => Always use the newest rrdtool!

- perl with at least following modules: CGI, GD, RRDs, Time::Hires, Image::Magick, ...
  please use make testdeps

- autoconf for easy installing

INSTALLING
----------

The install process has changed! Now we are using autoconf.

1.) Nagios installed from sources under /usr/local/nagios
  a) autoconf
  b) ./configure
  c) make testdeps
  d) fix dependencies (use "make fixdeps" to get them from CPAN.org)
  e) make install
  f) follow the messages

2.) Nagios installed on different places
  a) alter config.layout to fit your installation (see LAYOUTS for documentation)
  b) autoconf
  c) ./configure --with-layout=[your-layout]
  d) make testdeps
  e) fix dependencies (use "make fixdeps" to get them from CPAN.org)
  f) make install'
  g) follow the messages

  h) send us your layout :-)

For updating nagios use "make update" instead of "make install"

LAYOUTS
-------

For creating custom layouts see './LAYOUT'

You can use different layouts with the --enable-layout=[your-layout] switch,
maybe based on the --prefix you've given.

OLD/MANUAL INSTALLATION
----------------------

1.  untar the package whereever you want

2.  copy fifo_write.pl, collect2.pl and NagiosGrapher.pm to your Nagios
    installation (eg. /usr/share/nagios/contrib)

3.  copy *.cgi to your Nagios CGI folder
    eg. /usr/lib/cgi-bin/nagios

4.  link NagiosGrapher.pm to your CGI folder
    eg. ln -s /usr/share/nagios/contrib/NagiosGrapher.pm /usr/lib/cgi-bin/nagios

    (Or you can link it in a perl INC path e.g. /etc/perl or whatever)

5.  copy ngraph.cfg to your Nagios ETC folder
    eg. /etc/nagios

    In the Nagios ETC Folder, create a new one named 'ngraph.d'. In the ngraph.d folder
    you can copy the template files or create one by self.

6.  copy graph.png to your Nagios Logo Graphics folder
    eg. /usr/share/nagios/htdocs/images/logos/

7.  copy the NagiosGrapher start/stop-script to your rc?.d folders
	Perhabs you have to modify the DAEMON paths if the daemon is not located
	in '/usr/share/nagios/contrib'.

8.  Alter the config block in ngraph.cfg to fit your requisitions.

9.  If path of ngraph.cfg isn't /etc/nagios/ngraph.cfg alter the path of
    ngraph.cfg inside NagiosGrapher.pm

11. create /var/lib/nagios folder and allow the user under which nagios is
    runing writeable access

12. enable inside nagios.cfg:
    process_performance_data=1
    service_perfdata_command=process-service-perfdata

13. activate the process-service-perfdata command:

	NOTE: if you are using Nagios 1.3 please use the following variables:
		'$HOSTNAME$\t$SERVICEDESC$\t$OUTPUT$\t$PERFDATA$\n'

	interface 'pipe'
	----------------

    define command {
		command_name   process-service-perfdata
		command_line    /usr/lib/nagios/eventhandlers/fifo_write.pl /var/lib/nagios/ngraph.pipe '$HOSTNAME$\t$SERVICEDESC$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n' 3
    }

    interface 'network'
	-------------------

	define command{
		command_name    process-service-perfdata
		command_line    echo '$HOSTNAME$\t$SERVICEDESC$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n' | nc -u -w 3 localhost 5667
	}

Now the installations is finished. To configure NagiosGrapher read CONFIG
