File pnp4nagios.quick-start.txt of Package pnp4nagios

== Configuration of PNP for Nagios ==

Please find the configuration files for PNP4Nagios in
  /etc/pnp4nagios
and adapt especially
 /etc/pnp4nagios/config_local.php
to your needs (/etc/pnp4nagios/config.php is the master template).


=== Configuring Apache2 ===

The pnp graphs can be viewed with a webinterface. If the webserver
is not already running, start it with the following two commands:

	insserv apache2
	rcapache2 start

Per default, only connects from localhost are allowed. Adjust the configfile
'''/etc/apache2/conf.d/pnp4nagios.conf''' for your needs. And define the 
apache server flag '''PNP4NAGIOS''' in '''/etc/sysconfig/apache2''' in the 
following line:

            APACHE_SERVER_FLAGS="PNP4NAGIOS"

 Note: this can be done via "a2enflag PNP4NAGIOS" as root on the commandline
       if not already done during the installation of the pnp4nagios package.

If not already done for nagios, create a password file for apache and add an 
apache user named 'nagiosadmin' (or any other username you like):

	touch /etc/nagios/htpasswd.users
	chown root:www /etc/nagios/htpasswd.users
	chmod 640 /etc/nagios/htpasswd.users
	htpasswd2 -s /etc/nagios/htpasswd.users nagiosadmin

You can also use an alternative htpasswd file to allow only a limited amount 
of people to view the pnp graphs.

Therefore you should point the 'AuthUserFile' value in 
'''/etc/apache2/conf.d/pnp4nagios.conf''' to the location of your htpasswd file.

=== Configuring Nagios ===

Your next step should now be to enable performance data
in your '''/etc/nagios/nagios.cfg''' with following option:

     enable_environment_macros=1
     process_performance_data=1
and: 
     host_perfdata_command=process-host-perfdata
     service_perfdata_command=process-service-perfdata

In your commands.cfg you have to add a commands like this:

 define command {
    command_name    process-service-perfdata
    command_line    $USER1$/process_perfdata.pl
 }

 define command {
    command_name    process-host-perfdata
    command_line    $USER1$/process_perfdata.pl -d HOSTPERFDATA
 }

=> Or just copy /etc/pnp4nagios/pnp4nagios.cfg into a folder below /etc/nagios/ that is 
   included in your configuration.

After this set the service option:

 process_perf_data 1

for each service that supports 'real' performance data
and finaly which you wants to see within PNP.

{{Info|With Nagios 3.x you can put "process_perf_data 1" in your service definition or template!}}


=== Including links in Nagios' Webfrontend ===

For integrating the URLs you could create "hostextinfo" or "serviceextinfo"
objects:

 # For all hosts go to the overview page
 define hostextinfo {
    host_name   *
    action_url  /pnp/index.php/graph?host=$HOSTNAME$
 }

or

 # For one service
 define serviceextinfo {
    host_name       localhost
    service_description Ping
    action_url  /pnp/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
 }

{{Info|With Nagios 3.x you can put "action_url" in your service definition or template!}}


== Enabling the Nagios-Perfdata-C-Daemon ==

Don't forget to enable the Nagios-Perfdata-C-Daemon with

    insserv npcd
    rcnpcd start

at the end...

Have a lot of fun!


openSUSE Build Service is sponsored by